From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3CEE32F21 for ; Wed, 2 Feb 2022 06:09:37 +0000 (UTC) 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> Precedence: bulk X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220202005212.a3fnn6i76ko6u6t5@amd.com> 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