From mboxrd@z Thu Jan 1 00:00:00 1970 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 20F19C636CC for ; Thu, 16 Feb 2023 17:06:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229576AbjBPRGj (ORCPT ); Thu, 16 Feb 2023 12:06:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229477AbjBPRGi (ORCPT ); Thu, 16 Feb 2023 12:06:38 -0500 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE9514BEA2; Thu, 16 Feb 2023 09:06:37 -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 4E3141EC086F; Thu, 16 Feb 2023 18:06:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1676567195; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=e+I15oMGZyPJMc2Ii9Bnc8ieIaE4xdHS1ezVdaO9Rsk=; b=N6Ry6di65M1mZcQoHgLTI/qcdlU0VYOslr7klqY5J4cZ+ZcG+UcMc+8BzrirdsSLKBui0I T5h+r2ibNhD+jI2f4KES2a5p4u1kpp3ezsxK9qQGA1iWE2jnA85A12/Yl+0mF2UF0gFmaa VxmxWtfdcbm7lmA/DyPRwQTkcK6PlE8= Date: Thu, 16 Feb 2023 18:06:34 +0100 From: Borislav Petkov To: "Michael Kelley (LINUX)" Cc: Sean Christopherson , 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 Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Thu, Feb 16, 2023 at 04:16:16PM +0000, Michael Kelley (LINUX) wrote: > Historically, callbacks like Sean proposed default to NULL and do nothing > unless they are explicitly set. The Hyper-V vTOM code would set the callback. > Is that not sufficient? Or in the two places where the callback would > be made, do you want to bracket with a test for being in a Hyper-V vTOM > VM? If so, then we're back to needing something like CC_ATTR_PARAVISOR > on which to gate the callbacks. > > Or do you mean something else entirely? See the second part of my reply. This thing... > > because there's the next crapola with > > > > https://lore.kernel.org/all/20230209072220.6836-4-jgross@suse.com/ > > > > because apparently hyperv does PAT but disables MTRRs for such vTOM > > SEV-SNP guests and ... madness. > > > > But that's not the only example - Xen has been doing this thing too. > > > > And Jürgen has been trying to address this in a clean way but it is > > a pain. > > > > What I don't want to have is a gazillion ways to check what needs to > > happen for which guest type. Because people who change the kernel to run > > on baremetal, will break them. And I can't blame them. We try to support > > all kinds of guests in the x86 code but this support should be plain and > > simple. ... here. We need a single way to test for this guest type and stick with it. I'd like for all guest types we support to be queried in a plain and simple way. Not: * CC_ATTR_GUEST_MEM_ENCRYPT * x86_platform.hyper.is_private_mmio(addr) * CC_ATTR_PARAVISOR to mean three different aspects of SEV-SNP guests using vTOM on Hyper-V. This is going to be a major mess which we won't support. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette