public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Nikunj A. Dadhania" <nikunj@amd.com>
To: "Pratik R. Sampat" <pratikrajesh.sampat@amd.com>, kvm@vger.kernel.org
Cc: seanjc@google.com, pbonzini@redhat.com, pgonda@google.com,
	thomas.lendacky@amd.com, michael.roth@amd.com, shuah@kernel.org,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [sos-linux-ext-patches] [PATCH v4 2/8] KVM: selftests: SEV-SNP test for KVM_SEV_INIT2
Date: Fri, 10 Jan 2025 11:22:07 +0530	[thread overview]
Message-ID: <bc5650c3-e759-42d7-b993-1af838fd6a80@amd.com> (raw)
In-Reply-To: <20241114234104.128532-3-pratikrajesh.sampat@amd.com>



On 11/15/2024 5:10 AM, Pratik R. Sampat wrote:
> Add the X86_FEATURE_SNP CPU feature to the architectural definition for
> the SEV-SNP VM type to exercise the KVM_SEV_INIT2 call. Ensure that the
> SNP test is skipped in scenarios where CPUID supports it but KVM does
> not, so that a failure is not reported in such cases.
> 
> Signed-off-by: Pratik R. Sampat <pratikrajesh.sampat@amd.com>
> ---
>  .../selftests/kvm/include/x86_64/processor.h        |  1 +
>  .../testing/selftests/kvm/x86_64/sev_init2_tests.c  | 13 +++++++++++++
>  2 files changed, 14 insertions(+)
> 
> diff --git a/tools/testing/selftests/kvm/include/x86_64/processor.h b/tools/testing/selftests/kvm/include/x86_64/processor.h
> index 645200e95f89..c18d2405798f 100644
> --- a/tools/testing/selftests/kvm/include/x86_64/processor.h
> +++ b/tools/testing/selftests/kvm/include/x86_64/processor.h
> @@ -199,6 +199,7 @@ struct kvm_x86_cpu_feature {
>  #define	X86_FEATURE_VGIF		KVM_X86_CPU_FEATURE(0x8000000A, 0, EDX, 16)
>  #define X86_FEATURE_SEV			KVM_X86_CPU_FEATURE(0x8000001F, 0, EAX, 1)

Unrelated to your patch, X86_FEATURE_SEV does not match the KVM API definitions,
1 is used for KVM_X86_SW_PROTECTED_VM 

  #define KVM_X86_DEFAULT_VM    0
  #define KVM_X86_SW_PROTECTED_VM       1
  #define KVM_X86_SEV_VM        2
  #define KVM_X86_SEV_ES_VM     3


>  #define X86_FEATURE_SEV_ES		KVM_X86_CPU_FEATURE(0x8000001F, 0, EAX, 3)
> +#define X86_FEATURE_SNP			KVM_X86_CPU_FEATURE(0x8000001F, 0, EAX, 4)

Additionally, please add KVM_X86_SNP_VM to the Documentation/virt/kvm/api.rst

Regards
Nikunj

  reply	other threads:[~2025-01-10  5:52 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-14 23:40 [PATCH v4 0/8] Basic SEV-SNP Selftests Pratik R. Sampat
2024-11-14 23:40 ` [PATCH v4 1/8] KVM: SEV: Disable SEV-SNP on FW validation failure Pratik R. Sampat
2025-01-10  5:21   ` [sos-linux-ext-patches] " Nikunj A. Dadhania
2025-01-10 21:50     ` Pratik Rajesh Sampat
2025-01-13  4:10       ` Nikunj A. Dadhania
2024-11-14 23:40 ` [PATCH v4 2/8] KVM: selftests: SEV-SNP test for KVM_SEV_INIT2 Pratik R. Sampat
2025-01-10  5:52   ` Nikunj A. Dadhania [this message]
2025-01-10  6:07     ` [sos-linux-ext-patches] " Nikunj A. Dadhania
2025-01-10 21:55     ` Pratik Rajesh Sampat
2024-11-14 23:40 ` [PATCH v4 3/8] KVM: selftests: Add VMGEXIT helper Pratik R. Sampat
2024-11-14 23:41 ` [PATCH v4 4/8] KVM: selftests: Introduce SEV VM type check Pratik R. Sampat
2025-01-13  8:18   ` Nikunj A. Dadhania
2025-01-13 20:10     ` Pratik Rajesh Sampat
2024-11-14 23:41 ` [PATCH v4 5/8] KVM: selftests: Add library support for interacting with SNP Pratik R. Sampat
2025-01-13  8:32   ` Nikunj A. Dadhania
2025-01-13 20:10     ` Pratik Rajesh Sampat
2024-11-14 23:41 ` [PATCH v4 6/8] KVM: selftests: Force GUEST_MEMFD flag for SNP VM type Pratik R. Sampat
2024-11-14 23:41 ` [PATCH v4 7/8] KVM: selftests: Abstractions for SEV to decouple policy from type Pratik R. Sampat
2024-11-14 23:41 ` [PATCH v4 8/8] KVM: selftests: Add a basic SEV-SNP smoke test Pratik R. Sampat
2024-11-15  6:15 ` [PATCH v4 0/8] Basic SEV-SNP Selftests Aithal, Srikanth
2025-01-07 15:32 ` Pratik Rajesh Sampat

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=bc5650c3-e759-42d7-b993-1af838fd6a80@amd.com \
    --to=nikunj@amd.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=michael.roth@amd.com \
    --cc=pbonzini@redhat.com \
    --cc=pgonda@google.com \
    --cc=pratikrajesh.sampat@amd.com \
    --cc=seanjc@google.com \
    --cc=shuah@kernel.org \
    --cc=thomas.lendacky@amd.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