All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Don't expose hypervisor bit when running nested SVM
@ 2009-06-17 22:11 Alexander Graf
  2009-06-22  8:46 ` Avi Kivity
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Graf @ 2009-06-17 22:11 UTC (permalink / raw)
  To: kvm

Hyper-V refuses to run in hypervisor mode when it finds the hypervisor bit
set, because it assumes it's running as a guest.

While the perfect way of not setting the hypervisor would be an option to the
-cpu parameter, this is reasonable sane for now. Let's deal with the -cpu
way when we get to -cpu host.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 target-i386/helper.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/target-i386/helper.c b/target-i386/helper.c
index 2c5af3c..7da0e24 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -1513,7 +1513,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
         *edx = env->cpuid_features;
 
         /* "Hypervisor present" bit required for Microsoft SVVP */
-        if (kvm_enabled())
+        if (kvm_enabled() && !kvm_nested)
             *ecx |= (1 << 31);
         break;
     case 2:
-- 
1.6.0.2


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

* Re: [PATCH] Don't expose hypervisor bit when running nested SVM
  2009-06-17 22:11 [PATCH] Don't expose hypervisor bit when running nested SVM Alexander Graf
@ 2009-06-22  8:46 ` Avi Kivity
  2009-06-22  9:39   ` Alexander Graf
  0 siblings, 1 reply; 3+ messages in thread
From: Avi Kivity @ 2009-06-22  8:46 UTC (permalink / raw)
  To: Alexander Graf; +Cc: kvm

On 06/18/2009 01:11 AM, Alexander Graf wrote:
> Hyper-V refuses to run in hypervisor mode when it finds the hypervisor bit
> set, because it assumes it's running as a guest.
>
> While the perfect way of not setting the hypervisor would be an option to the
> -cpu parameter, this is reasonable sane for now. Let's deal with the -cpu
> way when we get to -cpu host.
>
>    

There's infrastructure in helper.c to make -cpu blah,-hypervisor fairly 
trivial, no?

-- 
error compiling committee.c: too many arguments to function


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

* Re: [PATCH] Don't expose hypervisor bit when running nested SVM
  2009-06-22  8:46 ` Avi Kivity
@ 2009-06-22  9:39   ` Alexander Graf
  0 siblings, 0 replies; 3+ messages in thread
From: Alexander Graf @ 2009-06-22  9:39 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm


On 22.06.2009, at 10:46, Avi Kivity wrote:

> On 06/18/2009 01:11 AM, Alexander Graf wrote:
>> Hyper-V refuses to run in hypervisor mode when it finds the  
>> hypervisor bit
>> set, because it assumes it's running as a guest.
>>
>> While the perfect way of not setting the hypervisor would be an  
>> option to the
>> -cpu parameter, this is reasonable sane for now. Let's deal with  
>> the -cpu
>> way when we get to -cpu host.
>>
>>
>
> There's infrastructure in helper.c to make -cpu blah,-hypervisor  
> fairly trivial, no?

Yes. I merely wanted to get something upstream for LinuxTag so people  
can try it out :-).

Alex


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

end of thread, other threads:[~2009-06-22  9:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-17 22:11 [PATCH] Don't expose hypervisor bit when running nested SVM Alexander Graf
2009-06-22  8:46 ` Avi Kivity
2009-06-22  9:39   ` Alexander Graf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.