public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: "Wang, Shane" <shane.wang@intel.com>
Cc: Avi Kivity <avi@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>, kvm <kvm@vger.kernel.org>,
	"Cihula, Joseph" <joseph.cihula@intel.com>
Subject: Re: [PATCH] KVM: VMX: Inform user about INTEL_TXT dependency
Date: Tue, 16 Nov 2010 11:22:44 +0100	[thread overview]
Message-ID: <4CE25B74.507@siemens.com> (raw)
In-Reply-To: <D5AB6E638E5A3E4B8F4406B113A5A19A302160BA@shsmsx501.ccr.corp.intel.com>

Am 16.11.2010 05:48, Wang, Shane wrote:
> Avi Kivity wrote:
>> On 11/14/2010 12:41 PM, Jan Kiszka wrote:
>>> Am 14.11.2010 11:30, Avi Kivity wrote:
>>>>  On 11/14/2010 11:18 AM, Jan Kiszka wrote:
>>>>>  From: Jan Kiszka<jan.kiszka@siemens.com>
>>>>>
>>>>>  Without CONFIG_INTEL_TXT, the user must not enable this feature
>>>>>  in the BIOS. Otherwise, KVM will not work. Explain this
>>>>> dependency via a kernel  log message. 
>>>>>
>>>>>  Signed-off-by: Jan Kiszka<jan.kiszka@siemens.com>
>>>>>  ---
>>>>>    arch/x86/kvm/vmx.c |    7 ++++++-
>>>>>    1 files changed, 6 insertions(+), 1 deletions(-)
>>>>>
>>>>>  diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
>>>>>  index 9367abc..ebafd57 100644
>>>>>  --- a/arch/x86/kvm/vmx.c
>>>>>  +++ b/arch/x86/kvm/vmx.c
>>>>>  @@ -1306,8 +1306,13 @@ static __init int
>>>>>                vmx_disabled_by_bios(void) &&   tboot_enabled())
>>>>>                return 1;
>>>>>            if (!(msr&   FEATURE_CONTROL_VMXON_ENABLED_OUTSIDE_SMX)
>>>>>  -&&   !tboot_enabled()) +&&   !tboot_enabled()) {
>>>>>  +#ifndef CONFIG_INTEL_TXT
>>>>>  +            printk(KERN_INFO "kvm: if TXT is enabled in the
>>>>>  bios, " +                     "kvm depends on
>>>>>                CONFIG_INTEL_TXT\n");  +#endif return 1;
>>>>>  +        }
>>>>>        }
>>>>>
> Why do we need this?
> If TXT is enabled in the bios, it doesn't mean TXT is launched but TXT is available.
> tboot_enabled() = TXT is launched. And non-CONFIG_INTEL_TXT means tboot_enabled() = 0.
> If you enable VT in bios, FEATURE_CONTROL_VMXON_ENABLED_OUTSIDE_SMX is set.

Probably, this patch is based on my semi-understanding of TXT. What I
observe is that, when I enable TXT in the BIOS of my machine, kvm-intel
does not load and report VT-x being disabled at BIOS level. As my
kernels had CONFIG_INTEL_TXT disabled, I thought that was the reason.

However, it turned out that
A) FEATURE_CONTROL_VMXON_ENABLED_OUTSIDE_SMX is _not_ set here when TXT
   is enabled in the BIOS
B) enabling CONFIG_INTEL_TXT does not magically solve the issue, KVM
   still does not work

The latter appears to be related to the fact that I do not actually have
a trust chain from the BIOS over the boot loader to the kernel. So
tboot_addr is not set and tboot_enabled remains off. I guess I need some
trusted grub or so to get this running, maybe even more. Still, I'm
unsure if that will give me VT-x support back again. Can you comment on
the requirements and mechanisms behind that?

In any case, what we should catch is the user mistake of enabling TXT in
the BIOS blindly without actually needing it, disabling VT-x this way.
How to express this?

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

  reply	other threads:[~2010-11-16 10:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-14  9:18 [PATCH] KVM: VMX: Inform user about INTEL_TXT dependency Jan Kiszka
2010-11-14 10:30 ` Avi Kivity
2010-11-14 10:41   ` Jan Kiszka
2010-11-14 11:02     ` Avi Kivity
2010-11-16  4:48       ` Wang, Shane
2010-11-16 10:22         ` Jan Kiszka [this message]
2010-11-16 13:02           ` Cihula, Joseph
2010-11-16 13:19             ` Jan Kiszka
2010-11-17  1:30               ` Wang, Shane
  -- strict thread matches above, loose matches on Subject: below --
2010-11-17  3:40 [PATCH]KVM: " Shane Wang
2010-11-17  7:56 ` Jan Kiszka
2010-11-18  0:35   ` Wang, Shane
2010-11-18 15:28 ` Marcelo Tosatti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CE25B74.507@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=avi@redhat.com \
    --cc=joseph.cihula@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=shane.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox