blob: 095991c706572d6d0ada10a8ac53cd12b1e47751 (
plain) (
blame)
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
|
assembly: 0.884
performance: 0.775
ppc: 0.755
graphic: 0.745
architecture: 0.736
mistranslation: 0.706
device: 0.703
debug: 0.685
virtual: 0.662
vnc: 0.649
network: 0.644
PID: 0.642
hypervisor: 0.633
kernel: 0.626
VMM: 0.613
files: 0.607
register: 0.597
user-level: 0.591
peripherals: 0.581
risc-v: 0.580
x86: 0.574
socket: 0.572
semantic: 0.566
permissions: 0.551
arm: 0.538
i386: 0.537
TCG: 0.519
boot: 0.424
KVM: 0.362
--------------------
user-level: 0.876
assembly: 0.846
x86: 0.702
kernel: 0.631
debug: 0.083
virtual: 0.072
TCG: 0.035
arm: 0.029
i386: 0.023
files: 0.017
hypervisor: 0.013
semantic: 0.011
performance: 0.010
architecture: 0.010
risc-v: 0.006
ppc: 0.005
PID: 0.003
network: 0.003
peripherals: 0.003
register: 0.003
boot: 0.002
device: 0.002
vnc: 0.002
permissions: 0.001
graphic: 0.001
VMM: 0.000
socket: 0.000
mistranslation: 0.000
KVM: 0.000
SVM instructions fail with SVME bit enabled
I was trying to use QEMU/TCG to emulate some stuff that uses SVM.
I know SVM is only partially implemented but I gave it a try anyway.
I found that if SVM is enabled in the same basic block in which there's a call to VMSAVE/etc,
the call fails as illegal op because the flags don't get updated correctly.
The pseudocode for the asm I'm running is:
```
EFER |= SVME; set the appropriate bit with wrmsr
vmsave
```
This is an example of the relevant translate.c code:
```
if (!(s->flags & HF_SVME_MASK) || !s->pe) {
goto illegal_op;
}
if (s->cpl != 0) {
gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base);
break;
}
```
s->flags doesn't get updated after the wrmsr instruction and so QEMU raises an illegal opcode interrupt.
A quick fix is to make the tb end after `wrmsr` instructions, but it's an hack afaik.
I'm not too comfortable with QEMU's code, so I don't know what a proper fix would be.
Cheers,
thebabush
The QEMU project is currently considering to move its bug tracking to another system. For this we need to know which bugs are still valid and which could be closed already. Thus we are setting older bugs to "Incomplete" now.
If you still think this bug report here is valid, then please switch the state back to "New" within the next 60 days, otherwise this report will be marked as "Expired". Or mark it as "Fix Released" if the problem has been solved with a newer version of QEMU already. Thank you and sorry for the inconvenience.
[Expired for QEMU because there has been no activity for 60 days.]
|