Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp420409pxb; Thu, 19 Aug 2021 02:45:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4yseOsARlvdaefdEm8kT+BZAQFQMwvZea/k1W7dZjTiCQv8OIco976cIOBnWskSvkdt1+ X-Received: by 2002:a05:6402:1606:: with SMTP id f6mr15291500edv.111.1629366351574; Thu, 19 Aug 2021 02:45:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629366351; cv=none; d=google.com; s=arc-20160816; b=K2p3I+NY9uCwrPDqFvMlX0aJm/R/t6Aal7HjditKh4WRf6QiLgtNhSnON01IXDUmVM 041hjGcAiQylRYS+Koo/lzHsxGIi4lVOoSfz5dG+LNSc1Wxo1eH4l0OU0sqWbaatYSXC 2X9tGG9xD1e0xXo6tXtiKZEOwmQGVS5O92XUkbU2Uo5i7sed38A1Wh9B2MQpKi8bIPWf cuYBiGX8wmzfEWo7u5CJn8htvA3r2GPX2kr7aiQqYIDowVfhb69m6sM0josCPTxPyT4B sdwJVFTrqKssWFaRWZe0J9/8Hg3vAhdBsVqHud9G7LYApyhnORwq9x6ocrLYgXK24GYp ltCw== 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=uwmNYKgUvDl1MbeSM8Zbb3wFcWRj1jNc+CWB7kbhWHw=; b=I0hP1ebnLaoGShHVmOdw83GBaSI0breYnHeNq6vIfHtBvc6K1n2pKZ5DbCvTlI5Rvq Gt5HxYotA309ef9HDUtyNHhzQiassMpSIoX319ZT7E204ZtLKbBSqbMWttWKFLCwh5k/ kTlwia9Z9dydauMu5JOBwnEl6njqzftebgHzsWuaJAodO1pCa13CdfYbHswhNWaaW/NB y9nowOQ/1qb5pwQXCQCdkOohD9gFStnaE1/4RIS6Q5Ac+ZZ72dTTE3S3iID7HLPvNwn8 zOsakZBElVAyP9RR19qFo8nHYHH2ygu+nO54Ui8R+aIeuDtKYWyoY5XuamIa6jIorOrf M6Nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b="lfXxT/rK"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-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 e1si3214993edl.348.2021.08.19.02.45.18; Thu, 19 Aug 2021 02:45:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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="lfXxT/rK"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-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 S237583AbhHSJpi (ORCPT + 99 others); Thu, 19 Aug 2021 05:45:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232750AbhHSJpi (ORCPT ); Thu, 19 Aug 2021 05:45:38 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C410C061575; Thu, 19 Aug 2021 02:45:02 -0700 (PDT) Received: from zn.tnic (p200300ec2f0f6a00d82486aa7bad8753.dip0.t-ipconnect.de [IPv6:2003:ec:2f0f:6a00:d824:86aa:7bad:8753]) (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 77C831EC046C; Thu, 19 Aug 2021 11:44:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1629366296; 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=uwmNYKgUvDl1MbeSM8Zbb3wFcWRj1jNc+CWB7kbhWHw=; b=lfXxT/rKfaIm0ZtPpptiTqf0qCun2SrPQ6oRQQ0UoETMJZABV80vUnbMS9+m6inEZ15Hjp bp4UuLvXP3Id5wKidovffjUau1hQYozxYFQHk5JdMNAger0/gwaVe39YAwkH/9RoG7TpS8 9so/nY/sffmLI3KXVeb2zWHB3XSDeqE= Date: Thu, 19 Aug 2021 11:45:35 +0200 From: Borislav Petkov To: Brijesh Singh Cc: 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, linux-crypto@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Joerg Roedel , Tom Lendacky , "H. Peter Anvin" , Ard Biesheuvel , Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , 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 , tony.luck@intel.com, brijesh.ksingh@gmail.com Subject: Re: [PATCH Part1 RFC v4 22/36] x86/sev: move MSR-based VMGEXITs for CPUID to helper Message-ID: References: <20210707181506.30489-1-brijesh.singh@amd.com> <20210707181506.30489-23-brijesh.singh@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210707181506.30489-23-brijesh.singh@amd.com> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Finally drop this bouncing npmccallum at RH email address from the Cc list. On Wed, Jul 07, 2021 at 01:14:52PM -0500, Brijesh Singh wrote: > From: Michael Roth > > This code will also be used later for SEV-SNP-validated CPUID code in > some cases, so move it to a common helper. > > Signed-off-by: Michael Roth > Signed-off-by: Brijesh Singh > --- > arch/x86/kernel/sev-shared.c | 84 +++++++++++++++++++++++++----------- > 1 file changed, 58 insertions(+), 26 deletions(-) > > diff --git a/arch/x86/kernel/sev-shared.c b/arch/x86/kernel/sev-shared.c > index be4025f14b4f..4884de256a49 100644 > --- a/arch/x86/kernel/sev-shared.c > +++ b/arch/x86/kernel/sev-shared.c > @@ -184,6 +184,58 @@ static enum es_result sev_es_ghcb_hv_call(struct ghcb *ghcb, > return ret; > } > > +static int sev_es_cpuid_msr_proto(u32 func, u32 subfunc, u32 *eax, u32 *ebx, Since it is not only SEV-ES, then it should be prefixed with "sev_" like we do for the other such functions. I guess simply sev_cpuid() ? > + u32 *ecx, u32 *edx) > +{ > + u64 val; > + > + if (eax) { What's the protection for? Is it ever going to be called with NULL ptrs for the regs? That's not the case in this patchset at least... -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette