Use %eax rather than %ax when loading segment registers to avoid partial

register stalls.

Reviewed by:	bde (a while ago, and I think an earlier version)
This commit is contained in:
John Baldwin 2004-04-16 19:26:37 +00:00
parent 86f4fd6f71
commit 79cdd799f6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=128328
4 changed files with 53 additions and 53 deletions

View file

@ -73,10 +73,10 @@
IDTVEC(vec_name) ; \
PUSH_FRAME ; \
movl $KDSEL, %eax ; /* reload with kernel's data segment */ \
mov %ax, %ds ; \
mov %ax, %es ; \
movl %eax, %ds ; \
movl %eax, %es ; \
movl $KPSEL, %eax ; /* reload with per-CPU data segment */ \
mov %ax, %fs ; \
movl %eax, %fs ; \
FAKE_MCOUNT(13*4(%esp)) ; \
movl lapic, %edx ; /* pointer to local APIC */ \
movl LA_ISR + 16 * (index)(%edx), %eax ; /* load ISR */ \
@ -127,12 +127,12 @@ IDTVEC(invltlb)
pushl %eax
pushl %ds
movl $KDSEL, %eax /* Kernel data selector */
mov %ax, %ds
movl %eax, %ds
#ifdef COUNT_XINVLTLB_HITS
pushl %fs
movl $KPSEL, %eax /* Private space selector */
mov %ax, %fs
movl %eax, %fs
movl PCPU(CPUID), %eax
popl %fs
incl xhits_gbl(,%eax,4)
@ -160,12 +160,12 @@ IDTVEC(invlpg)
pushl %eax
pushl %ds
movl $KDSEL, %eax /* Kernel data selector */
mov %ax, %ds
movl %eax, %ds
#ifdef COUNT_XINVLTLB_HITS
pushl %fs
movl $KPSEL, %eax /* Private space selector */
mov %ax, %fs
movl %eax, %fs
movl PCPU(CPUID), %eax
popl %fs
incl xhits_pg(,%eax,4)
@ -194,12 +194,12 @@ IDTVEC(invlrng)
pushl %edx
pushl %ds
movl $KDSEL, %eax /* Kernel data selector */
mov %ax, %ds
movl %eax, %ds
#ifdef COUNT_XINVLTLB_HITS
pushl %fs
movl $KPSEL, %eax /* Private space selector */
mov %ax, %fs
movl %eax, %fs
movl PCPU(CPUID), %eax
popl %fs
incl xhits_rng(,%eax,4)
@ -232,10 +232,10 @@ IDTVEC(invlrng)
IDTVEC(hardclock)
PUSH_FRAME
movl $KDSEL, %eax /* reload with kernel's data segment */
mov %ax, %ds
mov %ax, %es
movl %eax, %ds
movl %eax, %es
movl $KPSEL, %eax
mov %ax, %fs
movl %eax, %fs
movl lapic, %edx
movl $0, LA_EOI(%edx) /* End Of Interrupt to APIC */
@ -255,10 +255,10 @@ IDTVEC(hardclock)
IDTVEC(statclock)
PUSH_FRAME
movl $KDSEL, %eax /* reload with kernel's data segment */
mov %ax, %ds
mov %ax, %es
movl %eax, %ds
movl %eax, %es
movl $KPSEL, %eax
mov %ax, %fs
movl %eax, %fs
movl lapic, %edx
movl $0, LA_EOI(%edx) /* End Of Interrupt to APIC */
@ -284,10 +284,10 @@ IDTVEC(statclock)
IDTVEC(cpuast)
PUSH_FRAME
movl $KDSEL, %eax
mov %ax, %ds /* use KERNEL data segment */
mov %ax, %es
movl %eax, %ds /* use KERNEL data segment */
movl %eax, %es
movl $KPSEL, %eax
mov %ax, %fs
movl %eax, %fs
movl lapic, %edx
movl $0, LA_EOI(%edx) /* End Of Interrupt to APIC */
@ -317,10 +317,10 @@ IDTVEC(cpustop)
pushl %fs
movl $KDSEL, %eax
mov %ax, %ds /* use KERNEL data segment */
mov %ax, %es
movl %eax, %ds /* use KERNEL data segment */
movl %eax, %es
movl $KPSEL, %eax
mov %ax, %fs
movl %eax, %fs
movl lapic, %eax
movl $0, LA_EOI(%eax) /* End Of Interrupt to APIC */
@ -375,10 +375,10 @@ IDTVEC(cpustop)
IDTVEC(rendezvous)
PUSH_FRAME
movl $KDSEL, %eax
mov %ax, %ds /* use KERNEL data segment */
mov %ax, %es
movl %eax, %ds /* use KERNEL data segment */
movl %eax, %es
movl $KPSEL, %eax
mov %ax, %fs
movl %eax, %fs
call smp_rendezvous_action
@ -395,10 +395,10 @@ IDTVEC(rendezvous)
IDTVEC(lazypmap)
PUSH_FRAME
movl $KDSEL, %eax
mov %ax, %ds /* use KERNEL data segment */
mov %ax, %es
movl %eax, %ds /* use KERNEL data segment */
movl %eax, %es
movl $KPSEL, %eax
mov %ax, %fs
movl %eax, %fs
call pmap_lazyfix_action

