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 4D5F2C64ED6 for ; Wed, 22 Feb 2023 23:35:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232769AbjBVXfA (ORCPT ); Wed, 22 Feb 2023 18:35:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229854AbjBVXe6 (ORCPT ); Wed, 22 Feb 2023 18:34:58 -0500 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E6F042BFA; Wed, 22 Feb 2023 15:34:57 -0800 (PST) Received: from zn.tnic (p5de8e9fe.dip0.t-ipconnect.de [93.232.233.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id D1D4E1EC02FE; Thu, 23 Feb 2023 00:34:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1677108895; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=JkWKLHzrUYxU/M0Lk622Xv44tWYxwVb9VGdOPcv19s4=; b=Go/Y5E6h0sonXAPGG3ZKuT1djHI3/mJOAHKjf4U4mErIy2bQG2IhF0ELC7OnmwwQlsDYr0 2e7Pe1fYJcdsGUHUIcRjKVoaZ3ae0YeT/1fepF3ZM6RbNQ83z9AbcyukIqHHn1f3Qdnk8Q gUj1si6mGl4xfFjfyDdcjB8i38o3/d8= Date: Thu, 23 Feb 2023 00:34:50 +0100 From: Borislav Petkov To: Sean Christopherson Cc: "Michael Kelley (LINUX)" , Dave Hansen , "hpa@zytor.com" , KY Srinivasan , Haiyang Zhang , "wei.liu@kernel.org" , Dexuan Cui , "luto@kernel.org" , "peterz@infradead.org" , "davem@davemloft.net" , "edumazet@google.com" , "kuba@kernel.org" , "pabeni@redhat.com" , "lpieralisi@kernel.org" , "robh@kernel.org" , "kw@linux.com" , "bhelgaas@google.com" , "arnd@arndb.de" , "hch@lst.de" , "m.szyprowski@samsung.com" , "robin.murphy@arm.com" , "thomas.lendacky@amd.com" , "brijesh.singh@amd.com" , "tglx@linutronix.de" , "mingo@redhat.com" , "dave.hansen@linux.intel.com" , Tianyu Lan , "kirill.shutemov@linux.intel.com" , "sathyanarayanan.kuppuswamy@linux.intel.com" , "ak@linux.intel.com" , "isaku.yamahata@intel.com" , "dan.j.williams@intel.com" , "jane.chu@oracle.com" , "tony.luck@intel.com" , "x86@kernel.org" , "linux-kernel@vger.kernel.org" , "linux-hyperv@vger.kernel.org" , "netdev@vger.kernel.org" , "linux-pci@vger.kernel.org" , "linux-arch@vger.kernel.org" , "iommu@lists.linux.dev" Subject: Re: [PATCH v5 06/14] x86/ioremap: Support hypervisor specified range to map as encrypted Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 22, 2023 at 02:54:47PM -0800, Sean Christopherson wrote: > Why? I genuinely don't understand the motivation for bundling all of this stuff > under a single "feature". It is called "sanity". See here: https://lore.kernel.org/r/Y%2B5immKTXCsjSysx@zn.tnic We support SEV, SEV-ES, SEV-SNP, TDX, HyperV... guests and whatever's coming down the pipe. And all that goes into arch/x86/ kernel proper code. The CC_ATTR stuff is clean-ish in the sense that we have separation by confidential computing platform - AMD's and Intel's. Hyper-V comes along and wants to define a different subset of that. And that's only the SEV-SNP side - there's a TDX patchset too. And then some other hypervisor will come along and say, but but, I wanna have X and Y and a pink pony too. Oh, and there's this other fun with MTRRs where each HV decides to do whatever it wants. So, we have a zoo brewing on the horizon already! If there's no clean definition of what each guest is and requires and that stuff isn't documented properly and if depending on which "feature" I need to check, I need to call a different function or query a different variable, then it won't go anywhere as far as guest support goes. The cc_platform_has() thing gives us a relatively clean way to abstract all those differences away and keep the code sane-ish. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette