In the full virtualization, how to do binary translation for "popf" instruction in x86?

69 Views Asked by At

I'm studying about virtualization.(I'm a undergraduated student)

In CPU Full virtualization, as far as I know, x86 was difficult to be virtualized because it has about 17 sensitive but unprivileged instructions.(e.g., popf)

So, they used "binary translation" to make these instructions to be "trapped".(because if these instructions run on unprivileged level, it will not trap so be dangerous)

My question is...

  1. In some articles, they said that binary translation is used for making privileged instructions "not" to be trapped.(removing trap overhead)

For example, cli -> and $0xfd, %gs:vcpu.flags

Which one is right?

  1. Can you give me a sample target code for popf?

popf -> ?

0

There are 0 best solutions below