According to AMD SEV API specification, the mask for command ID is
supposed to be of length 10 (Bits [25:16]), rather than length 6.
This ensures that all commands are properly processed by the PSP.
from Aaron Debebe; OK hshoexer@
-/* $OpenBSD: ccp.c,v 1.5 2024/06/13 17:59:08 bluhm Exp $ */
+/* $OpenBSD: ccp.c,v 1.6 2024/08/13 20:48:00 bluhm Exp $ */
/*
* Copyright (c) 2018 David Gwynne <dlg@openbsd.org>
plo = ((paddr >> 0) & 0xffffffff);
phi = ((paddr >> 32) & 0xffffffff);
- cmdword = (cmd & 0x3f) << 16;
+ cmdword = (cmd & 0x3ff) << 16;
if (!cold)
cmdword |= PSP_CMDRESP_IOC;