Index | Thread | Search

From:
Alexander Bluhm <bluhm@openbsd.org>
Subject:
Re: SEV: fix command id mask
To:
Hans-J?rg H?xer <Hans-Joerg_Hoexer@genua.de>
Cc:
Aaron Debebe <aaron_debebe@genua.de>, tech@openbsd.org
Date:
Tue, 13 Aug 2024 22:55:39 +0200

Download raw body.

Thread
On Tue, Aug 13, 2024 at 04:18:11PM +0200, Hans-J?rg H?xer wrote:
> On Tue, Aug 13, 2024 at 04:08:21PM +0200, Aaron Debebe wrote:
> > according to the AMD-SEV API spec (version 0.24), the mask for the
> > command id (`cmd`) is supposed to be of length 10 (Bits [25:16]),
> > rather than of length 6. This ensures that all command ids will be
> > properly processed by the PSP.
> 
> yes, you're right!  The mask should be 0x3ff.
> 
> Thanks!

Commited, Thanks.

bluhm

> > -------------------------------------------------------------------
> > diff --git a/sys/dev/ic/ccp.c b/sys/dev/ic/ccp.c
> > index 79650a6c63a..d8f17735e3c 100644
> > --- a/sys/dev/ic/ccp.c
> > +++ b/sys/dev/ic/ccp.c
> > @@ -228,7 +228,7 @@ ccp_docmd(struct ccp_softc *sc, int cmd, uint64_t paddr)
> >  
> >  	plo = ((paddr >> 0) & 0xffffffff);
> >  	phi = ((paddr >> 32) & 0xffffffff);
> > -	cmdword = (cmd & 0x3f) << 16;
> > +	cmdword = (cmd & 0x3ff) << 16;
> >  	if (!cold)
> >  		cmdword |= PSP_CMDRESP_IOC;
> >