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 9058AC6FD1D for ; Mon, 20 Mar 2023 19:43:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231164AbjCTTnc (ORCPT ); Mon, 20 Mar 2023 15:43:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230363AbjCTTnK (ORCPT ); Mon, 20 Mar 2023 15:43:10 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E36DBEFB3 for ; Mon, 20 Mar 2023 12:38:10 -0700 (PDT) Received: from [192.168.2.1] (77-166-152-30.fixed.kpn.net [77.166.152.30]) by linux.microsoft.com (Postfix) with ESMTPSA id 9660F20FAEF5; Mon, 20 Mar 2023 12:37:58 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 9660F20FAEF5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1679341080; bh=fKYHLZKDd2H0Ge/PKn5UpCU3kuN64uksgf6mWsqrbhs=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=f32C7TvaLrWAgaHlIhLPPD/lGE7X2qAunoZ0su/8GPJME607I1T3IrvhECd9z7qLs Q9d5I29c0Q+9LPmMagWEYkzzu8j1q+yrtevbjy5mo3hHSmQU75B0UTj7vw16OTwmfK GewRG2DMf34ipDZzx+vA5yrFbhLGucwOwIz1k5+M= Message-ID: <6d3d512b-55e9-8205-461c-02f1e71f2b63@linux.microsoft.com> Date: Mon, 20 Mar 2023 20:37:56 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH v3 3/8] x86/psp: Register PSP platform device when ASP table is present Content-Language: en-US To: Borislav Petkov Cc: linux-kernel@vger.kernel.org, Brijesh Singh , Tom Lendacky , "Kalra, Ashish" , Thomas Gleixner , Ingo Molnar , Dave Hansen , x86@kernel.org References: <20230320191956.1354602-1-jpiotrowski@linux.microsoft.com> <20230320191956.1354602-4-jpiotrowski@linux.microsoft.com> <20230320192504.GCZBizEGDjVtGWpNP3@fat_crate.local> From: Jeremi Piotrowski In-Reply-To: <20230320192504.GCZBizEGDjVtGWpNP3@fat_crate.local> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20/03/2023 20:25, Borislav Petkov wrote: > On Mon, Mar 20, 2023 at 07:19:51PM +0000, Jeremi Piotrowski wrote: >> The ASP table contains the memory location of the register window for >> communication with the Platform Security Processor. The device is not >> exposed as an acpi node, so it is necessary to probe for the table and >> register a platform_device to represent it in the kernel. >> >> At least conceptually, the same PSP may be exposed on the PCIe bus as >> well, in which case it would be necessary to choose whether to use a PCI >> BAR or the register window defined in ASPT for communication. There is >> no advantage to using the ACPI and there are no known bare-metal systems >> that expose the ASP table, so device registration is restricted to the >> only systems known to provide an ASPT: Hyper-V VMs. Hyper-V VMs also do >> not expose the PSP over PCIe. >> >> This is a skeleton device at this point, as the ccp driver is not yet >> prepared to correctly probe it. Interrupt configuration will come later >> on as well. >> >> Acked-by: Tom Lendacky >> Signed-off-by: Jeremi Piotrowski >> --- >> arch/x86/kernel/Makefile | 1 + >> arch/x86/kernel/psp.c | 42 ++++++++++++++++++++++++++++++++++++++++ > > If this is a platform device (driver), why isn't it part of > the drivers/platform/x86/ lineup? > Because of patch 4. My thinking was that the irq setup requires poking at intimate architectural details (init_irq_alloc_info etc.) so it seems like it fits in arch/x86. I also drew inspiration from the sev-guest device in the arch/x86/kernel/sev.c, which is used in a similar context (the PSP device I am registering here is for SNP-host support). Would you prefer it in drivers/platform/x86? Jeremi