View file

@ -129,11 +129,11 @@ alltraps:
pushl %es
pushl %fs
alltraps_with_regs_pushed:
mov $KDSEL,%ax
mov %ax,%ds
mov %ax,%es
mov $KPSEL,%ax
mov %ax,%fs
movl $KDSEL,%eax
movl %eax,%ds
movl %eax,%es
movl $KPSEL,%eax
movl %eax,%fs
FAKE_MCOUNT(13*4(%esp))
calltrap:
FAKE_MCOUNT(btrap) /* init "from" btrap -> calltrap */
@ -167,11 +167,11 @@ IDTVEC(lcall_syscall)
pushl %ds
pushl %es
pushl %fs
mov $KDSEL,%ax /* switch to kernel segments */
mov %ax,%ds
mov %ax,%es
mov $KPSEL,%ax
mov %ax,%fs
movl $KDSEL,%eax /* switch to kernel segments */
movl %eax,%ds
movl %eax,%es
movl $KPSEL,%eax
movl %eax,%fs
FAKE_MCOUNT(13*4(%esp))
call syscall
MEXITCOUNT
@ -192,11 +192,11 @@ IDTVEC(int0x80_syscall)
pushl %ds
pushl %es
pushl %fs
mov $KDSEL,%ax /* switch to kernel segments */
mov %ax,%ds
mov %ax,%es
mov $KPSEL,%ax
mov %ax,%fs
movl $KDSEL,%eax /* switch to kernel segments */
movl %eax,%ds
movl %eax,%es
movl $KPSEL,%eax
movl %eax,%fs
FAKE_MCOUNT(13*4(%esp))
call syscall
MEXITCOUNT

View file

@ -1588,12 +1588,12 @@ ENTRY(lgdt)
1:
/* reload "stale" selectors */
movl $KDSEL,%eax
mov %ax,%ds
mov %ax,%es
mov %ax,%gs
mov %ax,%ss
movl %eax,%ds
movl %eax,%es
movl %eax,%gs
movl %eax,%ss
movl $KPSEL,%eax
mov %ax,%fs
movl %eax,%fs
/* reload code selector by turning return into intersegmental return */
movl (%esp),%eax

View file

@ -59,13 +59,13 @@ IDTVEC(vec_name) ; \
pushl %ds ; /* save data and extra segments ... */ \
pushl %es ; \
pushl %fs ; \
mov $KDSEL,%ax ; /* load kernel ds, es and fs */ \
mov %ax,%ds ; \
mov %ax,%es ; \
mov $KPSEL,%ax ; \
mov %ax,%fs ; \
movl $KDSEL, %eax ; /* reload with kernel's data segment */ \
movl %eax, %ds ; \
movl %eax, %es ; \
movl $KPSEL, %eax ; /* reload with per-CPU data segment */ \
movl %eax, %fs ; \
; \
FAKE_MCOUNT(13*4(%esp)) ; /* XXX late to avoid double count */ \
FAKE_MCOUNT(13*4(%esp)) ; \
pushl $irq_num; /* pass the IRQ */ \
call atpic_handle_intr ; \
addl $4, %esp ; /* discard the parameter */ \