All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavan Kumar Paluri <papaluri@amd.com>
To: <kvm@vger.kernel.org>
Cc: <andrew.jones@linux.dev>, <thomas.lendacky@amd.com>,
	<michael.roth@amd.com>, <papaluri@amd.com>, <amit.shah@amd.com>
Subject: [kvm-unit-tests PATCH v2 4/4] x86 AMD SEV-ES: Setup a new page table and install level-1 PTEs
Date: Tue, 26 Mar 2024 12:34:00 -0500	[thread overview]
Message-ID: <20240326173400.773733-4-papaluri@amd.com> (raw)
In-Reply-To: <20240326173400.773733-1-papaluri@amd.com>

KUT's UEFI tests don't currently have support for page allocation.
SEV-ES/SNP tests will need this later, so the support for page
allocation is provided via setup_vm().

Signed-off-by: Pavan Kumar Paluri <papaluri@amd.com>
---
 x86/amd_sev.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/x86/amd_sev.c b/x86/amd_sev.c
index 7757d4f85b7a..bdf14055e46a 100644
--- a/x86/amd_sev.c
+++ b/x86/amd_sev.c
@@ -14,6 +14,8 @@
 #include "x86/processor.h"
 #include "x86/amd_sev.h"
 #include "msr.h"
+#include "x86/vm.h"
+#include "alloc_page.h"
 
 #define EXIT_SUCCESS 0
 #define EXIT_FAILURE 1
@@ -89,9 +91,14 @@ static void test_stringio(void)
 int main(void)
 {
 	int rtn;
+	unsigned long *vaddr;
 	rtn = test_sev_activation();
 	report(rtn == EXIT_SUCCESS, "SEV activation test.");
 	test_sev_es_activation();
 	test_stringio();
+	setup_vm();
+	vaddr = alloc_page();
+	if (!vaddr)
+		assert_msg(vaddr, "Page allocation failure");
 	return report_summary();
 }
-- 
2.34.1


  parent reply	other threads:[~2024-03-26 17:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-26 17:33 [kvm-unit-tests PATCH v2 1/4] x86 EFI: Bypass call to fdt_check_header() Pavan Kumar Paluri
2024-03-26 17:33 ` [kvm-unit-tests PATCH v2 2/4] x86/efi: Retry call to efi exit boot services Pavan Kumar Paluri
2024-03-27  8:42   ` Andrew Jones
2024-03-26 17:33 ` [kvm-unit-tests PATCH v2 3/4] x86 AMD SEV-ES: Set GHCB page attributes for a new page table Pavan Kumar Paluri
2024-03-26 17:34 ` Pavan Kumar Paluri [this message]
2024-03-27  8:08 ` [kvm-unit-tests PATCH v2 1/4] x86 EFI: Bypass call to fdt_check_header() Andrew Jones
2024-03-27 23:24   ` Paluri, PavanKumar

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=20240326173400.773733-4-papaluri@amd.com \
    --to=papaluri@amd.com \
    --cc=amit.shah@amd.com \
    --cc=andrew.jones@linux.dev \
    --cc=kvm@vger.kernel.org \
    --cc=michael.roth@amd.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.