Re: [PATCH V5 7/9] KVM, pkeys: expose CPUID/CR4 to guest

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2016-03-21 at 12:36 +0100, Paolo Bonzini wrote:
> 
> This is now word 16, so:
> 
> diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
> index b40445612135..1ecaed58b8c0 100644
> --- a/arch/x86/kvm/cpuid.c
> +++ b/arch/x86/kvm/cpuid.c
> @@ -372,7 +372,7 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
>  		F(XSAVEOPT) | F(XSAVEC) | F(XGETBV1) | f_xsaves;
>  
>  	/* cpuid 7.0.ecx*/
> -	const u32 kvm_supported_word11_x86_features = F(PKU) | 0 /*OSPKE*/;
> +	const u32 kvm_supported_word16_x86_features = F(PKU) | 0 /*OSPKE*/;
>  
>  	/* all calls to cpuid_count() should be made on the same cpu */
>  	get_cpu();
> @@ -451,8 +451,8 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
>  			cpuid_mask(&entry->ebx, 9);
>  			// TSC_ADJUST is emulated
>  			entry->ebx |= F(TSC_ADJUST);
> -			entry->ecx &= kvm_supported_word11_x86_features;
> -			cpuid_mask(&entry->ecx, CPUID_7_ECX);
> +			entry->ecx &= kvm_supported_word16_x86_features;
> +			cpuid_mask(&entry->ecx, 16);
cpuid_mask(&entry->ecx, CPUID_7_ECX), CPUID_7_ECX is better than 16?
>  			if (!tdp_enabled)
>  				/*
>  				 * PKU is not yet implemented for shadow
> 
> Paolo
> 

��.n��������+%������w��{.n�����o�^n�r������&��z�ޗ�zf���h���~����������_��+v���)ߣ�

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux