From 5f28fd1bdf96ecaba7708fd1bc168a735b082b50 Mon Sep 17 00:00:00 2001 From: bluhm Date: Tue, 13 Aug 2024 20:48:00 +0000 Subject: [PATCH] For AMD SEV use correct command mask in ccp(4) driver. 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@ --- sys/dev/ic/ccp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/ic/ccp.c b/sys/dev/ic/ccp.c index 79650a6c63a..5981ae43450 100644 --- a/sys/dev/ic/ccp.c +++ b/sys/dev/ic/ccp.c @@ -1,4 +1,4 @@ -/* $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 @@ -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; -- 2.20.1