mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tom Lendacky <thomas.lendacky@amd.com>
To: Sean Christopherson <seanjc@google.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	x86@kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Ingo Molnar <mingo@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Babu Moger <babu.moger@amd.com>
Subject: Re: [PATCH 1/2] KVM: SVM: Fix TSC_AUX virtualization setup
Date: Fri, 15 Sep 2023 11:52:35 -0500	[thread overview]
Message-ID: <8b047dad-84ac-69f9-3875-38bca92d7534@amd.com> (raw)
In-Reply-To: <f2c0907c-9e30-e01b-7d65-a20e6be4bf49@amd.com>

On 9/14/23 15:48, Tom Lendacky wrote:
> On 9/14/23 15:28, Sean Christopherson wrote:
>> On Thu, Sep 14, 2023, Tom Lendacky wrote:

> 
>>
>>> +        if (guest_cpuid_has(vcpu, X86_FEATURE_RDTSCP))
>>> +            svm_clr_intercept(svm, INTERCEPT_RDTSCP);
>>
>> Same thing here.
> 
> Will do.

For RDTSCP, svm_recalc_instruction_intercepts() will set/clear the RDTSCP 
intercept as part of the svm_vcpu_set_after_cpuid() path, but it will only 
do it based on kvm_cpu_cap_has(X86_FEATURE_RDTSCP) being true, which is 
very likely.

Do you think that is good enough and we can drop the setting and clearing 
of the RDTSCP intercept in the sev_es_vcpu_set_after_cpuid() function and 
only deal with the TSC_AUX MSR intercept?

On a side note, it looks like RDTSCP would not be intercepted if the KVM 
cap X86_FEATURE_RDTSCP feature is cleared, however unlikely, in 
kvm_set_cpu_caps() and RDTSCP is not advertised to the guest (assuming the 
guest is ignoring the RDTSCP CPUID bit).

Thanks,
Tom

> 
> Thanks,
> Tom
> 
>>
>>> +    }
>>> +}

  parent reply	other threads:[~2023-09-15 16:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-14 19:50 [PATCH 0/2] SEV-ES TSC_AUX virtualization fix and optimization Tom Lendacky
2023-09-14 19:50 ` [PATCH 1/2] KVM: SVM: Fix TSC_AUX virtualization setup Tom Lendacky
2023-09-14 20:28   ` Sean Christopherson
2023-09-14 20:48     ` Tom Lendacky
2023-09-14 21:13       ` Sean Christopherson
2023-09-15 14:26         ` Tom Lendacky
2023-09-15 14:32           ` Sean Christopherson
2023-09-15 16:52       ` Tom Lendacky [this message]
2023-09-15 17:32         ` Sean Christopherson
2023-09-15 20:54           ` Tom Lendacky
2023-09-14 19:50 ` [PATCH 2/2] KVM: SVM: Do not use user return MSR support for virtualized TSC_AUX Tom Lendacky
2023-09-15 14:43   ` Sean Christopherson
2023-09-15 14:51     ` Sean Christopherson
2023-09-15 15:08       ` Tom Lendacky

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=8b047dad-84ac-69f9-3875-38bca92d7534@amd.com \
    --to=thomas.lendacky@amd.com \
    --cc=babu.moger@amd.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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

all inboxes | Powered by JetHome®