From: Nikunj A Dadhania <nikunj@amd.com>
To: <seanjc@google.com>, <pbonzini@redhat.com>, <kvm@vger.kernel.org>
Cc: <thomas.lendacky@amd.com>, <santosh.shukla@amd.com>,
<bp@alien8.de>, <nikunj@amd.com>, <isaku.yamahata@intel.com>,
<vaishali.thakkar@suse.com>
Subject: [PATCH v6 2/4] KVM: SVM: Add missing member in SNP_LAUNCH_START command structure
Date: Tue, 8 Apr 2025 15:02:11 +0530 [thread overview]
Message-ID: <20250408093213.57962-3-nikunj@amd.com> (raw)
In-Reply-To: <20250408093213.57962-1-nikunj@amd.com>
The sev_data_snp_launch_start structure should include a 4-byte
desired_tsc_khz field before the gosvw field, which was missed in the
initial implementation. As a result, the structure is 4 bytes shorter than
expected by the firmware, causing the gosvw field to start 4 bytes early.
Fix this by adding the missing 4-byte member for the desired TSC frequency.
Fixes: 3a45dc2b419e ("crypto: ccp: Define the SEV-SNP commands")
Cc: stable@vger.kernel.org
Suggested-by: Tom Lendacky <thomas.lendacky@amd.com>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Tested-by: Vaishali Thakkar <vaishali.thakkar@suse.com>
Signed-off-by: Nikunj A Dadhania <nikunj@amd.com>
---
include/linux/psp-sev.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/linux/psp-sev.h b/include/linux/psp-sev.h
index f3cad182d4ef..1f3620aaa4e7 100644
--- a/include/linux/psp-sev.h
+++ b/include/linux/psp-sev.h
@@ -594,6 +594,7 @@ struct sev_data_snp_addr {
* @imi_en: launch flow is launching an IMI (Incoming Migration Image) for the
* purpose of guest-assisted migration.
* @rsvd: reserved
+ * @desired_tsc_khz: hypervisor desired mean TSC freq in kHz of the guest
* @gosvw: guest OS-visible workarounds, as defined by hypervisor
*/
struct sev_data_snp_launch_start {
@@ -603,6 +604,7 @@ struct sev_data_snp_launch_start {
u32 ma_en:1; /* In */
u32 imi_en:1; /* In */
u32 rsvd:30;
+ u32 desired_tsc_khz; /* In */
u8 gosvw[16]; /* In */
} __packed;
--
2.43.0
next prev parent reply other threads:[~2025-04-08 9:32 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-08 9:32 [PATCH v6 0/4] Enable Secure TSC for SEV-SNP Nikunj A Dadhania
2025-04-08 9:32 ` [PATCH v6 1/4] x86/cpufeatures: Add SNP Secure TSC Nikunj A Dadhania
2025-04-08 9:32 ` Nikunj A Dadhania [this message]
2025-04-08 9:32 ` [PATCH v6 3/4] KVM: SVM: Add GUEST_TSC_FREQ MSR for Secure TSC enabled guests Nikunj A Dadhania
2025-06-25 14:13 ` Sean Christopherson
2025-06-26 6:07 ` Nikunj A. Dadhania
2025-04-08 9:32 ` [PATCH v6 4/4] KVM: SVM: Enable Secure TSC for SNP guests Nikunj A Dadhania
2025-06-25 14:27 ` Sean Christopherson
2025-06-26 8:53 ` Nikunj A. Dadhania
2025-04-14 5:50 ` [PATCH v6 0/4] Enable Secure TSC for SEV-SNP Nikunj A Dadhania
2025-05-05 4:50 ` Nikunj A. Dadhania
2025-06-09 8:51 ` Nikunj A. Dadhania
2025-06-25 22:25 ` Sean Christopherson
2025-06-26 6:10 ` Nikunj A. Dadhania
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=20250408093213.57962-3-nikunj@amd.com \
--to=nikunj@amd.com \
--cc=bp@alien8.de \
--cc=isaku.yamahata@intel.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=santosh.shukla@amd.com \
--cc=seanjc@google.com \
--cc=thomas.lendacky@amd.com \
--cc=vaishali.thakkar@suse.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