x86_64: 64-bit index register should be used.
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Thu, 17 Feb 2011 08:00:17 +0000 (16:00 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Thu, 17 Feb 2011 08:09:35 +0000 (16:09 +0800)
Looks like qemu does not accept 32-bit index register, while the
real boxs and virtualbox accept 32-bit index regiter.

However, according to AMD <<24593--Rev. 3.17--June 2010>> Page 25,
64-bit index register should be used to create effective address.

DragonFly-bug: http://bugs.dragonflybsd.org/issue1991

sys/platform/pc64/apic/apic_vector.s
sys/platform/pc64/icu/icu_vector.s

index 12a70f4..da6d8ff 100644 (file)
@@ -139,8 +139,8 @@ IDTVEC(ioapic_intr##irq_num) ;                                              \
        /* set the pending bit and return, leave interrupt masked */    \
        movq    $1,%rcx ;                                               \
        shlq    $IRQ_SBITS(irq_num),%rcx ;                              \
-       movl    $IRQ_LIDX(irq_num),%edx ;                               \
-       orq     %rcx,PCPU_E8(ipending,%edx) ;                           \
+       movq    $IRQ_LIDX(irq_num),%rdx ;                               \
+       orq     %rcx,PCPU_E8(ipending,%rdx) ;                           \
        orl     $RQF_INTPEND,PCPU(reqflags) ;                           \
        jmp     5f ;                                                    \
 2: ;                                                                   \
@@ -148,8 +148,8 @@ IDTVEC(ioapic_intr##irq_num) ;                                              \
        movq    $1,%rcx ;                                               \
        shlq    $IRQ_SBITS(irq_num),%rcx ;                              \
        notq    %rcx ;                                                  \
-       movl    $IRQ_LIDX(irq_num),%edx ;                               \
-       andq    %rcx,PCPU_E8(ipending,%edx) ;                           \
+       movq    $IRQ_LIDX(irq_num),%rdx ;                               \
+       andq    %rcx,PCPU_E8(ipending,%rdx) ;                           \
        pushq   $irq_num ;              /* trapframe -> intrframe */    \
        movq    %rsp, %rdi ;            /* pass frame by reference */   \
        incl    TD_CRITCOUNT(%rbx) ;                                    \
index 4b21cda..5b856d6 100644 (file)
@@ -142,14 +142,14 @@ IDTVEC(icu_intr##irq_num) ;                                               \
        je      2f ;                                                    \
 1: ;                                                                   \
        /* set pending bit and return, leave interrupt masked */        \
-       movl    $0,%edx ;                                               \
-       orq     $IRQ_LBIT(irq_num),PCPU_E8(ipending,%edx) ;             \
+       movq    $0,%rdx ;                                               \
+       orq     $IRQ_LBIT(irq_num),PCPU_E8(ipending,%rdx) ;             \
        orl     $RQF_INTPEND, PCPU(reqflags) ;                          \
        jmp     5f ;                                                    \
 2: ;                                                                   \
        /* clear pending bit, run handler */                            \
-       movl    $0,%edx ;                                               \
-       andq    $~IRQ_LBIT(irq_num),PCPU_E8(ipending,%edx) ;            \
+       movq    $0,%rdx ;                                               \
+       andq    $~IRQ_LBIT(irq_num),PCPU_E8(ipending,%rdx) ;            \
        pushq   $irq_num ;                                              \
        movq    %rsp,%rdi ;             /* rdi = call argument */       \
        incl    TD_CRITCOUNT(%rbx) ;                                    \