public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kvm:x86/svm: enable SVM lock if host supports it
@ 2013-04-17 17:33 prasadjoshi.linux
  2013-04-17 19:48 ` Joerg Roedel
  0 siblings, 1 reply; 3+ messages in thread
From: prasadjoshi.linux @ 2013-04-17 17:33 UTC (permalink / raw)
  To: prasadjoshi.linux; +Cc: kvm, joro, mtosatti, gleb

From: Prasad Joshi <prasadjoshi.linux@gmail.com>

SVM lock features allows software from preventing update to EFER.SVME.
Enable the SVM lock in guest if it is supported on host machine.

Signed-off-by: Prasad Joshi <prasadjoshi.linux@gmail.com>
---
 arch/x86/kvm/svm.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index e1b1ce2..fcdfdea 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -4031,6 +4031,10 @@ static void svm_set_supported_cpuid(u32 func, struct kvm_cpuid_entry2 *entry)
 		if (boot_cpu_has(X86_FEATURE_NRIPS))
 			entry->edx |= SVM_FEATURE_NRIP;
 
+		/* support SVM Lock if host supports it */
+		if (boot_cpu_has(X86_FEATURE_SVML))
+			entry->edx |= SVM_FEATURE_SVML;
+
 		/* Support NPT for the guest if enabled */
 		if (npt_enabled)
 			entry->edx |= SVM_FEATURE_NPT;
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] kvm:x86/svm: enable SVM lock if host supports it
  2013-04-17 17:33 [PATCH] kvm:x86/svm: enable SVM lock if host supports it prasadjoshi.linux
@ 2013-04-17 19:48 ` Joerg Roedel
  2013-04-21  8:49   ` Prasad Joshi
  0 siblings, 1 reply; 3+ messages in thread
From: Joerg Roedel @ 2013-04-17 19:48 UTC (permalink / raw)
  To: prasadjoshi.linux; +Cc: kvm, mtosatti, gleb

On Wed, Apr 17, 2013 at 11:03:33PM +0530, prasadjoshi.linux@gmail.com wrote:
> From: Prasad Joshi <prasadjoshi.linux@gmail.com>
> 
> SVM lock features allows software from preventing update to EFER.SVME.
> Enable the SVM lock in guest if it is supported on host machine.
> 
> Signed-off-by: Prasad Joshi <prasadjoshi.linux@gmail.com>
> ---
>  arch/x86/kvm/svm.c |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
> index e1b1ce2..fcdfdea 100644
> --- a/arch/x86/kvm/svm.c
> +++ b/arch/x86/kvm/svm.c
> @@ -4031,6 +4031,10 @@ static void svm_set_supported_cpuid(u32 func, struct kvm_cpuid_entry2 *entry)
>  		if (boot_cpu_has(X86_FEATURE_NRIPS))
>  			entry->edx |= SVM_FEATURE_NRIP;
>  
> +		/* support SVM Lock if host supports it */
> +		if (boot_cpu_has(X86_FEATURE_SVML))
> +			entry->edx |= SVM_FEATURE_SVML;
> +

No. SVM lock is way more complex to emulate than just setting the CPUID
bit.


	Joerg



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] kvm:x86/svm: enable SVM lock if host supports it
  2013-04-17 19:48 ` Joerg Roedel
@ 2013-04-21  8:49   ` Prasad Joshi
  0 siblings, 0 replies; 3+ messages in thread
From: Prasad Joshi @ 2013-04-21  8:49 UTC (permalink / raw)
  To: Joerg Roedel; +Cc: kvm, mtosatti, gleb

On Thu, Apr 18, 2013 at 1:18 AM, Joerg Roedel <joro@8bytes.org> wrote:
> On Wed, Apr 17, 2013 at 11:03:33PM +0530, prasadjoshi.linux@gmail.com wrote:
>> From: Prasad Joshi <prasadjoshi.linux@gmail.com>
>>
>> SVM lock features allows software from preventing update to EFER.SVME.
>> Enable the SVM lock in guest if it is supported on host machine.
>>
>> Signed-off-by: Prasad Joshi <prasadjoshi.linux@gmail.com>
>> ---
>>  arch/x86/kvm/svm.c |    4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
>> index e1b1ce2..fcdfdea 100644
>> --- a/arch/x86/kvm/svm.c
>> +++ b/arch/x86/kvm/svm.c
>> @@ -4031,6 +4031,10 @@ static void svm_set_supported_cpuid(u32 func, struct kvm_cpuid_entry2 *entry)
>>               if (boot_cpu_has(X86_FEATURE_NRIPS))
>>                       entry->edx |= SVM_FEATURE_NRIP;
>>
>> +             /* support SVM Lock if host supports it */
>> +             if (boot_cpu_has(X86_FEATURE_SVML))
>> +                     entry->edx |= SVM_FEATURE_SVML;
>> +
>
> No. SVM lock is way more complex to emulate than just setting the CPUID
> bit.

Hello Joerg,

I suppose you meant, SVM_KEY MSR to lock/unlock the VM_CR.LOCK. If I
am correct, I just sent couple of patches. Can you please review them?

Thanks and Warm Regards,
Prasad

>
>
>         Joerg
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-04-21  8:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-17 17:33 [PATCH] kvm:x86/svm: enable SVM lock if host supports it prasadjoshi.linux
2013-04-17 19:48 ` Joerg Roedel
2013-04-21  8:49   ` Prasad Joshi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox