Index | Thread | Search

From:
Theo Buehler <tb@openbsd.org>
Subject:
Re: [EXT] Re: SEV-ES: vmd(8): Initial state encryption for SEV-ES guests 2/2
To:
Alexander Bluhm <bluhm@openbsd.org>
Cc:
tech@openbsd.org
Date:
Wed, 4 Jun 2025 14:10:59 +0200

Download raw body.

Thread
On Wed, Jun 04, 2025 at 02:04:17PM +0200, Alexander Bluhm wrote:
> On Wed, Jun 04, 2025 at 01:50:30PM +0200, Hans-J?rg H?xer wrote:
> > Hi,
> > On Wed, Jun 04, 2025 at 12:39:07PM +0200, Theo Buehler wrote:
> > > This breaks the build on arm64. Untested diff below fixes it:
> > 
> > sorry for that!  Adding stubs for arm64 looks right to me.  We also need
> > one for psp_setup().  Amended diff below.
> 
> Currently I have no arm64 machine to compile test it.

I went with my original diff to unbreak the tree since it was fine by
hshoexer.

> tb@, can you compile and commit this?

It does compile.

> Having a psp_setup() stub makes sense, maybe we can get rid of
> #ifdef __amd64__ later.

I expect that the call to psp_setup() is reachable from arm64, so having
a fatalx() there seems undesirable.

How about this?

Index: arm64_vm.c
===================================================================
RCS file: /cvs/src/usr.sbin/vmd/arm64_vm.c,v
diff -u -p -r1.4 arm64_vm.c
--- arm64_vm.c	4 Jun 2025 12:04:33 -0000	1.4
+++ arm64_vm.c	4 Jun 2025 12:08:39 -0000
@@ -225,3 +225,8 @@ sev_launch_finalize(struct vmd_vm *vm)
 	/* NOTREACHED */
 	return (-1);
 }
+
+void
+psp_setup(void)
+{
+}
Index: vmd.c
===================================================================
RCS file: /cvs/src/usr.sbin/vmd/vmd.c,v
diff -u -p -r1.165 vmd.c
--- vmd.c	29 May 2025 12:33:55 -0000	1.165
+++ vmd.c	4 Jun 2025 12:08:39 -0000
@@ -847,10 +847,8 @@ main(int argc, char **argv)
 		proc_connect(ps);
 
 	env->vmd_psp_fd = -1;
-#ifdef __amd64__
 	if (env->vmd_noaction == 0 && proc_id == PROC_PARENT)
 		psp_setup();
-#endif
 
 	if (vmd_configure() == -1)
 		fatalx("configuration failed");