SVM instructions fail with SVME bit enabled

Bug #1809144 reported by Paolo Montesel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QEMU
Expired
Undecided
Unassigned

Bug Description

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

Revision history for this message
Thomas Huth (th-huth) wrote :

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.

Changed in qemu:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for QEMU because there has been no activity for 60 days.]

Changed in qemu:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.