From patchwork Fri May 19 03:24:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 96547 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1403449vqo; Fri, 19 May 2023 10:31:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5U/JdHlbU8bFLGEDfO5ICB2jY47nW9zhSubZ6qlWUbgcCUF8As3r4ahgEE9XcwCTK3LhCF X-Received: by 2002:a05:6a00:23d5:b0:641:39cb:1716 with SMTP id g21-20020a056a0023d500b0064139cb1716mr3980101pfc.20.1684517479974; Fri, 19 May 2023 10:31:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1684517479; cv=pass; d=google.com; s=arc-20160816; b=OKCEiNfV9aPo0oFVjzPb1zB0T4f6u38/SzUJFf1tU/s6SsKN2ClASnsYrnj7u8lniS iIgOqymvzbSTp83PTET+DovxWou39Uh+Zh3IRsxd99gDtunOS4APPobx9fyq8S13c+q0 PzQvrmuqKc4JKtpIuIWA/DIww4IdbD3pbS9sY7AmidCqj/la8Z0JTYqw+QoaJfiGmqxC qHVcxehNEDILn6dVrItVGMBFQPy0Uu4I/DvC/f7fCE9fgoG7qYOe/W6SVhjBdH0h+Buv Hz68hR1/0mfDGdyFmjpNyabQ4sZ6+W9/gMzSub7YP9QutOzqKdXioHcwS0eJsWkqz6A3 inxQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xISGo/DhlU67XWiPpElk8BO8w40MEfpTWkofp4Jk8Y0=; b=NCaG44aZ/KWQbR1uT3d8Rirt8nNzTePym0ZguKwgq4jqM+du/ZR58VgazL9w84kqZ8 k2UfT+OdmGZwTBOBnSUYG57bHl15EcsSLNMCs+qz5tdKsJjYPXj2GVGmIpr2Ucj8gtwC +Ik8cWsHOqrmuwvkoLfBjS63cMG1hAPH7nvjyHdEaa7cS7/9tVw8UgEH71m6pm3ZpuOS dseroaaHQfi/guk0dABCX+umLeCsM7FkfCKbC2v2zBMR9DkMNZiL2zqHuHs1UhxxrntZ sjZgFPNnoDrtXuGk32lzXBU1tksenU3/5n+pRHSSn9G0csfOCLcOc+bhqSIgFxvO/5QH TZMw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=uZz06JUW; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f26-20020aa7969a000000b0063b7b7712a5si4082784pfk.304.2023.05.19.10.31.07; Fri, 19 May 2023 10:31:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=uZz06JUW; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230102AbjESR2i (ORCPT + 99 others); Fri, 19 May 2023 13:28:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229932AbjESR2e (ORCPT ); Fri, 19 May 2023 13:28:34 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2081.outbound.protection.outlook.com [40.107.93.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8ADFFBC; Fri, 19 May 2023 10:28:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fZrguVHrmYErYxtd29Huhph1aXDrTMzXiCjMq75ywSgEGOF9O05NSExFatA8P84gkte8f/dtdLEdsxKCpk6moBiSFzgUqBt9NxobH4Jh4enodl22AYZ5GI+Q3bDpgusXK/CQ/LZULMgpv354t/bzKL8KeK03ZcjDfox37xEvaBFiQ0OVbW9AH1ovg3g38KciIZPggUeigg/l/9GXrZ4r5WfbMWnhK8vrsDNajXPxTpD9dG5UydAldFsOo/HgtFREE9auHsI9iHWGKVDlmlXakLR4EhdIy5CWzt1Ppw1/Q2F/iEd/QYlcqqV7gbkcZwrsyTnrO5Z00VSLySonf8NYMg== 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=xISGo/DhlU67XWiPpElk8BO8w40MEfpTWkofp4Jk8Y0=; b=Rta91m8shJsC+69UWLTJcQ5nSqKb3l62IxTTf+AiW2zZiKA2IZdZ615SwQX6w6q1w62jCgBPWPT76mlPubJyAjklZP/aMwfA2T5iU7FgMIYYpFgGStnxSlGImVqLHJneSI3G0udddXgq/nMiURFosATR0iaeNGwkFwLuorLah7+EUp767HfgawZcn6nh+cJThfwBJ47ztfUcCDn7OKZnxCkDlLu01YXdiYtlQkvbV1/Asq6pFzKUWBViEpVShA2DrL5fZFBFX0BUek7JuJQMIoZUBLC0MLTPMY84KRHfdSpcdo1J5ir58qoZlbxlXpoJ3i2tC3QF7dvonIoFLCxAQg== 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 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=xISGo/DhlU67XWiPpElk8BO8w40MEfpTWkofp4Jk8Y0=; b=uZz06JUWBiRyxhYs2ZlxKSFg6Nl6xT7mvrw7m3hdmCpoKXQGTuv84VAwA2M7cjOpbILaQFYhmA+L0Hl3RiwERGkhZO9Rt2MnZKTpzFQcpvIMSHvOE3N2/EplNuJQuwA9GQp6rZ1rI4G9+AWhf//tKj5sr5xderRY+qqHYhoWpK8= Received: from DM6PR02CA0147.namprd02.prod.outlook.com (2603:10b6:5:332::14) by IA0PR12MB7579.namprd12.prod.outlook.com (2603:10b6:208:43c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21; Fri, 19 May 2023 17:28:30 +0000 Received: from DM6NAM11FT031.eop-nam11.prod.protection.outlook.com (2603:10b6:5:332:cafe::bb) by DM6PR02CA0147.outlook.office365.com (2603:10b6:5:332::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.20 via Frontend Transport; Fri, 19 May 2023 17:28:29 +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 DM6NAM11FT031.mail.protection.outlook.com (10.13.172.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6411.21 via Frontend Transport; Fri, 19 May 2023 17:28:29 +0000 Received: from SITE-L-T34-2.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.2375.34; Fri, 19 May 2023 12:28:27 -0500 From: Mario Limonciello To: Tom Lendacky , Herbert Xu , "David S . Miller" CC: John Allen , , , Mario Limonciello Subject: [PATCH 1/3] crypto: ccp - Validate that platform access mailbox registers are declared Date: Thu, 18 May 2023 22:24:12 -0500 Message-ID: <20230519032414.94247-2-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230519032414.94247-1-mario.limonciello@amd.com> References: <20230519032414.94247-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] 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: DM6NAM11FT031:EE_|IA0PR12MB7579:EE_ X-MS-Office365-Filtering-Correlation-Id: c189b4d2-5a6c-4bda-59b7-08db588e765b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hnvaPjmOWTgiDEcy/zVAp85VioPQg647+PcoH8ScE4S4MUmxKR1kENygGv6NyASS9mrxnExuTw8l0EqogRixSifqBJGy9uwid9jpGomVklLI1keoVP3IozndLM8jeO6uIsT9RtOEvA7qL21J/KJ2LWbmEEt17uca7DswabT9X/X1gYUetz2jD46nM+kaPoPX3wksZ8mmqOnBbWWLqc6bVPxavr/pOWophOcCLkmEZ9UfRZ/8dJ8oXdYojMnhbiCoIYj+lh+JfyA8WLu3kv+J1bChbtcQPX7Cb8PkqZuSA6HSrJupQJMVUhD+2rNdeyUdH8oAfyMw8cyHWccRB2V8wDe4yjSOycz7gms0pPllH94qLFWoIXIxn8Ckoc8QZTG5T3/Av57XMXdJaKzBKXwssPNryVye02tS4hzOS8D3StAjEA0WwBxoADleEeiz95UCj2+xSb5/GNXv2yrZxeF3oJzqaRuTwJHtfI3hhTBBra/v5s5Wv62q1X/TpNgKPsOPzr4HNuyPd0MWZ/neP1xdBvlpQuMfRJ02doSmL8kxV1AC1E4xNk+0dDwv6GiRWV4FV9kDwlsiuAiV51kv7ePp1FnJmNBHTmPciuSMUyx2umuQw+x3EruqXSSaVOV2aQY0lb0Ff+Splmh74cnjoAqR4KuYLT228vMTEt4sZFHiGC0rYNRov/PHvXQAfk9mp/1jpV+F0blmzpgdpk2T0lUKk58+y3uaw1mNuVIQcgRmgQdQPG5Zn2hiS1JGd7Xxg88yn5H7DrCJ7XjAE4CjcAR2eA== 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:(13230028)(4636009)(396003)(136003)(39860400002)(376002)(346002)(451199021)(46966006)(40470700004)(36840700001)(70206006)(70586007)(4744005)(2906002)(8936002)(8676002)(5660300002)(44832011)(316002)(4326008)(15650500001)(41300700001)(86362001)(2616005)(426003)(54906003)(47076005)(110136005)(40460700003)(478600001)(36756003)(7696005)(6666004)(40480700001)(26005)(186003)(16526019)(336012)(1076003)(36860700001)(83380400001)(81166007)(82310400005)(356005)(82740400003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2023 17:28:29.6574 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c189b4d2-5a6c-4bda-59b7-08db588e765b 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: DM6NAM11FT031.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB7579 X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00,DATE_IN_PAST_12_24, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766344601116179766?= X-GMAIL-MSGID: =?utf-8?q?1766344601116179766?= Some platforms might support platform access doorbell but not mailbox. Add an extra guard to ensure this doesn't cause accesses to wrong ranges if a consumer calls psp_send_platform_access_msg(). Signed-off-by: Mario Limonciello --- drivers/crypto/ccp/platform-access.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/crypto/ccp/platform-access.c b/drivers/crypto/ccp/platform-access.c index 939c924fc383..94367bc49e35 100644 --- a/drivers/crypto/ccp/platform-access.c +++ b/drivers/crypto/ccp/platform-access.c @@ -67,6 +67,11 @@ int psp_send_platform_access_msg(enum psp_platform_access_msg msg, return -ENODEV; pa_dev = psp->platform_access_data; + + if (!pa_dev->vdata->cmdresp_reg || !pa_dev->vdata->cmdbuff_addr_lo_reg || + !pa_dev->vdata->cmdbuff_addr_hi_reg) + return -ENODEV; + cmd = psp->io_regs + pa_dev->vdata->cmdresp_reg; lo = psp->io_regs + pa_dev->vdata->cmdbuff_addr_lo_reg; hi = psp->io_regs + pa_dev->vdata->cmdbuff_addr_hi_reg; From patchwork Fri May 19 03:24:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 96558 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1411888vqo; Fri, 19 May 2023 10:44:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4xJmSJFbkiudGFM3PejSG/Z6iQACixnbueSluTetFX7YZXfwaFvxaS5+VtSZ97e2wvFF4O X-Received: by 2002:a17:90a:8597:b0:24d:f159:d28b with SMTP id m23-20020a17090a859700b0024df159d28bmr2942808pjn.47.1684518279578; Fri, 19 May 2023 10:44:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1684518279; cv=pass; d=google.com; s=arc-20160816; b=tvT1JpL6IkazVpTlOM7gvohUsnxOHCezg5B5AnB38dMiw2fLVqbUM0A5g9cwf688VD Cl8RtCeXHiK70qeLYnqjmqaUhPvkjwQSjSBp4LTZK7NOnB/9Bo2rVi2gNT1lG6kJtTes 4mpLNgD5BSwbczYyYXjyh4Wr5n+nonHRh2YkLqYNNxUCuRr/BgmusDGCDmoD7RDJxP1i KTwTEvLmhb4FfVtXG/7FCPq/HeArltdOqBv7LySAUVyMEeI/X20v1szLGCXaCad7CRFy I4A1xNQKEChIMNp93UrI7GjZVP5uBbmUDtVcnw1frK+YWpsx/5hjyNI+kjogbD4j8lFN eZvg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qm5sJ8gAzIBeTYjQxKniEt/dido43KVBJOfMwpxCchk=; b=POyw17R/TthQLVSu+jYBPNJLP+33o9JiFI6legQALceH6YaApt6iKUOQQAGCuEPX9j hS8xsrkrqSC8OrVGERhC4rPrywyyhgYLl310L0ulPlpWu1H8aOGlKSH0SvnHMDoTR2ov +DMkz94EUsGPJY3FHCH+DdMeAp0B7TlGYHBxAixJBGRxqbqPRf8gyCHZoYai59KZUecG /3CaYIcTh4YpCn4Sdpdx2QHOEpzEzb/XjbllomZJgqsbYrKbY2BpJB2cEnvk5dQbx+Wq aQrA9WsTmWh/D7e43IBjGGQjYvhsUP/6uvtwz6B2AVM8JM5+fzNESrmlrsbtw093MIYp UWmQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=eKjliyg3; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i21-20020a17090adc1500b00250a6b87c76si1994989pjv.142.2023.05.19.10.44.22; Fri, 19 May 2023 10:44:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=eKjliyg3; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231217AbjESR2o (ORCPT + 99 others); Fri, 19 May 2023 13:28:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230121AbjESR2g (ORCPT ); Fri, 19 May 2023 13:28:36 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2078.outbound.protection.outlook.com [40.107.220.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7732C110; Fri, 19 May 2023 10:28:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lwboxHf4y2AlvwJs6efXpgPrSEO0HblcElOl/B9x6hhGGOgjAFot5Z1Xcne0TlFLbp+oINc90rCn6f6SeB41N3xlXYyTXiJu1cyMwCLHpNUO4REEyQDjDV+GnKFQWa41iSSAEKv3k0ezfNOZ463kvfNLjucmuXTVlGaxgEq4JGKuzPXPQIoVcH6IzodEGZKQtsOxY65Tkbsze/9D5lWKvoatfuIWRFLsRbsFFbaNfow/F39IuF7RBr6DXTMbfCsRSez7B/X5ow/BBJ8uX48CUUatGa1yYA2uqroyJEsCTSJE0Tug5Fw12eOGIb7AKMeC9KFotatdKiWEtz7n70E+og== 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=qm5sJ8gAzIBeTYjQxKniEt/dido43KVBJOfMwpxCchk=; b=S7RJE+gs1zCJQOcCBmflbGshZM3bsRHV8wlpavdGk4SI6MRdlm4VcLT54nExM3sUsqV/xi/O19WAD/7stR1Fy187ld3NLQFH79A4eFkSKU8yDTTg1wmciOWfPgj9JFB1JXDxvtWLF8SJT3GZuVD36C+SpFkNrGvaFjg+lpEeeLjs52TdWSP3iViAQ9bcIDl/9Ia6UQYpx8TezqkKiO0AdRDBGhPP8wpWxV6jd2kRbG5cZ8jW6/sgVsHEoYVX4RDcJXTJrbPYiN1b/DFpsAFKpyIHsOk8Dl32mjHYTDugvukLRLRSsKi1Ltk9/2oXQiVnfYG3cGJv6hzCTFoL6ZBCpw== 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 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=qm5sJ8gAzIBeTYjQxKniEt/dido43KVBJOfMwpxCchk=; b=eKjliyg3S7cydheijgDU4neZgzFIQa/EYf+aoI8xy3VGWRUs9xV6PEX7CNsCzWm+rOYjjfJtbHXfwZiK4Z9JPK5eULOUH4wvxdlgqEMN6aWwpdGendv2ASJ74ysrBISt6wucKdgDWLDZA0A1dklnjTzjJ/VvG/me7U0GB3uFjWw= Received: from DM6PR02CA0163.namprd02.prod.outlook.com (2603:10b6:5:332::30) by PH8PR12MB7446.namprd12.prod.outlook.com (2603:10b6:510:216::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21; Fri, 19 May 2023 17:28:31 +0000 Received: from DM6NAM11FT031.eop-nam11.prod.protection.outlook.com (2603:10b6:5:332:cafe::3e) by DM6PR02CA0163.outlook.office365.com (2603:10b6:5:332::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21 via Frontend Transport; Fri, 19 May 2023 17:28:30 +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 DM6NAM11FT031.mail.protection.outlook.com (10.13.172.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6411.21 via Frontend Transport; Fri, 19 May 2023 17:28:30 +0000 Received: from SITE-L-T34-2.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.2375.34; Fri, 19 May 2023 12:28:29 -0500 From: Mario Limonciello To: Tom Lendacky , Herbert Xu , "David S . Miller" CC: John Allen , , , Mario Limonciello Subject: [PATCH 2/3] crypto: ccp - Add support for PCI device 0x17E0 Date: Thu, 18 May 2023 22:24:13 -0500 Message-ID: <20230519032414.94247-3-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230519032414.94247-1-mario.limonciello@amd.com> References: <20230519032414.94247-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] 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: DM6NAM11FT031:EE_|PH8PR12MB7446:EE_ X-MS-Office365-Filtering-Correlation-Id: 81d2113a-8ee5-4af1-3af5-08db588e7702 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gFkYh3j/dnsDP0AUxYoouSveqenSUvm4hkM+Z5TTfdfGmDsgnVEQhHds43zZA+Nu1BTNY8M7qYiKqoH3HMgstY6CsYoybPoTHRn7huFRT/ogrgf0ALljXuyJj0DbAU7+JL9wfvMVJ3CfB6BG5nOw66tTzi89KpUl7paXC5tqbIc8aPn/2bBRzoG4dHSrGrdvCSS3vzyOKvUxVwZ971cdPQI1Ee7sd2few4qZ8n6+1y2GGJfwEO0yM8hsD+fC5NoMGllWPMU4q9LkpBEUsNx6Nd/58KO6GD0RMM/bWUtriZKujRdJhOTJ4QGs18KvdLVzYHH6aZ7wotjsbH0IuRUM96DMCdxhcwEJb3mJBUH0mToQjAjaWFgyYfVomhDzf7iHMGp4qmIIN9IS4D3yzPCgxew/6+LIXLcxLGbtliHcWvLxRv4ORr1O9GlBqYGr0HtkGBwY10TT6rZHtUEJISK2cHYvWNTErL3mPUyU+d1+9NOhN3dLzxsZmYVlBxdHMZkfuSvi5EVLHzmyFJGljynRAXurnVzQtiotubT/IEJXKhKYmDoRY3iI/aEkylI/1J7yPCsDBxMDv8S9iWjYrupNy1JQtq4yLC0iVddQjCMLZrZA/ZBcFhW1aOK6qVXP30SqdcftgsRD5lEMhuevR1o+6VhIENUW6biLpgemgjU1C+QwR6f22tNnY+sj3jt+3zUDgLlQ3PS+bP7e1sdLbcItt8VniR+lLSK70OrWaW8H+Cd7IIZ7w/QCBC+H1cQdEM7R7Of43JTPgNxQPAQ1MgIabA== 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:(13230028)(4636009)(396003)(346002)(136003)(39860400002)(376002)(451199021)(40470700004)(46966006)(36840700001)(16526019)(70206006)(70586007)(4326008)(110136005)(54906003)(82740400003)(8676002)(8936002)(40480700001)(478600001)(316002)(6666004)(41300700001)(7696005)(40460700003)(2906002)(86362001)(81166007)(356005)(26005)(44832011)(47076005)(2616005)(83380400001)(1076003)(36860700001)(186003)(426003)(336012)(36756003)(5660300002)(82310400005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2023 17:28:30.7511 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 81d2113a-8ee5-4af1-3af5-08db588e7702 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: DM6NAM11FT031.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB7446 X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00,DATE_IN_PAST_12_24, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766345439591359082?= X-GMAIL-MSGID: =?utf-8?q?1766345439591359082?= PCI device 0x17E0 includes new TEE offsets, doesn't support a platform mailbox, and does support platform doorbell so introduce a new structure to represent it. Signed-off-by: Mario Limonciello --- drivers/crypto/ccp/sp-pci.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/drivers/crypto/ccp/sp-pci.c b/drivers/crypto/ccp/sp-pci.c index aa15bc4cac2b..d0d70af0c4c0 100644 --- a/drivers/crypto/ccp/sp-pci.c +++ b/drivers/crypto/ccp/sp-pci.c @@ -361,6 +361,14 @@ static const struct tee_vdata teev1 = { .ring_rptr_reg = 0x10554, /* C2PMSG_21 */ }; +static const struct tee_vdata teev2 = { + .cmdresp_reg = 0x10944, /* C2PMSG_17 */ + .cmdbuff_addr_lo_reg = 0x10948, /* C2PMSG_18 */ + .cmdbuff_addr_hi_reg = 0x1094c, /* C2PMSG_19 */ + .ring_wptr_reg = 0x10950, /* C2PMSG_20 */ + .ring_rptr_reg = 0x10954, /* C2PMSG_21 */ +}; + static const struct platform_access_vdata pa_v1 = { .cmdresp_reg = 0x10570, /* C2PMSG_28 */ .cmdbuff_addr_lo_reg = 0x10574, /* C2PMSG_29 */ @@ -369,6 +377,11 @@ static const struct platform_access_vdata pa_v1 = { .doorbell_cmd_reg = 0x10a40, /* C2PMSG_80 */ }; +static const struct platform_access_vdata pa_v2 = { + .doorbell_button_reg = 0x10a24, /* C2PMSG_73 */ + .doorbell_cmd_reg = 0x10a40, /* C2PMSG_80 */ +}; + static const struct psp_vdata pspv1 = { .sev = &sevv1, .feature_reg = 0x105fc, /* C2PMSG_63 */ @@ -399,6 +412,14 @@ static const struct psp_vdata pspv4 = { .intsts_reg = 0x10694, /* P2CMSG_INTSTS */ }; +static const struct psp_vdata pspv5 = { + .tee = &teev2, + .platform_access = &pa_v2, + .feature_reg = 0x109fc, /* C2PMSG_63 */ + .inten_reg = 0x10510, /* P2CMSG_INTEN */ + .intsts_reg = 0x10514, /* P2CMSG_INTSTS */ +}; + #endif static const struct sp_dev_vdata dev_vdata[] = { @@ -451,6 +472,12 @@ static const struct sp_dev_vdata dev_vdata[] = { .bar = 2, #ifdef CONFIG_CRYPTO_DEV_SP_PSP .psp_vdata = &pspv3, +#endif + }, + { /* 7 */ + .bar = 2, +#ifdef CONFIG_CRYPTO_DEV_SP_PSP + .psp_vdata = &pspv5, #endif }, }; @@ -463,6 +490,7 @@ static const struct pci_device_id sp_pci_table[] = { { PCI_VDEVICE(AMD, 0x14CA), (kernel_ulong_t)&dev_vdata[5] }, { PCI_VDEVICE(AMD, 0x15C7), (kernel_ulong_t)&dev_vdata[6] }, { PCI_VDEVICE(AMD, 0x1649), (kernel_ulong_t)&dev_vdata[6] }, + { PCI_VDEVICE(AMD, 0x17E0), (kernel_ulong_t)&dev_vdata[7] }, /* Last entry must be zero */ { 0, } }; From patchwork Fri May 19 03:24:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 96564 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1414038vqo; Fri, 19 May 2023 10:48:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5jXmkrkNMUpUx7Wd6W/5h0htBCwfD37fHN2+rZMeBUhuJvUTXnJU0r0m0VdH19IJSJATos X-Received: by 2002:a05:6a00:a21:b0:644:ad29:fd37 with SMTP id p33-20020a056a000a2100b00644ad29fd37mr4001574pfh.28.1684518515654; Fri, 19 May 2023 10:48:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1684518515; cv=pass; d=google.com; s=arc-20160816; b=CceyFF8swoc5mX5ehcIat85+N5e4xxDQn9twwGTZabsIaSCMWalhrk76oPPMsr7z1N YWy5b3hz/UF+9B+C/kdjFFbtpgwtxbX6cquEMAqGwQdhpS/uxGRAUIOSlzgC+xmGma2H GhqD4iQWmt31ooaync8nk2+AX9AinTSIRge/MeI3TtjazYxicBH8niprVlCPkNKaFT1O 7zunCYI3So1UFfjhQBlYfCr8tEZA/ra0wXtqDm97QdRKZpguBWCkUIj7RbB7h23ov82p 4FS6XLSzOGlAdGvhUCisQLgvPV2FnmwbIHE1L4kerxvwkPgNKuq/0WqmFSc04O04W55r onrA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=33zng0V4+/r/isgoeEknAvCd27yu7Ztkc92N4txYOhY=; b=HlGS3W3rpC/W32gOpJAl+5xWvR3cyihs/Z+qFoBQ1A6zc388iksBZYUW9AZGkxjnb8 0Rh7BHEHS0wz06+H1zNm9wsCrRjFMdLCMKr3aqSfdIa51BGuJPLEFc+ilJxNpmEpghxT /KOksDsQfiAeGeyoEbz9ixutpU5f4FoWYGViLdt9Ek/Oh6EN3lhw8vRhScTQdg82GKDg morritS75lQWPn0AkmYyhJlmCsLalGhd47M28iMqPP5ns52XNy/S14eg5iSYQJxzp5RI QspDl7PNPS8igviFhx/USuyrjATA1VkoY2enthJDgWYCIvjK87ewE26YUnmtXDGCRlBC jf2w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="wuOQ/IAA"; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m26-20020a63711a000000b005309f24f940si2648556pgc.586.2023.05.19.10.48.20; Fri, 19 May 2023 10:48:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="wuOQ/IAA"; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231340AbjESR2q (ORCPT + 99 others); Fri, 19 May 2023 13:28:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229932AbjESR2j (ORCPT ); Fri, 19 May 2023 13:28:39 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on20606.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eaa::606]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29CB118F; Fri, 19 May 2023 10:28:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U7HWTrc07BPtghTwKVDGIiigES69NXF0jOZUDEpE/tiB5Hj9BoQTsENFCwkN9HiNT1/PAlzM29XDckBDd+XvLxK6amdQaVUEAA6kbQaigUabyNzqAEEfcxKsBsrXVPeyhyHyztri/TDc1J6aIKrKambOdLjm/7u6zdyIYhoH8ucZOhvtnuaymWgMD2XLK5YfBPQM+Q4gNak23moYmgIfevrZxmlFSCOcoHXRltIwXKkInB9QwTa71xujubCw2F6rSn/BmkHyp/WI90BwwjGGziakeTjsI02rZkHtQ/+xLAq4H+lSLvHO5R565ptrXSQLHfiaFK4FVWzZtW97thqbzA== 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=33zng0V4+/r/isgoeEknAvCd27yu7Ztkc92N4txYOhY=; b=lqwouS/Q3CYQYvrHlxm1et2bDy0VfmtU1JJCCSD/f+FpQgYxG3my27QeirXznSskmjhZGrPG0oztxulaieoO5oiOTl2j2NG7vTudN7NdeFT3rmTvRdlJ+TSS++SM7RcUGk2i4kLgUPND3ZJYKDWBfg786sWCWgtPUdxuXOkJkdMj+BkV0jIopKn/tQkFN/Ph4OqXNsK3ZYLNV6Wo4mMi45WO/sdGQ2ksZ6KLTgjPKVTxClHF+f2uFa2b7qp2XxObeLBEMln16JpEYAnm8Ii4ChqhXk14sknJiRbSr6OjXt/AMjDiuzdqwQUx8Fj3TbCDmbh+sAKImn7YCYyWWXw88Q== 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 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=33zng0V4+/r/isgoeEknAvCd27yu7Ztkc92N4txYOhY=; b=wuOQ/IAAu345Ukx3OZkaiwEUiOB60KvznXIsVUW7hSyBx4/UmB+B4nslnPHlXrFnvZdoiK6X+JixP74G9tEMzsMxafo4d7Pmg8fUlPyCWM3hkqrlus4kt9TzE0B6ZOgC8UEy9XQtvX74kARwJi3Ia5c8to2w8ZAwXdEsqM2Y7xo= Received: from DM6PR02CA0153.namprd02.prod.outlook.com (2603:10b6:5:332::20) by IA0PR12MB7673.namprd12.prod.outlook.com (2603:10b6:208:435::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21; Fri, 19 May 2023 17:28:31 +0000 Received: from DM6NAM11FT031.eop-nam11.prod.protection.outlook.com (2603:10b6:5:332:cafe::1e) by DM6PR02CA0153.outlook.office365.com (2603:10b6:5:332::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.19 via Frontend Transport; Fri, 19 May 2023 17:28:31 +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 DM6NAM11FT031.mail.protection.outlook.com (10.13.172.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6411.21 via Frontend Transport; Fri, 19 May 2023 17:28:31 +0000 Received: from SITE-L-T34-2.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.2375.34; Fri, 19 May 2023 12:28:30 -0500 From: Mario Limonciello To: Tom Lendacky , Herbert Xu , "David S . Miller" CC: John Allen , , Subject: [PATCH 3/3] crypto: ccp - Add support for PCI device 0x156E Date: Thu, 18 May 2023 22:24:14 -0500 Message-ID: <20230519032414.94247-4-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230519032414.94247-1-mario.limonciello@amd.com> References: <20230519032414.94247-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] 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: DM6NAM11FT031:EE_|IA0PR12MB7673:EE_ X-MS-Office365-Filtering-Correlation-Id: 485d5025-fe55-4fe2-f75a-08db588e7782 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0vhemVVw31y7/OC+JEDxwbx5D5rCxVtgcoiYPqHu33J9vJc0YH9D5ZVaJMXEOHDWvj7+XJf8ShSEHZyeIHYPIsMTTD5bsE8ZJ/4PQOFAyNOlPXYtzJpL91C1eCEdI0XJxC1lvM6kunZX+pVEtXu9StCqG4byiZZ/HZrCnCSbfHMlKmtS81LFlB5sM94J91yKRjjwIYWlUrVOQ6tB0reXewLPp14RumCuDpBAgJdwPL5hCj0Oi0nqwBF5FqY+sJeahJjCyO4VfsWqIni195/o7AC+Ug29nBznphInxRds8jVzhAPr3OOLIIPr1t0xdSUMcLkNDXKtKEyLpox9fPxEemraGj6aRsFip3GugXSd0bwDrTP3wTjpDzJ3vvFZ9qGegUo9pYeEgpdg6pNnwI2w1yj1jTTL+tN5BEvh+P3U/aAkMRF2eB2Cr+IePe90OsVI0RbLW/XdOvHyAxSQhwIiZ1EWKlxoIAVjJfyf+osZHuJBW6J1QtgGKFGgqf75xlLoDx/obfeNWWB1nDBiwdtATG5ChRl9ZL0jXRjJtyLJkPT4NmIELEODdA7iqW2TJiwhzHyQIcDY9DyVRBrgPZnkel130XZG21yeuGSvJbqNzP4m4TvBsCPZagWErKmySCaTGsFIwlW5/waZ21sSGdSWGt1VHvDsv8zIvVMuLpSlYrF/wtWPxcVRi/JJR+w8aINyKk+NQQffxXtKBdDnA5KbwD4Sxqs/LiW0OPrCuhDbIx01lTJ0JTrCpadxnN9EzbeURaEJIQZYy1p3m8ZV3xWgPA== 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:(13230028)(4636009)(396003)(346002)(136003)(39860400002)(376002)(451199021)(40470700004)(46966006)(36840700001)(16526019)(70206006)(70586007)(4326008)(110136005)(54906003)(82740400003)(8676002)(8936002)(40480700001)(478600001)(316002)(6666004)(41300700001)(7696005)(40460700003)(2906002)(86362001)(81166007)(356005)(26005)(44832011)(47076005)(2616005)(1076003)(36860700001)(186003)(426003)(336012)(36756003)(5660300002)(82310400005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2023 17:28:31.5948 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 485d5025-fe55-4fe2-f75a-08db588e7782 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: DM6NAM11FT031.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB7673 X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00,DATE_IN_PAST_12_24, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766345686979404359?= X-GMAIL-MSGID: =?utf-8?q?1766345686979404359?= From: John Allen Add a new CCP/PSP PCI device ID and new PSP register offsets. Signed-off-by: John Allen Signed-off-by: Mario Limonciello --- drivers/crypto/ccp/sp-pci.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/crypto/ccp/sp-pci.c b/drivers/crypto/ccp/sp-pci.c index d0d70af0c4c0..b603ad9b8341 100644 --- a/drivers/crypto/ccp/sp-pci.c +++ b/drivers/crypto/ccp/sp-pci.c @@ -420,6 +420,14 @@ static const struct psp_vdata pspv5 = { .intsts_reg = 0x10514, /* P2CMSG_INTSTS */ }; +static const struct psp_vdata pspv6 = { + .sev = &sevv2, + .tee = &teev2, + .feature_reg = 0x109fc, /* C2PMSG_63 */ + .inten_reg = 0x10510, /* P2CMSG_INTEN */ + .intsts_reg = 0x10514, /* P2CMSG_INTSTS */ +}; + #endif static const struct sp_dev_vdata dev_vdata[] = { @@ -478,6 +486,12 @@ static const struct sp_dev_vdata dev_vdata[] = { .bar = 2, #ifdef CONFIG_CRYPTO_DEV_SP_PSP .psp_vdata = &pspv5, +#endif + }, + { /* 8 */ + .bar = 2, +#ifdef CONFIG_CRYPTO_DEV_SP_PSP + .psp_vdata = &pspv6, #endif }, }; @@ -491,6 +505,7 @@ static const struct pci_device_id sp_pci_table[] = { { PCI_VDEVICE(AMD, 0x15C7), (kernel_ulong_t)&dev_vdata[6] }, { PCI_VDEVICE(AMD, 0x1649), (kernel_ulong_t)&dev_vdata[6] }, { PCI_VDEVICE(AMD, 0x17E0), (kernel_ulong_t)&dev_vdata[7] }, + { PCI_VDEVICE(AMD, 0x156E), (kernel_ulong_t)&dev_vdata[8] }, /* Last entry must be zero */ { 0, } };