Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5508342pxb; Mon, 7 Feb 2022 03:45:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJxi7uEJY0Ute3wxlQqSi2scQHP0vOnSobFPwe2eJ2k0wGjK8ZYSmeIpgNn4LhfOr6Mcc63v X-Received: by 2002:a50:cccb:: with SMTP id b11mr13674224edj.57.1644234304028; Mon, 07 Feb 2022 03:45:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644234304; cv=none; d=google.com; s=arc-20160816; b=Yomk6xL91Ao26jTTKRvTva08TgUkoQVobR9bFzm1yxK3VhE06+pYj+wv1yE8nK0YOY Sk3+Pvmkl9wq6fE13mOM9aR4lneV+LeJqhWtJuPAehHP+xkie6zHIEsIcCwlIAP22o8T VmiF6vH9vLGF8Xc868PEwDzmCqPLfqLvF3CtYUVLgpRO9mJkxWpRAD/5CMiwEwXm44DK cMCuf+cp4SCLzJAm210C0MlqT/4kGz/u1fllZWrYBsiK5Ote3OaVwRrnVZ1ApU8/NLS2 x6slHxIwT/Wfa8G2e02cXrHviEFU72O9+YncmVZ1kqY9a2/f1PmOdC1lmBBDZwUMOZtU Rleg== 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=sZqgeaY2T05GRVx++Y85byZFFFlp+ohQpqesnax8x/o=; b=zDTBp6yF1fnLoxFTZe1T66YkeSlR/RlRg9VUHPNxbQ1Wg73bI5aa80IHOPIvOpSuda 3PXwJZLQdS428WUc51SPO1xs3Qqxt0MxG61cTrzTgr2VhklWbltMxvUL4MWwzSxQ8nZQ /jbbqgWAjbozvJpPhyTXdUle/7ej4x781mmMZ2E4wOZClIlU9GHiG0HmKBZlfo9dzt6s jCjjYP3z3ce++1gFbO+pMw1m5lJi/P7OlPager/PtXCRS7++P5mcPlZZAJeIrlgKLe+p ipDyCbPCPGzweEETizpi0/kh9nRRMZyQEmeGIs7FXOTpXTjzdvQ4Ss0D9XGWDIX5HC1n lZuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=KjtKrheX; 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 h8si7703312ejj.894.2022.02.07.03.44.38; Mon, 07 Feb 2022 03:45:04 -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=KjtKrheX; 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 S244883AbiBBGxA (ORCPT + 99 others); Wed, 2 Feb 2022 01:53:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244791AbiBBGwj (ORCPT ); Wed, 2 Feb 2022 01:52:39 -0500 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C1F8C061757; Tue, 1 Feb 2022 22:09:37 -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 11E321EC0464; Wed, 2 Feb 2022 07:09:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1643782171; 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=sZqgeaY2T05GRVx++Y85byZFFFlp+ohQpqesnax8x/o=; b=KjtKrheXOmUc492KuKPtthqotPhBLPoisxL+wxk9XP9303vFRnbL9SZn3SUmPtGpeFNpYU vi/W1tV6fApf2lZ0sK2bO1HWyJahbnRou6YbfB41YDwNdH//rUwztJa5AX4dCFPOGREpkM w3nRBvX4FyEgNZYkh1vtwdiIRcJ4M3A= Date: Wed, 2 Feb 2022 07:09:24 +0100 From: Borislav Petkov To: Michael Roth 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 , Vlastimil Babka , "Kirill A . Shutemov" , 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 v9 05/43] x86/compressed/64: Detect/setup SEV/SME features earlier in boot Message-ID: References: <20220128171804.569796-1-brijesh.singh@amd.com> <20220128171804.569796-6-brijesh.singh@amd.com> <20220201203507.goibbaln6dxyoogv@amd.com> <20220202005212.a3fnn6i76ko6u6t5@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220202005212.a3fnn6i76ko6u6t5@amd.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 01, 2022 at 06:52:12PM -0600, Michael Roth wrote: > Since the kernel proper rdmsr()/wrmsr() definitions are getting pulled in via > misc.h, I have to use a different name to avoid compiler errors. For now I've > gone with rd_msr()/wr_msr(), but no problem changing those if needed. Does that fix it too? diff --git a/arch/x86/boot/compressed/misc.h b/arch/x86/boot/compressed/misc.h index 16ed360b6692..346c46d072c8 100644 --- a/arch/x86/boot/compressed/misc.h +++ b/arch/x86/boot/compressed/misc.h @@ -21,7 +21,6 @@ #include #include -#include #include #include #include --- This is exactly what I mean with a multi-year effort of untangling what has been mindlessly mixed in over the years... > Since the rd_msr/wr_msr are oneliners, it seemed like it might be a > little cleaner to just define them in boot/msr.h as static inline and > include them directly as part of the header. Ok, that's fine too. > Here's what it looks like on top of this tree, and roughly how I plan to > split the patches for v10: > > - define the rd_msr/wr_msr helpers > https://github.com/mdroth/linux/commit/982c6c5741478c8f634db8ac0ba36575b5eff946 > > - use the helpers in boot/compressed/sev.c and boot/cpucheck.c > https://github.com/mdroth/linux/commit/a16e11f727c01fc478d3b741e1bdd2fd44975d7c > > For v10 though I'll likely just drop rd_sev_status_msr() completely and use > rd_msr() directly. > > Let me know if I should make any changes and I'll make sure to get those in for > the next spin. Yap, looks good. Thanks for doing that! -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette