1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
|
architecture: 0.930
register: 0.930
kernel: 0.918
x86: 0.910
socket: 0.871
ppc: 0.843
graphic: 0.836
boot: 0.813
permissions: 0.812
network: 0.805
device: 0.803
semantic: 0.794
vnc: 0.793
performance: 0.768
files: 0.766
PID: 0.733
peripherals: 0.720
user-level: 0.703
mistranslation: 0.694
risc-v: 0.644
hypervisor: 0.633
VMM: 0.627
debug: 0.619
virtual: 0.615
assembly: 0.558
arm: 0.539
TCG: 0.488
KVM: 0.478
i386: 0.378
--------------------
x86: 0.992
kernel: 0.931
virtual: 0.909
assembly: 0.378
register: 0.328
debug: 0.151
hypervisor: 0.102
architecture: 0.070
network: 0.041
PID: 0.030
socket: 0.028
files: 0.026
boot: 0.022
TCG: 0.021
device: 0.017
semantic: 0.014
vnc: 0.006
performance: 0.005
user-level: 0.004
permissions: 0.003
graphic: 0.002
peripherals: 0.002
ppc: 0.001
mistranslation: 0.001
KVM: 0.001
VMM: 0.001
risc-v: 0.000
i386: 0.000
arm: 0.000
Doing a 64 bit load from a 32 bit local APIC register is allowed
Doing
u64 lapic_idregister = (u64) fix_to_virt(FIX_APIC_BASE) + 0x20;
and later in an interrupt handler
movq (lapic_idregister), %rcx
movq (%rcx), %rcx
in a linux kernel module works in qemu 0.13.91 but not on real hardware (it simply reboots).
On real hardware only
movl (%rcx), %ecx
works (also in qemu).
Commandline:
qemu-system-x86_64 \
-kernel $LINUXDIR/arch/x86_64/boot/bzImage \
-hda $BUILDROOTDIR/output/images/rootfs.ext2 \
-append "root=/dev/sda rw rootfstype=ext2 maxcpus=4" \
-cpu phenom \
-smp 4 \
-gdb tcp::1234 \
-net nic -net user
Guest:
Vanilla Linux Kernel 2.6.37.6 64-bit with buildroot
Mikael Pettersson from the linux kernel mailinglist told me it's an accepts-invalid bug in qemu.
On Sun, Jun 12, 2011 at 4:03 PM, Robert Uhl <email address hidden> wrote:
> Public bug reported:
>
> Doing
>
> u64 lapic_idregister = (u64) fix_to_virt(FIX_APIC_BASE) + 0x20;
>
> and later in an interrupt handler
>
> movq (lapic_idregister), %rcx
> movq (%rcx), %rcx
>
> in a linux kernel module works in qemu 0.13.91 but not on real hardware (it simply reboots).
> On real hardware only
>
> movl (%rcx), %ecx
>
> works (also in qemu).
Thank you for the report. Currently QEMU devices only provide access
methods up to 32 bits, a 64 bit access is emulated with two 32 bit
accesses. So it is not possible to handle a 32 bit access differently
from a 64 bit one for now.
So far this hasn't been considered to be a problem for x86, though it
is clearly not correct for Sparc and Alpha. This report shows that it
is necessary to add 64 bit access methods (or otherwise handle 64 bit
accesses more realistically) since x86 is also affected.
Adding the 64 bit method would be a major refactoring though and there
are other designs possible.
Triaging old bug tickets ... can you somehow still reproduce this problem with the latest version of QEMU (currently v2.9), or could we close this ticket nowadays?
[Expired for QEMU because there has been no activity for 60 days.]
|