Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp791982pxj; Wed, 2 Jun 2021 11:31:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz34YTdsHCf2jIevKDuCnXD3DEJBJuFn5BlxfWA6whxXLKeKLXn29iCSmc8ySKNMvkgSKsm X-Received: by 2002:a17:906:3644:: with SMTP id r4mr35531651ejb.140.1622658671776; Wed, 02 Jun 2021 11:31:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622658671; cv=none; d=google.com; s=arc-20160816; b=FzyquJgEuyqy9OYYdYSGTnDt0v2nt1nMK7QYfQwTiBrf8K8+mLh6qT0Lsb6Ee+NSPi Vm8DG2vRQV5Lac21qr+eTptTjQ2ngygOHr7Sf/SGbcCvhs7yj0etPHGLu6q2cr01iYrW ImzTx+FedPivF80L3jvIM1Rp/2OPRcubg5nmBNM1VcosBySPTiKrt8ecjnjfl1FFqDy1 C/+I7AIBagMW22hHeP3LzyJBkKPYR/zSBQ/1MCmEk0Wa/QXTwNHnfBGCcPBI8sQCfHjR 9jFP+GYUFVhP6Md9gkVzwDNtHwWJ6zxe/OOXUjxu/MHa4M3JRc/spel05rDwfDaLpOB7 p9XA== 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=JcCqV66/MI6K2z/mFaHnloQLOn8x1Hqpj91uv1miXQ8=; b=oO5Iqon9tCliLeWk7uqN1F3xaZ07OeyQ/goOPLS7Q5/NPfIdRgdrF2GNaw9E0DWH+8 kd67Dw0uGThxrSn47JNg6fl5gbcS5AIMki3GM+htUpGAaFgnZeEpAHFKJqK+kqxG0/PZ Y4efI/8n1MssJysxVkR4tPhUwikR66mCFFIPcDCHK9+R+dpUs+3fLwCWpotrUi5pbWIf NaJ9GXo+p9krEWmeS0MWeXvOLYpZxruoLceGe5RKQ8l8rHJ0cp8NcCOeW6wArzmlUneW nNnbvsfENZ+gYa9CzKbyJWyZoPAe5ebBCG/Zgd5dgad+wgGATgCVDwwe0Cnc/WpIJa9p snOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=kYgOZ7M6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x9si497578eje.114.2021.06.02.11.30.48; Wed, 02 Jun 2021 11:31:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=kYgOZ7M6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S229583AbhFBSbN (ORCPT + 99 others); Wed, 2 Jun 2021 14:31:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229467AbhFBSbM (ORCPT ); Wed, 2 Jun 2021 14:31:12 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2384C061574 for ; Wed, 2 Jun 2021 11:29:28 -0700 (PDT) Received: from zn.tnic (p200300ec2f0f0e00ae3ef7328f799462.dip0.t-ipconnect.de [IPv6:2003:ec:2f0f:e00:ae3e:f732:8f79:9462]) (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 533BF1EC047D; Wed, 2 Jun 2021 20:29:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1622658567; 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=JcCqV66/MI6K2z/mFaHnloQLOn8x1Hqpj91uv1miXQ8=; b=kYgOZ7M6ZODQfPl84NJOzDeFnm6eovmiQQ7XgE0NysQGCQwLGbzdFPi7xpqm9WJgFkawKe Yv3m7J7tpdPAwL9NTNmmDWT3XkXBzjZOjeW46hML4RR2QSi/FKjbcmkBQmJ93bqhxciJN4 3eBRureI2iskTOdBImXTkT3HX44uDe8= Date: Wed, 2 Jun 2021 20:29:22 +0200 From: Borislav Petkov To: Tom Lendacky Cc: Sean Christopherson , Kuppuswamy Sathyanarayanan , Peter Zijlstra , Andy Lutomirski , Dave Hansen , Tony Luck , Andi Kleen , Kirill Shutemov , Kuppuswamy Sathyanarayanan , Dan Williams , Raj Ashok , linux-kernel@vger.kernel.org Subject: Re: [RFC v2-fix-v2 1/1] x86: Introduce generic protected guest abstraction Message-ID: References: <20210527042356.3983284-2-sathyanarayanan.kuppuswamy@linux.intel.com> <20210601211417.2177598-1-sathyanarayanan.kuppuswamy@linux.intel.com> <3036a655-9d09-0f04-62a2-7a72ba9af5c7@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <3036a655-9d09-0f04-62a2-7a72ba9af5c7@amd.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 02, 2021 at 01:15:23PM -0500, Tom Lendacky wrote: > The original suggestion from Boris, IIRC, was for protected_guest_has() > function (below) to be: > > if (intel) > return intel_protected_guest_has(); > else if (amd) > return amd_protected_guest_has(); > else > return false; > > And then you could check for TDX or SME/SEV in the respective functions. Yeah, a single function call which calls vendor-specific functions. If you can point me to a tree with your patches, I can try to hack up what I mean. > I believe Boris was wanting to replace the areas where sme_active() was > specifically checked, too. And so protected_guest_has() can be confusing... We can always say protected_guest_has(SME_ACTIVE); or so and then it is clear. > Maybe naming it protected_os_has() or protection_attr_active() might work. > This would then work SME or MKTME as well. But other names are fine too once we're done with the bikeshedding. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette