Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp5455373iob; Mon, 9 May 2022 17:19:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSeOtoPbDYrmxmCBeTJVEGK2CrhRMjo3xKxFwH/aNUrSOzDj2H2zrww+68nfoBMvgCuOnb X-Received: by 2002:a05:6808:11c7:b0:2f9:f96c:d0ee with SMTP id p7-20020a05680811c700b002f9f96cd0eemr8695543oiv.134.1652141955341; Mon, 09 May 2022 17:19:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652141955; cv=none; d=google.com; s=arc-20160816; b=QcFttSz1LSWKasHfauiKuKv2XukJs4BIptm2jM0okXjgBAgLGrK0hxl0sSaP1KlmVc Migluj57phgvrPJ4swlIup2CJ6h17uVpRIRVZ63gcKAV0g4EHKsZ4CM6jVLZJFJrLu7z BComOKl3m2jDhxW8gsYPbb4TpS1k8n1AvxD4D/asDaVN6C5cwPu9+m2Q1R+XVg3ZnKDG aj1Jx9HQJHHyvML2Mc/MxZrgx6BseBtAIe3x3pauzHcdI0Sqlxm7EfVzpG6NHyQEqAAl lAgFvx7hYa14dw/THRi/sR/+vArvhW+/3u8ohgWRpmpBupVtCsrFAb5Z++a9RYGPq+bA SF8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=2k2dEWW2F1hrc51g6pFhQEncF54Nbue4YVbgz5LkyTE=; b=X/YUMjzI61elzr1lKfB7lhDV0ieHPXKK91Uif2G+cZWSkhN5vQyiur/Fb+ZmaZ6cN3 mMmv7AMIy5inegOvoBI35VWJbH31+F8JbTL5pL2r91tjZ1kFxEeMsqwjw6a37zEC1KBA liRRLpNNPNZAFs+mo704LdZU/n+qacXwrL6S609s9E8BeKZH4E1bK+MOO28HMu4Lc/Gs EMiDggjMiOb80nmnVR0KcdhFGw531dLzI1laYaBzDNaCc7aUUam+ovlUynNl/hc2SfvR d6C5kbvP451gauNyaIvqc6vrdEL/L6+85sMuLQfKY4KDTh6SVeag3BFxJHHyMYgfeBiz Vw3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b="lV/tv/BB"; 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=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a21-20020a056830101500b00606451e5dfdsi11645827otp.218.2022.05.09.17.19.01; Mon, 09 May 2022 17:19:15 -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=@alien8.de header.s=dkim header.b="lV/tv/BB"; 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=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231464AbiEIWV4 (ORCPT + 99 others); Mon, 9 May 2022 18:21:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229510AbiEIWVy (ORCPT ); Mon, 9 May 2022 18:21:54 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3537A26BC9A; Mon, 9 May 2022 15:17:59 -0700 (PDT) Received: from zn.tnic (p5de8eeb4.dip0.t-ipconnect.de [93.232.238.180]) (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 44E961EC0505; Tue, 10 May 2022 00:17:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1652134673; 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=2k2dEWW2F1hrc51g6pFhQEncF54Nbue4YVbgz5LkyTE=; b=lV/tv/BBA10J6KuReciOQ9eOK4caCe95n4wYgIVJjxAnm/MvUQV1MMl/fvLSanKq3O8I+h /WI2c8ufp0ts8T7FBmUQza5KOUUZx8AwJj4xvAqNH45y8lo3IFnbxg40+yVgxqBY0F2wls fezDy9Tqdv9Nm71Pao3DSOnHh2SHL4Q= Date: Tue, 10 May 2022 00:17:56 +0200 From: Borislav Petkov To: Dave Hansen Cc: Dan Williams , Martin Fernandez , Linux Kernel Mailing List , linux-efi , platform-driver-x86@vger.kernel.org, Linux MM , "H. Peter Anvin" , daniel.gutson@eclypsium.com, Darren Hart , Andy Shevchenko , Kees Cook , Andrew Morton , Ard Biesheuvel , Ingo Molnar , Thomas Gleixner , Dave Hansen , "Rafael J. Wysocki" , X86 ML , "Schofield, Alison" , hughsient@gmail.com, alex.bazhaniuk@eclypsium.com, Greg KH , Mike Rapoport , Ben Widawsky , "Huang, Kai" , Sean Christopherson , "Shutemov, Kirill" , Kuppuswamy Sathyanarayanan , Tom Lendacky , Michael Roth Subject: Re: [PATCH v8 0/8] x86: Show in sysfs if a memory node is able to do encryption Message-ID: References: <6d90c832-af4a-7ed6-4f72-dae08bb69c37@intel.com> <47140A56-D3F8-4292-B355-5F92E3BA9F67@alien8.de> <6abea873-52a2-f506-b21b-4b567bee1874@intel.com> <4bc56567-e2ce-40ec-19ab-349c8de8d969@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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 On Mon, May 09, 2022 at 11:47:43AM -0700, Dave Hansen wrote: > ... adding some KVM/TDX folks + AMD SEV folks as they're going to probably need something like that too. > On 5/6/22 12:02, Boris Petkov wrote: > >> This node attribute punts the problem back out to userspace. It > >> gives userspace the ability to steer allocations to compatible NUMA > >> nodes. If something goes wrong, they can use other NUMA ABIs to > >> inspect the situation, like /proc/$pid/numa_maps. > > That's all fine and dandy but I still don't see the *actual*, > > real-life use case of why something would request memory of > > particular encryption capabilities. Don't get me wrong - I'm not > > saying there are not such use cases - I'm saying we should go all the > > way and fully define properly *why* we're doing this whole hoopla. > > Let's say TDX is running on a system with mixed encryption > capabilities*. Some NUMA nodes support TDX and some don't. If that > happens, your guest RAM can come from anywhere. When the host kernel > calls into the TDX module to add pages to the guest (via > TDH.MEM.PAGE.ADD) it might get an error back from the TDX module. At > that point, the host kernel is stuck. It's got a partially created > guest and no recourse to fix the error. Thanks for that detailed use case, btw! > This new ABI provides a way to avoid that situation in the first place. > Userspace can look at sysfs to figure out which NUMA nodes support > "encryption" (aka. TDX) and can use the existing NUMA policy ABI to > avoid TDH.MEM.PAGE.ADD failures. > > So, here's the question for the TDX folks: are these mixed-capability > systems a problem for you? Does this ABI help you fix the problem? What I'm not really sure too is, is per-node granularity ok? I guess it is but let me ask it anyway... > Will your userspace (qemu and friends) actually use consume from this ABI? Same question for SEV folks - do you guys think this interface would make sense for the SEV side of things? > * There are three ways we might hit a system with this issue: > 1. NVDIMMs that don't support TDX, like lack of memory integrity > protection. > 2. CXL-attached memory controllers that can't do encryption at all > 3. Nominally TDX-compatible memory that was not covered/converted by > the kernel for some reason (memory hot-add, or ran out of TDMR > resources) And I think some of those might be of interest to the AMD side of things too. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette