lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANRm+Cz-OMvheOCzhc0Hf7B2kDrAedv3NOnEqPEG8K_S5WvjSg@mail.gmail.com>
Date:	Sun, 31 Jul 2016 10:32:32 +0800
From:	Wanpeng Li <kernellwp@...il.com>
To:	Paolo Bonzini <pbonzini@...hat.com>
Cc:	Radim Krčmář <rkrcmar@...hat.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	kvm <kvm@...r.kernel.org>
Subject: Re: [RFC PATCH 4/4] KVM: vmx: add support for emulating UMIP

2016-07-14 16:09 GMT+08:00 Paolo Bonzini <pbonzini@...hat.com>:
[...]
>
> This is not necessary because this is how KVM computes
> CPUID[EAX=7,EBX=0].ECX:
>
>         unsigned f_umip = kvm_x86_ops->umip_emulated() ? F(UMIP) : 0;
>         ...
>         const u32 kvm_cpuid_7_0_ecx_x86_features = F(PKU) | F(UMIP);
>         ...
>         // Mask userspace-provided value against supported features
>         entry->ecx &= kvm_cpuid_7_0_ecx_x86_features;
>         // Mask userspace-provided value against host features
>         cpuid_mask(&entry->ecx, CPUID_7_ECX);
>         // Finally add emulated features
>         entry->ecx |= f_umip;

I think you mean:

- entry->ecx  ->  userspace-provided value
- kvm_cpuid_7_0_ecx_x86_features  ->  supported features
- CPUID_7_ECX  ->  host features

However, entry->ecx is returned by cpuid instruction
(do_cpuid_1_ent()), so why it is a userspace-provided value?

Regards,
Wanpeng Li

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