NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

PR/58561 CVS commit: src/sys/arch/i386



The following reply was made to PR port-xen/58561; it has been noted by GNATS.

From: "Manuel Bouyer" <bouyer%netbsd.org@localhost>
To: gnats-bugs%gnats.NetBSD.org@localhost
Cc: 
Subject: PR/58561 CVS commit: src/sys/arch/i386
Date: Sat, 17 Jan 2026 10:59:10 +0000

 Module Name:	src
 Committed By:	bouyer
 Date:		Sat Jan 17 10:59:10 UTC 2026
 
 Modified Files:
 	src/sys/arch/i386/i386: i386_trap.S locore.S spl.S
 	src/sys/arch/i386/include: frameasm.h
 
 Log Message:
 Port amd64 fix for PR port-xen/58561 to i386, with one extra fix:
 with recent Xen (maybe since pvshim), traps handlers are called with
 interrupts enabled, so adjust the i386 assembly code for this.
 updating curcup()->ci_vcpu->evtchn_upcall_mask requires 2 intructions, e.g.
 movl CPUVAR(VCPU),reg
 movb $1,EVTCHN_UPCALL_MASK(reg)
 With preemption enabled we may be moved to another CPU between the
 2 intructions and we end up updating the evtchn_upcall_mask of another VCPU
 than the one we're now running on.
 Fix for Xen/i386:
 - Add a CLI2 macro, which disables preemtion before the above sequence.
   Use it instead of CLI where preemtion may be enabled
 - Add DIAGNOSTIC code to check that preemtion is disabled in CLI
 - Add DIAGNOSTIC code to check that interrupts are disabled when calling STI     and STIC
 - rename PUSHF to PUSHFCLI and change it to both read and disable
   EVTCHN_UPCALL_MASK with preemption disabled
 - remove the XENPVHVM version of STIC which is unused
 
 
 To generate a diff of this commit:
 cvs rdiff -u -r1.24 -r1.25 src/sys/arch/i386/i386/i386_trap.S
 cvs rdiff -u -r1.205 -r1.206 src/sys/arch/i386/i386/locore.S
 cvs rdiff -u -r1.58 -r1.59 src/sys/arch/i386/i386/spl.S
 cvs rdiff -u -r1.35 -r1.36 src/sys/arch/i386/include/frameasm.h
 
 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.
 


Home | Main Index | Thread Index | Old Index