From: Jan Kiszka <jan.kiszka@web.de>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Gleb Natapov <gleb@kernel.org>, kvm <kvm@vger.kernel.org>
Subject: Re: [PATCH] KVM: nVMX: Add support for activity state HLT
Date: Tue, 10 Dec 2013 08:45:56 +0100 [thread overview]
Message-ID: <52A6C6B4.1020307@web.de> (raw)
In-Reply-To: <52A1C7C5.10803@siemens.com>
[-- Attachment #1: Type: text/plain, Size: 2058 bytes --]
On 2013-12-06 13:49, Jan Kiszka wrote:
> On 2013-12-05 10:52, Paolo Bonzini wrote:
>> Il 04/12/2013 08:58, Jan Kiszka ha scritto:
>>> We can easily emulate the HLT activity state for L1: If it decides that
>>> L2 shall be halted on entry, just invoke the normal emulation of halt
>>> after switching to L2. We do not depend on specific host features to
>>> provide this, so we can expose the capability unconditionally.
>>>
>>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>>> ---
>>>
>>> Jailhouse would like to use this. Experimental code works fine so far,
>>> both on patched KVM and real HW.
>>
>> Nice. :)
>>
>> Do you have a testcase for kvm-unit-tests?
>
> Not yet. Maybe I will find a little time these days.
Test are still ongoing, but it seems there are problems remaining with
halting in L2 in general, i.e. with unintercepted hlt. I'm currently
applying this to get beyond some hangups, but I'm still experiencing
some delayed IRQ delivery to L2:
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 31eb577..fad04ce 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -4684,6 +4684,7 @@ static int vmx_interrupt_allowed(struct kvm_vcpu *vcpu)
vmcs12->vm_exit_reason =
EXIT_REASON_EXTERNAL_INTERRUPT;
vmcs12->vm_exit_intr_info = 0;
+ kvm_make_request(KVM_REQ_UNHALT, vcpu);
/*
* fall through to normal code, but now in L1, not L2
*/
@@ -8057,8 +8058,6 @@ static int nested_vmx_run(struct kvm_vcpu *vcpu, bool launch)
enter_guest_mode(vcpu);
- vmx->nested.nested_run_pending = 1;
-
vmx->nested.vmcs01_tsc_offset = vmcs_read64(TSC_OFFSET);
cpu = get_cpu();
@@ -8077,6 +8076,8 @@ static int nested_vmx_run(struct kvm_vcpu *vcpu, bool launch)
if (vmcs12->guest_activity_state == GUEST_ACTIVITY_HLT)
return kvm_emulate_halt(vcpu);
+ vmx->nested.nested_run_pending = 1;
+
/*
* Note no nested_vmx_succeed or nested_vmx_fail here. At this point
* we are no longer running L1, and VMLAUNCH/VMRESUME has not yet
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]
prev parent reply other threads:[~2013-12-10 7:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-04 7:58 [PATCH] KVM: nVMX: Add support for activity state HLT Jan Kiszka
2013-12-05 9:52 ` Paolo Bonzini
2013-12-06 12:49 ` Jan Kiszka
2013-12-10 7:45 ` Jan Kiszka [this message]
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=52A6C6B4.1020307@web.de \
--to=jan.kiszka@web.de \
--cc=gleb@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.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