Re: [PATCH v5 03/17] x86/acrn: Introduce an API to check if a VM is privileged

2020-11-04 Thread Shuo A Liu
On Wed 4.Nov'20 at 19:51:57 +0100, Borislav Petkov wrote: On Wed, Nov 04, 2020 at 11:50:27AM +0800, Shuo A Liu wrote: On Tue 3.Nov'20 at 11:25:38 +0100, Borislav Petkov wrote: > On Tue, Nov 03, 2020 at 02:27:18PM +0800, Shuo A Liu wrote: > > The code just followed KVM style (see kvm_arch_para_

Re: [PATCH v5 03/17] x86/acrn: Introduce an API to check if a VM is privileged

2020-11-04 Thread Borislav Petkov
On Wed, Nov 04, 2020 at 11:50:27AM +0800, Shuo A Liu wrote: > On Tue 3.Nov'20 at 11:25:38 +0100, Borislav Petkov wrote: > > On Tue, Nov 03, 2020 at 02:27:18PM +0800, Shuo A Liu wrote: > > > The code just followed KVM style (see kvm_arch_para_features()). > > > > Do you see Documentation/virt/kvm/

Re: [PATCH v5 03/17] x86/acrn: Introduce an API to check if a VM is privileged

2020-11-03 Thread Shuo A Liu
On Tue 3.Nov'20 at 11:25:38 +0100, Borislav Petkov wrote: On Tue, Nov 03, 2020 at 02:27:18PM +0800, Shuo A Liu wrote: The code just followed KVM style (see kvm_arch_para_features()). Do you see Documentation/virt/kvm/cpuid.rst? OK. It documents the leaf number. Now where is yours explain

Re: [PATCH v5 03/17] x86/acrn: Introduce an API to check if a VM is privileged

2020-11-03 Thread Borislav Petkov
On Tue, Nov 03, 2020 at 02:27:18PM +0800, Shuo A Liu wrote: > The code just followed KVM style (see kvm_arch_para_features()). Do you see Documentation/virt/kvm/cpuid.rst? Now where is yours explaining what your hypervisor is doing? > I can change to use > cpuid_eax(acrn_cpuid_base() + 1).

Re: [PATCH v5 03/17] x86/acrn: Introduce an API to check if a VM is privileged

2020-11-02 Thread Shuo A Liu
Hi Boris, On Mon 2.Nov'20 at 15:37:07 +0100, Borislav Petkov wrote: On Mon, Oct 19, 2020 at 02:17:49PM +0800, shuo.a@intel.com wrote: +bool acrn_is_privileged_vm(void) +{ + return cpuid_eax(acrn_cpuid_base() | ACRN_CPUID_FEATURES) & +ACRN_FEATURE_PRIVILEGED_VM

Re: [PATCH v5 03/17] x86/acrn: Introduce an API to check if a VM is privileged

2020-11-02 Thread Borislav Petkov
On Mon, Oct 19, 2020 at 02:17:49PM +0800, shuo.a@intel.com wrote: > +bool acrn_is_privileged_vm(void) > +{ > + return cpuid_eax(acrn_cpuid_base() | ACRN_CPUID_FEATURES) & > + ACRN_FEATURE_PRIVILEGED_VM; I asked in the previous review why that acrn_cpuid_base() is used

[PATCH v5 03/17] x86/acrn: Introduce an API to check if a VM is privileged

2020-10-18 Thread shuo . a . liu
From: Yin Fengwei ACRN Hypervisor reports hypervisor features via CPUID leaf 0x4001 which is similar to KVM. A VM can check if it's the privileged VM using the feature bits. The Service VM is the only privileged VM by design. Signed-off-by: Yin Fengwei Signed-off-by: Shuo Liu Reviewed-by: