From patchwork Wed Feb 7 21:54:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 13549101 X-Patchwork-Delegate: herbert@gondor.apana.org.au Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2054.outbound.protection.outlook.com [40.107.93.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 24AFA82C64; Wed, 7 Feb 2024 21:55:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.54 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707342912; cv=fail; b=HI5rK065B3luFveWXm1F74siQC5DbbWrnb6l4smJzd53HFg8Kl7o+EkfeSKZ/dQjyVjPl3sGCVfm3E0UrMzqSDKXjGb9hjkBI1LMVfyoFPj0gecJ4bn84CrhvtWoZ400O84EQ286y8sAJGGwIgpF/9Npj6suacnxMCLsznMJ7wg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707342912; c=relaxed/simple; bh=VU4zPRfB7b4+rvHXjmvJBy2lGsauUIlnAeJKZnv+UgY=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=SBLW0KWvc5vVXGchN1/VlLW647c7gAnshPYA+279PisCBx1MJ9hyhZGAPg9Axd8ML43085HIKzhsXvda5aF1Aaba3afFM7V4et4e6aOekzNE4+3xewc8OeZXnt4GjWeEhrE1l9oYpgvabiIQldWYLHngUIW2aXg2OY3j9666Eiw= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=KMRNXkhn; arc=fail smtp.client-ip=40.107.93.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="KMRNXkhn" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BRoFsRQKGZKUMHhCbz2ROBpJ8lNtGFj8YLW1+bIHv3LwpVoFi/o6KwloB3rfJKWLaki3u5K9TrWrYqVH2sa+6Ih/rEYxqEo/WkpA1a5LFpwMPK6fyEVJIkq/x/9fs9YEdOwWSGAgfUHVdSFEEMBmlQgT8JlRzzkjd2n4CKGx1VRA1elqRrVprYxNVyqemRO/5oMZqUQVoiyyMUvqQG9jRpbJumXtd7fTu1E7YzE5z/9if68SL4sWdxQe5Dr/LHAa/4OE7I4KCLD1dA30uhTftT5EziRc93CcKtkLCAzAtrdgKxUz7cm7sG9W7I6JdR3NY3DTm+iqDDR+kbBnUsYeUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JMxiM99AxPAWOXtJyuakmfTl+99g4pIScw6r4JFl/6Q=; b=H6MZkoKl1ejih6LyNBalPj6colLxjOX3MLjh5JawliV3nkgwaVnyQxxrAHqlGxJqix2vlDlnZpH6oxPtmhS/cOjtlwi/GDiTHcQCEJXDHDgyr7vD7u04JwaRGaWM0fw20sPrtQ8s/EcsHn2tQdht85X+p4NYACX2yqkAdWcZOaemJVaVAxO5BYXYDksY2VXGIvW0tGxPMzKAN/vWm9i1DZKat8fHmWY2MAwpb6htEVTwvK/3Ep4sG9iZY3hPrxcgWs6AJ2rOC/0WE5pbtaDnfNhTrzV2XG+iaIQF0sKT5hp7TMgdHsoHPmPzhPKxSrlHa2NLryKzSfjQi6NNfID2WA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=gondor.apana.org.au smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JMxiM99AxPAWOXtJyuakmfTl+99g4pIScw6r4JFl/6Q=; b=KMRNXkhn96vWyp9JcnsDhQjJP8PJcO7u1GGWW4oXbovdhok/numg9Z3vCZ7U7qAY/b4NZb5OyjQt4oTJJbOmZckQ5Je1kX2Jql5N8AvlDvJ2bOTWj9+/3nmo+Zq38Vh+1PFfXCp5Vg4Fmi5rWrj6AvKn/YdbsIh7PU/afRrMrl4= Received: from CH0PR03CA0422.namprd03.prod.outlook.com (2603:10b6:610:10e::19) by MW4PR12MB7263.namprd12.prod.outlook.com (2603:10b6:303:226::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.8; Wed, 7 Feb 2024 21:55:07 +0000 Received: from CH3PEPF0000000A.namprd04.prod.outlook.com (2603:10b6:610:10e:cafe::e5) by CH0PR03CA0422.outlook.office365.com (2603:10b6:610:10e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.38 via Frontend Transport; Wed, 7 Feb 2024 21:55:06 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CH3PEPF0000000A.mail.protection.outlook.com (10.167.244.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7249.19 via Frontend Transport; Wed, 7 Feb 2024 21:55:05 +0000 Received: from AUS-P9-MLIMONCI.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Wed, 7 Feb 2024 15:55:01 -0600 From: Mario Limonciello To: Herbert Xu CC: Mario Limonciello , Tom Lendacky , John Allen , "open list:AMD CRYPTOGRAPHIC COPROCESSOR (CCP) DRIVER - DB..." , open list , "Tim Van Patten" Subject: [PATCH 1/2] crypto: ccp: Avoid discarding errors in psp_send_platform_access_msg() Date: Wed, 7 Feb 2024 15:54:38 -0600 Message-ID: <20240207215439.95871-1-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PEPF0000000A:EE_|MW4PR12MB7263:EE_ X-MS-Office365-Filtering-Correlation-Id: b793ba3a-c491-4de3-f336-08dc282771fb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ANPTg5sPrphLD9JhDgzwfG3t+JkKhzioEyOiqcHfcmckWORl62VEcdiJuO5ntuG1eKKP/vOmrlcZ/kgSZZQc8jvqSvyRGgkVRzs7h9nz90i/24V1gfEngbtuPQPZ3POVCghJg6YhPQrsUXkarHO/ajfbswa3iaSVTJDefcOJI98ABmokNvAI+PkFl1dYFe5B8UyNNs5ISE2MvVXkTCUedF13Zoc7+NAytSP9ncs+Fmss6+IwSPqlBflohEg9U2j7gD7y9j9wGbGfBifzoP54O+QcG0kfXt2QOUdKVbmkB9If2+jLpE4+vBbGohxIAoAAz37ssRJYs7wbVY5D3GaMSyK6Jid82ZXoulWvACBgJPDOQE0dD5O+qWzc7ncF3aaIgImBKptlMuifZrGl6ul/SQW+Sa1XiWvn91EfG9ryvQp/wHGjL8OgCMWpPDXipmNjOeGhCcmCkHR2nc/UDfmGIRe3k6ol6d/O0FqAP2wHliVC4TjnXxuIDUadDCO05tFo/zk3GjpVJaylSjl/+7WIPSrzp3AvcTqH5jhxi7HZO+8vO9N2akfQVL+Q+0oLeQhgF0bjCncu6uqGPv3QHxaMhz6DZqvSMBAFrOoMKc7nknU= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(376002)(136003)(396003)(346002)(39860400002)(230922051799003)(1800799012)(451199024)(64100799003)(82310400011)(186009)(36840700001)(40470700004)(46966006)(41300700001)(54906003)(70206006)(70586007)(316002)(6916009)(5660300002)(2906002)(8936002)(8676002)(4326008)(36756003)(44832011)(83380400001)(356005)(81166007)(82740400003)(7696005)(426003)(336012)(6666004)(478600001)(16526019)(2616005)(26005)(1076003)(86362001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2024 21:55:05.9221 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b793ba3a-c491-4de3-f336-08dc282771fb X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CH3PEPF0000000A.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7263 When the PSP_CMDRESP_STS field has an error set, the details of the error are in `req->header->status`, and the caller will want to look at them. But if there is no error set then caller may want to check `req->header->status` separately. Stop discarding these errors. Reported-by: Tim Van Patten Fixes: 7ccc4f4e2e50 ("crypto: ccp - Add support for an interface for platform features") Signed-off-by: Mario Limonciello Tested-by: Tim Van Patten --- drivers/crypto/ccp/platform-access.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/ccp/platform-access.c b/drivers/crypto/ccp/platform-access.c index 94367bc49e35..792ae8d5b11a 100644 --- a/drivers/crypto/ccp/platform-access.c +++ b/drivers/crypto/ccp/platform-access.c @@ -120,7 +120,8 @@ int psp_send_platform_access_msg(enum psp_platform_access_msg msg, /* Store the status in request header for caller to investigate */ cmd_reg = ioread32(cmd); - req->header.status = FIELD_GET(PSP_CMDRESP_STS, cmd_reg); + if (FIELD_GET(PSP_CMDRESP_STS, cmd_reg)) + req->header.status = FIELD_GET(PSP_CMDRESP_STS, cmd_reg); if (req->header.status) { ret = -EIO; goto unlock; From patchwork Wed Feb 7 21:54:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 13549102 X-Patchwork-Delegate: herbert@gondor.apana.org.au Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2080.outbound.protection.outlook.com [40.107.94.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 622741350F4; Wed, 7 Feb 2024 21:55:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.80 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707342914; cv=fail; b=LpDE1oZUQSGTdDGzGUCAK9j96YTvy8pVaGDvimkK4kZxkvdGReLOX0AcnSm2w3HWzG6oI7o4ogTYl3jhxBhaCHgkVmpqEFHh1Qe3gz2SU/rMYLXZvPUqJpUkuW/H3eUcnXF6L0PVreNKwwwYNfSRKttsGi7kldhhljA2p8FzbfI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707342914; c=relaxed/simple; bh=1g3yxX9ps+Kc2EwgJ/o6nEB4qaYHnnBgebJhg1tW+io=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=jRHm6jQIVZElhHKJ2w1n70wyWCGGGu1We5LieuusvOsh1g9guhfmxXR58UPnqyPrQrM6G+Hy0eutowwNrTDgEmXJe9xneIQdGcF7+5o54eu9ef1LXzENpRQ5wqJZQKGCDHmkSqirKDG80jjkHfd6+27G5C5KcIMoMt3D1oWBAsY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=CqMOx/kX; arc=fail smtp.client-ip=40.107.94.80 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="CqMOx/kX" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UN446AUifdBpF3Bz35AjiXxHzu1Lm3WG0S4fcA4eVt1W9NOvCS3uEFkhLRZDbuKZOoqYWs1VtDgJvtcsSRRf4ZXa+Yx6+FwhGLEPPvizLWkqdG8dUQ2G/669O4OnkrdLb1kaQuIMhlClLQq+XhT4AYNwYbgTw4vBj6OqYhIFw4Hnvad8rKcVP0vlV1fB4HUzowBNUUqA0CPeZaikTRmZR1FBJcIwKpxYjyPHWvdhPBPxlyBfsnsyKQXc6bZN3XeOHgnLcGHKO5jjoy2kKiJILfOQYuohaXigLNqoucXQwZUGm+rxA+RC2xu7Nqxl6NBk7AM0OaKLj+DW86lkVPGPXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JQWUb3HiBZR4g9/sYjsjEUNPhe8hXbvdVYnOW41dby4=; b=HGJVyqO6I1ACIczlZcEfg0nKCMNfO2k/6z1EmGrtkxNwxpPAO6k1RZshZeTtZaZK1RFss78tg8IRQvoXgXUStjwR5GpfCzzCt8xvYUniaU42fL8kw/Fw8OaUq5q/Whd4qXwcBlCjBEQTOw9AniYhgBBmbYTIKvLmuyq+FSw6oOTukQVwwcXnarw5RIBwSoVPCSdkTPFSsjUaGDtK229w03S5veaSTFamLK3C9NrLq+O5VjVBGkJT6cqX64CGs0acM1AdQcRzqJIwLU+xJ6z3EnJ2tHMl/sEVa/FonlWqulV34l0yNUccstljCvMM4Ma8DntqkmczkSuuuXWFPLULRg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=gondor.apana.org.au smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JQWUb3HiBZR4g9/sYjsjEUNPhe8hXbvdVYnOW41dby4=; b=CqMOx/kXXOpV+MHMFy7byiWxVBikXRMQwV6G48Jd1i6J0g7d9gyyXJJHqmeFAXd4oivjIcE6AQgO6GhbB7bccTauFgxUD8m/JnXbq6iu0j12/yaX5qFy8UdwKN7tvZxJ+9I2ffc3CksekmQJ2yLrYUewneZUFCR9qswNtDfJrAI= Received: from CH0PR03CA0437.namprd03.prod.outlook.com (2603:10b6:610:10e::17) by MN2PR12MB4373.namprd12.prod.outlook.com (2603:10b6:208:261::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.16; Wed, 7 Feb 2024 21:55:09 +0000 Received: from CH3PEPF0000000A.namprd04.prod.outlook.com (2603:10b6:610:10e:cafe::e7) by CH0PR03CA0437.outlook.office365.com (2603:10b6:610:10e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.37 via Frontend Transport; Wed, 7 Feb 2024 21:55:09 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CH3PEPF0000000A.mail.protection.outlook.com (10.167.244.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7249.19 via Frontend Transport; Wed, 7 Feb 2024 21:55:08 +0000 Received: from AUS-P9-MLIMONCI.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Wed, 7 Feb 2024 15:55:02 -0600 From: Mario Limonciello To: Herbert Xu CC: Mario Limonciello , Tom Lendacky , John Allen , "open list:AMD CRYPTOGRAPHIC COPROCESSOR (CCP) DRIVER - DB..." , open list Subject: [PATCH 2/2] crypto: ccp: Update return values for some unit tests Date: Wed, 7 Feb 2024 15:54:39 -0600 Message-ID: <20240207215439.95871-2-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240207215439.95871-1-mario.limonciello@amd.com> References: <20240207215439.95871-1-mario.limonciello@amd.com> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PEPF0000000A:EE_|MN2PR12MB4373:EE_ X-MS-Office365-Filtering-Correlation-Id: 20cdee06-4ffd-4f0f-1f3a-08dc2827734c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RWmNIaVlwpLb+Kv7sM4e8Z7sEyR2A+vMji2G8L1GcyQU/RO5kG4Gon77VBiLURHRYKBrlp2IZV+FS06pd/0b6e0G31hTB8dZigQNuZCipQaiPTqk/e0hOwlIoAQqgL/XwE387hyI0CfJDe7mcwGwf2awlB90GuV+bPzYcEER0f4ndV8ukjQgQ7m2BCatd8EzAb7ujjvz9KlCtxVjyXQL/IopjaEYhoouu6rRg37xW9ZxYTomZKzh+35efH/ANU7GYOUVKwi6MCm+WupGJyX3ZxoIvsabKHpk+nsFv7sIMAmstJtRC5OZTUbYAQLV6XqJCnS+GOW72DvV6R3pS3RAuwvi0fnjT977bg8DqYVBE9rZVK0u9zv65tITuoigv0NUIe3V0kjtdPc8Ki9YafDpWJHn9wb9Yw2XmI9AwiPS4oPUxi+IIZwquhwuzx++7nApKrwxDwVfSPoKbOLjK6PTXWuS3WQa0WzMYkaNT+OktsemhnDgU+Pi/YYQXVip3WVGX4XmRecGHkdsyPiFQjHnYcEAFjVej5l2v/Gd6EWdTQeawsLjraQZJxT/xhV4aGkePu4Ny0txP8L9BgbseJY0Sn02ITLRExUEkANsV0dxlSU= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(346002)(136003)(396003)(39860400002)(376002)(230922051799003)(1800799012)(451199024)(64100799003)(186009)(82310400011)(46966006)(40470700004)(36840700001)(336012)(26005)(426003)(2616005)(16526019)(1076003)(44832011)(41300700001)(36756003)(316002)(356005)(6666004)(83380400001)(82740400003)(478600001)(7696005)(81166007)(70206006)(4326008)(2906002)(86362001)(70586007)(54906003)(6916009)(5660300002)(8936002)(8676002);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2024 21:55:08.1409 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 20cdee06-4ffd-4f0f-1f3a-08dc2827734c X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CH3PEPF0000000A.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4373 Until authenticated the platform enforces a state machine. Adjust unit tests with this in mind. Correct the return codes for all the states the unit tests ends up hitting: * Set Param / Get Param: DBC_ERROR_BAD_STATE * Set UID: DBC_ERROR_SIGNATURE_INVALID * Authencitated Nonce: DBC_ERROR_BAD_PARAMETERS Signed-off-by: Mario Limonciello --- tools/crypto/ccp/test_dbc.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/crypto/ccp/test_dbc.py b/tools/crypto/ccp/test_dbc.py index 79de3638a01a..bb0e671be96d 100755 --- a/tools/crypto/ccp/test_dbc.py +++ b/tools/crypto/ccp/test_dbc.py @@ -138,12 +138,14 @@ class TestInvalidSignature(DynamicBoostControlTest): def test_authenticated_nonce(self) -> None: """fetch authenticated nonce""" + get_nonce(self.d, None) with self.assertRaises(OSError) as error: get_nonce(self.d, self.signature) - self.assertEqual(error.exception.errno, 1) + self.assertEqual(error.exception.errno, 22) def test_set_uid(self) -> None: """set uid""" + get_nonce(self.d, None) with self.assertRaises(OSError) as error: set_uid(self.d, self.uid, self.signature) self.assertEqual(error.exception.errno, 1) @@ -152,13 +154,13 @@ class TestInvalidSignature(DynamicBoostControlTest): """fetch a parameter""" with self.assertRaises(OSError) as error: process_param(self.d, PARAM_GET_SOC_PWR_CUR, self.signature) - self.assertEqual(error.exception.errno, 1) + self.assertEqual(error.exception.errno, 11) def test_set_param(self) -> None: """set a parameter""" with self.assertRaises(OSError) as error: process_param(self.d, PARAM_SET_PWR_CAP, self.signature, 1000) - self.assertEqual(error.exception.errno, 1) + self.assertEqual(error.exception.errno, 11) class TestUnFusedSystem(DynamicBoostControlTest):