RE: [PATCH] kvm/vmx: EPTP switching test

From: Zhang, Yang Z
Date: Mon Nov 16 2015 - 20:46:43 EST


Michael S. Tsirkin wrote on 2015-11-16:
> This patch adds a new parameter: eptp_switching_test, which enables
> testing EPT switching on VMX if supported by hardware. All EPT
> entries are initialized to the same value so this adds no useful
> functionality by itself, but can be used to test VMFUNC performance,
> and serve as a basis for future features based on EPTP switching.
>
> Support for nested virt is not enabled.
>
> This was tested using the following code within guest:
> #define VMX_VMFUNC ".byte 0x0f,0x01,0xd4"
> static void vmfunc(unsigned int nr, unsigned int ept)
> {
> asm volatile(VMX_VMFUNC
> :
> : "a"(nr), "c"(ept)
> : "memory");
> }
>
> VMFUNC instruction cost was measured at ~122 cycles.
> (Note: recent versions of gnu toolchain support the vmfunc
> instruction - removing the need for writing the bytecode manually).
>
> Signed-off-by: Michael S. Tsirkin <mst@xxxxxxxxxx>
> ---
>
> I think I'd like to put this upstream so future eptp switching work
> can be implemented on top. Comments?

We have a different version in hand which is using separate EPTP. As you known, the patch will be more complex if using separate EPTP. And there are still lots of thing need to do in our version. We will send out for comments soon.

Best regards,
Yang


N‹§²æ¸›yú²X¬¶ÇvØ–)Þ{.nlj·¥Š{±‘êX§¶›¡Ü}©ž²ÆzÚj:+v‰¨¾«‘êZ+€Êzf£¢·hšˆ§~†­†Ûÿû®w¥¢¸?™¨è&¢)ßf”ùy§m…á«a¶Úÿ 0¶ìå