Hi

IA32_EPT_VPID_CAP_XO_TRANSLATIONS is specified incorrectly, see the
patch below.

Cheers
Adam

On Fri, Feb 26, 2021 at 01:08:17PM +0800, Adam Steen wrote:
> Hi
> 
> IA32_EPT_VPID_CAP_XO_TRANSLATIONS is specified as 0x0 and not (1ULL << 0)
> ie 0 and not bit 0 as on.
> 
> Please see the attach diff to correct this and rename
> IA32_EPT_VPID_CAP_XO_TRANSLATIONS to IA32_EPT_VPID_CAP_XO to reduce
> wordyness.
> 
> Cheers
> Adam
> 
> diff 0e7183d43c8ed36e5d169be05df61472565710eb /home/adams/devl/openbsd/src
> blob - 72104b78c733f4ce8ee91910b0b4a6f0f51c15aa
> file + sys/arch/amd64/amd64/vmm.c
> --- sys/arch/amd64/amd64/vmm.c
> +++ sys/arch/amd64/amd64/vmm.c
> @@ -916,7 +916,7 @@ vm_mprotect_ept(struct vm_mprotect_ept_params *vmep)
>       if (vmm_softc->mode == VMM_MODE_EPT) {
>               msr = rdmsr(IA32_VMX_EPT_VPID_CAP);
>               if (prot == PROT_EXEC &&
> -                 (msr & IA32_EPT_VPID_CAP_XO_TRANSLATIONS) == 0) {
> +                 (msr & IA32_EPT_VPID_CAP_XO) == 0) {
>                       DPRINTF("%s: Execute only permissions unsupported,"
>                          " adding read permission\n", __func__);
>  
> blob - e0232887ff69a882c00e3b4059baa2b12f047c2d
> file + sys/arch/amd64/include/specialreg.h
> --- sys/arch/amd64/include/specialreg.h
> +++ sys/arch/amd64/include/specialreg.h
> @@ -957,7 +957,7 @@
>  #define IA32_VMX_TRUE_ENTRY_CTLS     0x490
>  #define IA32_VMX_VMFUNC                      0x491
>  
> -#define IA32_EPT_VPID_CAP_XO_TRANSLATIONS    0x0
> +#define IA32_EPT_VPID_CAP_XO                 (1ULL << 0)
>  #define IA32_EPT_VPID_CAP_PAGE_WALK_4                (1ULL << 6)
>  #define IA32_EPT_VPID_CAP_WB                 (1ULL << 14)
>  #define IA32_EPT_VPID_CAP_AD_BITS            (1ULL << 21)


Reply via email to