Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 043FCC38142 for ; Tue, 31 Jan 2023 19:51:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231491AbjAaTvP (ORCPT ); Tue, 31 Jan 2023 14:51:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231615AbjAaTvN (ORCPT ); Tue, 31 Jan 2023 14:51:13 -0500 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2053.outbound.protection.outlook.com [40.107.244.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F6D7582AD; Tue, 31 Jan 2023 11:51:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HzrGNqBFSDdJYaX4sPlCiBD0tlSmc/n0fAtaOVdoE6yEaQgkeCsaEk6gGmF8ZgM5SkTK20crK2MznzY1XCrIA7hUvs1TdJsVhBdG3grjQRhv+UIYfTPLdbml1gk+GB1Rlt+0QvK4OzHdU3rufj2jMd5FRWtstGoGIrMyu4xa1Z4qve92FIR5+0iySITHizYCYmrF/pNNeVegClvJWwCvpaAdDIHp85ffxCrHAmu+nXRONBOu5SA4RzNYUryFl2zvmzKzJekcGUrp78EoCebfQWZE/a2NzdXmd5K6tMuaSA7LRrRbQLmwd2LRauQKWM+CyCacPQt2GxmgIUlfjvPnOw== 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=DsBLt49to03+LfKi3hOjVpobNNYmqhwlGpQwPby0G6E=; b=Upz+OaZsc2nacWERb4YHTbgAYjdaVurte109xGLOMfOYzEjpQ9MI4Wmsiu5l3zKwzoZiUF9+ZWjin7fV/GuLVCA746HmwPHgxaYXrDT4KG17uSksJPwbkRcwKhVmJ6Z0t2RiO3Et844SxAkDWVRxhn6v4uLudsTE8mKprCyOvkdhPzY+FjxmQMBNyWD6VFf3vxpm9B8hCjscFyHXmUHuxmaGhcpJSXyX3GoEgJoYn3NCo1lMwxdoKhP+PFjnOmVnSZr5MsrwA3YQbBvPaLISEUGFGZGOixs9byhuP2xeF17T4Bj2O9e7DFsGQ9DIkPvZAygDy8rqsXwG78tB1iCRlw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; 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=DsBLt49to03+LfKi3hOjVpobNNYmqhwlGpQwPby0G6E=; b=kiaDnspRWtx4ny+35g3+K3t/o60iRXdd1njbYaUPeH9Avi7QfbmoUAcwbfimLnUiW2jNMOwEibwUEWomxcw/eZSRpvse/cZIfF9O1FiFkXQubJ5p4R9wOLsH20MMuhlk7Ae9oLgdX5Uz4yNxT68484NmluGEi/KeXaob/e5vhKg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from DM4PR12MB5229.namprd12.prod.outlook.com (2603:10b6:5:398::12) by DS7PR12MB8347.namprd12.prod.outlook.com (2603:10b6:8:e5::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.22; Tue, 31 Jan 2023 19:51:08 +0000 Received: from DM4PR12MB5229.namprd12.prod.outlook.com ([fe80::6cc0:9c7a:bd00:441c]) by DM4PR12MB5229.namprd12.prod.outlook.com ([fe80::6cc0:9c7a:bd00:441c%9]) with mapi id 15.20.6043.038; Tue, 31 Jan 2023 19:51:08 +0000 Message-ID: <272a68e1-ca89-ff30-81e3-79dfcf211615@amd.com> Date: Tue, 31 Jan 2023 13:51:05 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v1 5/8] crypto: cpp - Bind to psp platform device on x86 Content-Language: en-US To: Jeremi Piotrowski , linux-kernel@vger.kernel.org Cc: Brijesh Singh , "Kalra, Ashish" , linux-crypto@vger.kernel.org References: <20230123152250.26413-1-jpiotrowski@linux.microsoft.com> <20230123152250.26413-6-jpiotrowski@linux.microsoft.com> From: Tom Lendacky In-Reply-To: <20230123152250.26413-6-jpiotrowski@linux.microsoft.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: YT2PR01CA0014.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:38::19) To DM4PR12MB5229.namprd12.prod.outlook.com (2603:10b6:5:398::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR12MB5229:EE_|DS7PR12MB8347:EE_ X-MS-Office365-Filtering-Correlation-Id: 693480e8-123c-4d18-4bab-08db03c47ed3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lxar/Hn5rCfxNSna9DXhpm+H4FCX8mUM0V5iFfRrnAlXc8v/+8wvrB92VXWyn5q/axD1Trt5xteP+o8peaS9TLC5AaYARaheepMG2MM7GrlbanxkPf+VDTFNOssFCjzvZpVdPYVn16EpUctFfCUgS9fu7pYeyU164N+0zJZW9ViPqESlVI3YXTDgl0d/BY/CODPfDZiUjPDnCp9aSP7zHAgxKN+T8UAUXClRS80AZ3oKgFUL3iWDqv9gBfDrLj/GLCSw8xIV4G1L2VvJplT8iRjlVv81h5M8oPAPHtRQTzmPKQvycWzdViotA/kqBUMAkFDRwa2KV1yb/hYt5DWQuchZULu3T+9xtCnoqOzKTjhlHZuqGI8uN+kwmVY5aXHYMx8tq1jYzhmMh63lfv9iLfmgEuWG2IMLVw0TKe39nxbHoljuLARwT1mR4EEHrEk3NsX7d7ILwzzLQPmcrfxx0mw4+jG9QfqXUXPTRXWZ/IDq4y9HwYZiXSrtnU3HWDPIrKhKIbDtsARwyY02IQh4/yETXOW00fInwtkbUsimsi53T7A++nFFT4e2U0v5FLyOXXc5YTER8TJjbKhYLZ8dxHT7arfVq21NSA6MxCNKoZ3JKRGHux6plmlLC1SwWi+OTN44m4AIZU8HcNwrIvhZIgFtyp0/eWt2enpr8kLScwjhCCq+zk+W4ulQEx1X0GzU2EXLH/bXCD5nixZXNdgP6Ad+1NT9zKTdSToxCJInFWQ= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR12MB5229.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(136003)(346002)(396003)(366004)(39860400002)(376002)(451199018)(8676002)(54906003)(316002)(66476007)(478600001)(6486002)(2906002)(8936002)(41300700001)(4326008)(66946007)(5660300002)(66556008)(31686004)(86362001)(38100700002)(36756003)(31696002)(26005)(6512007)(186003)(2616005)(83380400001)(6666004)(53546011)(6506007)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?YnVLU1dGUE02MlRJdVhPcWNaenFuNVpXQ3R1eFM5cTVjSlZyUExqa3RndXZV?= =?utf-8?B?ZTRKOG55TCtocnFHais5N01jUVVneUlQZnBhaldNZ3U3b1RNY21uMFFBSWV4?= =?utf-8?B?MU5GcE9QNmxSUWdFOGlveVZ3M0Z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q0ZTUnpnMlBtRDU0SHh5aThwSzJWSmgzMWxmOThTc3VJM092VXV0SFppWTlX?= =?utf-8?B?TVBUb3NyRVd3RDFMYnFkd2M1YVAwWEdMb3FzKzd4NHI5WWNBaHFPbWVaWXNp?= =?utf-8?B?RGZkS3R3WllLNi8yYTBHbExBeHpja0lFZ2FyWFRMakdHc3RpZFN2VC9kTkFh?= =?utf-8?Q?nfNSadEIcMXGCd+IlptENko2h?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 693480e8-123c-4d18-4bab-08db03c47ed3 X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5229.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 19:51:08.2431 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: BR1c/2Sj1HG+utGBg7157CY7ix9jeNlbsennjz3zw2IqJyGVu/TpvFeucUZ6jIFI6OEf4T9qUoiyBXz73Bfbkw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB8347 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 1/23/23 09:22, Jeremi Piotrowski wrote: > The PSP in Hyper-V VMs is exposed through the ASP ACPI table and is > represented as a platform_device. Allow the ccp driver to bind to it by > adding an id_table and initing the platform_driver also on x86. At this > point probe is called for the psp device but init fails due to missing > driver data. > > Signed-off-by: Jeremi Piotrowski > --- > drivers/crypto/ccp/sp-dev.c | 8 ++++++-- > drivers/crypto/ccp/sp-platform.c | 7 +++++++ > 2 files changed, 13 insertions(+), 2 deletions(-) > > diff --git a/drivers/crypto/ccp/sp-dev.c b/drivers/crypto/ccp/sp-dev.c > index 7eb3e4668286..52b8d957d0f6 100644 > --- a/drivers/crypto/ccp/sp-dev.c > +++ b/drivers/crypto/ccp/sp-dev.c > @@ -258,7 +258,11 @@ static int __init sp_mod_init(void) > ret = sp_pci_init(); > if (ret) > return ret; > - Please keep the blank line here. > + ret = sp_platform_init(); > + if (ret) { > + sp_pci_exit(); > + return ret; > + } Add a blank line here. > #ifdef CONFIG_CRYPTO_DEV_SP_PSP > psp_pci_init(); > #endif > @@ -286,7 +290,7 @@ static void __exit sp_mod_exit(void) > #ifdef CONFIG_CRYPTO_DEV_SP_PSP > psp_pci_exit(); > #endif > - Please keep the blank line here. > + sp_platform_exit(); > sp_pci_exit(); > #endif > > diff --git a/drivers/crypto/ccp/sp-platform.c b/drivers/crypto/ccp/sp-platform.c > index 7d79a8744f9a..ea8926e87981 100644 > --- a/drivers/crypto/ccp/sp-platform.c > +++ b/drivers/crypto/ccp/sp-platform.c > @@ -56,6 +56,12 @@ static const struct of_device_id sp_of_match[] = { > MODULE_DEVICE_TABLE(of, sp_of_match); > #endif > > +static const struct platform_device_id sp_plat_match[] = { s/plat/platform/ Thanks, Tom > + { "psp" }, > + { }, > +}; > +MODULE_DEVICE_TABLE(platform, sp_plat_match); > + > static struct sp_dev_vdata *sp_get_of_version(struct platform_device *pdev) > { > #ifdef CONFIG_OF > @@ -212,6 +218,7 @@ static int sp_platform_resume(struct platform_device *pdev) > #endif > > static struct platform_driver sp_platform_driver = { > + .id_table = sp_plat_match, > .driver = { > .name = "ccp", > #ifdef CONFIG_ACPI