public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Nitin A Kamble <nitin.a.kamble@intel.com>
Cc: no To-header on input <"unlisted-recipients:;"@redhat.com>,
	kvm@vger.kernel.org
Subject: Re: [PATCH KVM VMX 2/2] KVM: VMX: Support Unrestricted Guest feature
Date: Sun, 07 Jun 2009 09:56:11 +0300	[thread overview]
Message-ID: <4A2B648B.4010509@redhat.com> (raw)
In-Reply-To: <32529287ac08871607972ec351d0f020f5c1479e.1244064594.git.nitin.a.kamble@intel.com>

Nitin A Kamble wrote:
> "Unrestricted Guest" feature is added in the VMX specification.
> Intel Westmere and onwards processors will support this feature.
>
>     It allows kvm guests to run real mode and unpaged mode
> code natively in the VMX mode when EPT is turned on. With the
> unrestricted guest there is no need to emulate the guest real mode code
> in the vm86 container or in the emulator. Also the guest big real mode
> code works like native.
>
>   The attached patch enhances KVM to use the unrestricted guest feature
> if available on the processor. It also adds a new kernel/module
> parameter to disable the unrestricted guest feature at the boot time.
>
>  
> @@ -1431,6 +1447,9 @@ static void enter_rmode(struct kvm_vcpu *vcpu)
>  	unsigned long flags;
>  	struct vcpu_vmx *vmx = to_vmx(vcpu);
>  
> +	if (enable_unrestricted_guest)
> +		goto continue_rmode;
> +
>   

I think you should just return here.  You don't need to reset the mmu 
context or run the init_rmode() code.  Maybe you need to flush the tlb.



> +
> +	if (enable_unrestricted_guest && (seg != VCPU_SREG_LDTR))
> +		ar |= 0x1; /* Accessed */
> +
>  	vmcs_write32(sf->ar_bytes, ar);
>  }
>   

Please add a comment indicating it's for broken userspace that doesn't 
set the A bit.


-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


  reply	other threads:[~2009-06-07  6:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <VMX Unrestricted Guest>
2009-06-04 22:25 ` [PATCH KVM VMX 0/2] Enable Unrestricted Guest Nitin A Kamble
2009-06-04 22:04   ` [PATCH KVM VMX 1/2] KVM: VMX: Rename rmode.active to rmode.vm86_active Nitin A Kamble
2009-06-07  6:47     ` Avi Kivity
2009-06-04 22:04   ` [PATCH KVM VMX 2/2] KVM: VMX: Support Unrestricted Guest feature Nitin A Kamble
2009-06-07  6:56     ` Avi Kivity [this message]
2009-06-08 18:34 ` [PATCH] " Nitin A Kamble
2009-06-09  7:55   ` Avi Kivity

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=4A2B648B.4010509@redhat.com \
    --to=avi@redhat.com \
    --cc="unlisted-recipients:;"@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=nitin.a.kamble@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