From: Bandan Das <bsd@redhat.com>
To: Jan Kiszka <jan.kiszka@web.de>
Cc: kvm <kvm@vger.kernel.org>, Marcelo Tosatti <mtosatti@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH v2] KVM: nVMX: Add support for rdtscp
Date: Mon, 23 Mar 2015 13:01:26 -0400 [thread overview]
Message-ID: <jpgfv8vwsux.fsf@redhat.com> (raw)
In-Reply-To: <55102EAA.4000502@web.de> (Jan Kiszka's message of "Mon, 23 Mar 2015 16:18:02 +0100")
Jan Kiszka <jan.kiszka@web.de> writes:
...
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -2467,6 +2467,7 @@ static void nested_vmx_setup_ctls_msrs(struct vcpu_vmx *vmx)
> vmx->nested.nested_vmx_secondary_ctls_low = 0;
> vmx->nested.nested_vmx_secondary_ctls_high &=
> SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES |
> + SECONDARY_EXEC_RDTSCP |
> SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE |
> SECONDARY_EXEC_APIC_REGISTER_VIRT |
> SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY |
> @@ -7510,7 +7511,7 @@ static bool nested_vmx_exit_handled(struct kvm_vcpu *vcpu)
> return nested_cpu_has(vmcs12, CPU_BASED_INVLPG_EXITING);
> case EXIT_REASON_RDPMC:
> return nested_cpu_has(vmcs12, CPU_BASED_RDPMC_EXITING);
> - case EXIT_REASON_RDTSC:
> + case EXIT_REASON_RDTSC: case EXIT_REASON_RDTSCP:
> return nested_cpu_has(vmcs12, CPU_BASED_RDTSC_EXITING);
> case EXIT_REASON_VMCALL: case EXIT_REASON_VMCLEAR:
> case EXIT_REASON_VMLAUNCH: case EXIT_REASON_VMPTRLD:
> @@ -8517,6 +8518,9 @@ static void vmx_cpuid_update(struct kvm_vcpu *vcpu)
> exec_control);
> }
> }
> + if (!vmx->rdtscp_enabled)
> + vmx->nested.nested_vmx_secondary_ctls_high &=
> + ~SECONDARY_EXEC_RDTSCP;
No need to do this if nested is not enabled ? Or just
a "if (nested)" in the prior if else loop should be enough I think.
Bandan
> }
>
> /* Exposing INVPCID only when PCID is exposed */
> @@ -9146,8 +9150,9 @@ static void prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12)
> exec_control &= ~SECONDARY_EXEC_RDTSCP;
> /* Take the following fields only from vmcs12 */
> exec_control &= ~(SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES |
> + SECONDARY_EXEC_RDTSCP |
> SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY |
> - SECONDARY_EXEC_APIC_REGISTER_VIRT);
> + SECONDARY_EXEC_APIC_REGISTER_VIRT);
> if (nested_cpu_has(vmcs12,
> CPU_BASED_ACTIVATE_SECONDARY_CONTROLS))
> exec_control |= vmcs12->secondary_vm_exec_control;
next prev parent reply other threads:[~2015-03-23 17:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-23 15:01 [PATCH] KVM: nVMX: Add support for rdtscp Jan Kiszka
2015-03-23 15:18 ` [PATCH v2] " Jan Kiszka
2015-03-23 17:01 ` Bandan Das [this message]
2015-03-23 18:11 ` Jan Kiszka
2015-03-23 18:18 ` Bandan Das
2015-03-23 18:27 ` [PATCH v3] " Jan Kiszka
2015-03-27 1:34 ` 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=jpgfv8vwsux.fsf@redhat.com \
--to=bsd@redhat.com \
--cc=jan.kiszka@web.de \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
--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