Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp4187015pxb; Mon, 21 Feb 2022 14:18:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJxmzNtJGv3WaF9V7hQQwHPeIEgPyf39AlMv8UGo7DnKgvbE2RuOk05T3sgo4QyYEcSksmje X-Received: by 2002:a05:6402:b62:b0:3e2:a75f:b949 with SMTP id cb2-20020a0564020b6200b003e2a75fb949mr23647600edb.62.1645481890091; Mon, 21 Feb 2022 14:18:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645481890; cv=none; d=google.com; s=arc-20160816; b=a+/h8gVplSccQbn5EszqL6iMvqHf6gBO3/5yavehwYqE1kfZMmvIPmdLOWPRsZtjRm /aEXgVVoG0CduIhHLs9ALSYFVpWrxFeRNM78T1qLsiMJZ94kjxyGSbXywMSnkrpPDF5S P0VB7kOWnXMca8+x/hECSro3pJMRzRP3yeKS8EkaoQjIt5YNZt9TON4ws2/vdji8hhqx x4w1lkypyfJOM4d6Nd3cKnXmOmgTWGBBNT9rngOGzQGXp32MetUv/jUD2Em6Fz1nfCd1 kkWMtGOJGL5TGYArIha0xJkGIiPI5lFkID4g8jlyIHYDo3NDIffjURg7UWxepZZgiaDc 8pGw== 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=MWw/afFsOSxJd3d13rKUZHwqChPZ/A+IszeqZt9+ZxE=; b=I9TWGEsBiGO41unhxgYgrnp/IVomp5YR+QasHxeTdZt008iYav9VhljTZUJj1K9O8u LDyC6TASUQtRxSxaUuUP9nrorwRCGE1iUSUJCyRdPdh9de9qeIElPgLCWz4MsSIQ5cFO SXTps5ofms9XJYk7qb3lqZ8+Tpts32DXiZ+V3UeU2osJc4nIBhuIk7mFmT+c0VdvPEG9 3jWTXTcPhbC5kllnld2ytpsiFHvjdRbe6HYLxbkVjLhz0Ki6uqu2Getooi4uUz951YCW ut5GCCDfZ1JiZt1YA852nkxDUkWaLieEAudE99sAuHvEkXGTxpVHtccpZGJxyhf1nu+b v6hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b="Zk1raW6/"; 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 bl4si10916767ejb.462.2022.02.21.14.17.47; Mon, 21 Feb 2022 14:18:10 -0800 (PST) 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="Zk1raW6/"; 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 S229486AbiBUST2 (ORCPT + 99 others); Mon, 21 Feb 2022 13:19:28 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:41786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232589AbiBUSQA (ORCPT ); Mon, 21 Feb 2022 13:16:00 -0500 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F39CDFFF; Mon, 21 Feb 2022 10:06:33 -0800 (PST) Received: from zn.tnic (dslb-088-067-221-104.088.067.pools.vodafone-ip.de [88.67.221.104]) (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 6FFC01EC0531; Mon, 21 Feb 2022 19:06:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1645466786; 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=MWw/afFsOSxJd3d13rKUZHwqChPZ/A+IszeqZt9+ZxE=; b=Zk1raW6/fw1YdurcyqLzeJQ7rNXBWPIoUVEVWPfTnDlK2Nwh9wuLji4gF4dQ7Po3Fh4lTz UOJLIha0PKE4e4iR6cRUEl0q+kqm+K9Gv+Fppz5xJ2HVXKKgBiY4u3QfZGeYH6b7LHNOMA suVVW2daCREEY+ZHQxlrBtkZRhicKz8= Date: Mon, 21 Feb 2022 19:06:29 +0100 From: Borislav Petkov To: "Kirill A. Shutemov" Cc: Brijesh Singh , x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-efi@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-coco@lists.linux.dev, linux-mm@kvack.org, Thomas Gleixner , Ingo Molnar , Joerg Roedel , Tom Lendacky , "H. Peter Anvin" , Ard Biesheuvel , Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Jim Mattson , Andy Lutomirski , Dave Hansen , Sergio Lopez , Peter Gonda , Peter Zijlstra , Srinivas Pandruvada , David Rientjes , Dov Murik , Tobin Feldman-Fitzthum , Michael Roth , Vlastimil Babka , Andi Kleen , "Dr . David Alan Gilbert" , brijesh.ksingh@gmail.com, tony.luck@intel.com, marcorr@google.com, sathyanarayanan.kuppuswamy@linux.intel.com Subject: Re: [PATCH v10 21/45] x86/mm: Add support to validate memory when changing C-bit Message-ID: References: <20220216160457.1748381-1-brijesh.singh@amd.com> <20220221174121.ceeplpoaz63q72kv@box> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220221174121.ceeplpoaz63q72kv@box> 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, Feb 21, 2022 at 08:41:21PM +0300, Kirill A. Shutemov wrote: > On Wed, Feb 16, 2022 at 10:04:57AM -0600, Brijesh Singh wrote: > > @@ -287,6 +301,7 @@ struct x86_platform_ops { > > struct x86_legacy_features legacy; > > void (*set_legacy_features)(void); > > struct x86_hyper_runtime hyper; > > + struct x86_guest guest; > > }; > > I used 'cc' instead of 'guest'. 'guest' looks too generic. But guest is what is needed there. Not all cases where the kernel runs as a guest are confidential ones. Later, that hyperv thing should be merged into the guest one too as the hyperv should be a guest too. AFAICT. > Also, I'm not sure why not to use pointer to ops struct instead of stroing > them directly in x86_platform. Yes, it is consistent with 'hyper', but I > don't see it as a strong argument. There should be no big difference but we're doing it with direct struct member assignment so far so we should keep doing the same and not start doing pointers now, all of a sudden. > This doesn't cover difference in flushing requirements. Can we get it too? What are the requirements you have for TDX on this path? This is the main reason why I'm asking you to review this - I'd like to have one version which works for both and then I'll queue it on a common branch. This is also why I'd like for you and SEV folks to agree on all the common code so that I can apply it and you can both base your patchsets ontop. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette