Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp978651rdb; Fri, 2 Feb 2024 09:32:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IFkSTxCxHIOtBFGgEGzE7yqm1q2EajRzZKtcTpg6uaRJLyNS+zUC5YRA5XMtX5q+a5N5Yq9 X-Received: by 2002:a05:6a20:2d21:b0:19c:b03f:55c2 with SMTP id g33-20020a056a202d2100b0019cb03f55c2mr6847716pzl.4.1706895157490; Fri, 02 Feb 2024 09:32:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706895157; cv=pass; d=google.com; s=arc-20160816; b=gwOxIziFpK3cTJA7PLtt+Nhl6FvlJBbqdfrVARcCRui8wzc1fB4xE5d56sERBQUDWM NNFn4qyj9QBKdDzB+b4pMvne48PnnqemooC84VmCcJd5cpHRJiLFG5u2sw1bOoHVlTsq VhRskYilzzJ7aMh33xsLyXCNObu7V1Hg8DpYlIwHSi/F3qaA3Fdjnv4QlxJ5UN7QBIF6 iC+X2S4Rju+tR01e92H1+czczislw4BYVzzCXHTNI8oUEk/bSjI38A5SnjLsDH92qZSg piewK4c0LcWJZ0J9xJAijelWDIK2JVpjN3j+CKBQJjldrez7JbtHsMe3b7GhAljiNhzK 6wxQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=HLZQ4OidAsTHazkKjDOTPvFe70ZSspDPz33MWpIOKDQ=; fh=d7g73lSf+Y3Hy30d0Nj/sdqVQEpg4Y7yOZ33j4+d238=; b=IOtef8BdQXldxEALotITFo6AmHq6N2qCAqmFYK8KoX2kELDyqySW0Cs9AN+B8oX8cw LdDsR37k5W4ccGxnNI6zwNQl21vdZjEp4BgEQVbVzfiWonujZnW3dRWfUMCOdu6Y5Nzg LHVclzF2ZQeGH5QyKUeXSustjx/usgntzn2J+ykZDoUiwq6ggda/t6W4Wefql+dc6/GY XuvxAEZ2wDzFR8zOZLfw7b0X86XQg5Mc1JZAFJ1sKcaKPCFcXGdhJhG13ajibIq+rhT/ vBX1E710+2WKqsCltYapiul3BakNQWckLnInIV+a8b2GBFBlucPJHiCU1vWBjClYzoMM JcjQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ho5GDTwl; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-49730-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49730-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=1; AJvYcCXuRtF6gGX5RwZAegZ+Zi/8ptIJgH1aYVYhCfdcmPYOmL7+y+aunEC0z3khKqBvMFAEbgWVmSBrjW5Ip+sRoUvPpIk4ATNNGw64maY++A== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id x66-20020a626345000000b006d9b4294509si1838536pfb.200.2024.02.02.09.32.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 09:32:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-49730-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ho5GDTwl; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-49730-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49730-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id C79ECB2D3AE for ; Fri, 2 Feb 2024 11:07:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 65B7D13D51C; Fri, 2 Feb 2024 11:06:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ho5GDTwl" Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) (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 293F73CF68; Fri, 2 Feb 2024 11:06:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.55.52.88 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706872012; cv=none; b=lCmDh4pCq4kilULhjnm9/0OsXHsLQl9NOzhqjqkj9qTSTODfFhCDubH3PiufU7QcmyguX2gDTRnJhuRKY8eoR0QIIrde8wvtLNEjH/BMDUngh/FgBYoPkEzMF5FTkzNTSn/EfJifxr4dZImyHXDqSOQQxChssNM7N2rxLQBASDc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706872012; c=relaxed/simple; bh=BVUwIZJrucltWjChM5sdx0WIRPV1ARt3HSFLPgQ09cY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=N17Eqxwb7fWOom6HdLhodXPggJZq8gdpzHwsg++IN3rEqM6uZGhiJLVnvMuH2JpF4NhJq8JmgLLVgenvekpFPlMQ59D/M0RLBUBXiELKP5EYSQXubUQuPizH0+dXMrK4l+qTm0WDEMZWiXF5QitINgMaI1XauPAjRtxRgJ1Re3I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=ho5GDTwl; arc=none smtp.client-ip=192.55.52.88 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706872011; x=1738408011; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=BVUwIZJrucltWjChM5sdx0WIRPV1ARt3HSFLPgQ09cY=; b=ho5GDTwlMBGA+gxEOrHI1BJSeGJch+F/5a9MWfwkWkiZsY1pG+sNxSFa QJgPEM7Cb4vNsWFdX6xmgY8/LKkU6kUAfBgGUm7MaALnnJz9YYrotcHx9 HCden4/w6670/kmJmXWiPZtW4I20/RpDVZv56lCa2lqdciiV9/SeOOO/f 3a33ryFZep9FlEunf9puODelaEbW67OJNErugIKBMfwb8hr6+zXkm/5nS mSPo7YSUmVK8mOJ638I1+sAWRxqOYBAm1m803zVH1HUsa0BUzc+aWyvFo yOoS1AoDSNpdAhoR3ceLBE34CNCsZISrjQ9K6zypqTVE93NloN2WeZHtS Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10971"; a="435276218" X-IronPort-AV: E=Sophos;i="6.05,237,1701158400"; d="scan'208";a="435276218" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Feb 2024 03:06:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10971"; a="908542663" X-IronPort-AV: E=Sophos;i="6.05,237,1701158400"; d="scan'208";a="908542663" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga002.fm.intel.com with ESMTP; 02 Feb 2024 03:06:46 -0800 Received: by black.fi.intel.com (Postfix, from userid 1000) id 40191128; Fri, 2 Feb 2024 12:30:29 +0200 (EET) Date: Fri, 2 Feb 2024 12:30:29 +0200 From: "Kirill A. Shutemov" To: Nathan Chancellor Cc: Paolo Bonzini , Wanpeng Li , Vitaly Kuznetsov , Sean Christopherson , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , Tom Lendacky , x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, David Rientjes , llvm@lists.linux.dev Subject: Re: [PATCH, RESEND] x86/sev: Fix SEV check in sev_map_percpu_data() Message-ID: References: <20240124130317.495519-1-kirill.shutemov@linux.intel.com> <20240201193809.GA2710596@dev-arch.thelio-3990X> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240201193809.GA2710596@dev-arch.thelio-3990X> On Thu, Feb 01, 2024 at 12:38:09PM -0700, Nathan Chancellor wrote: > Perhaps another solution would be to just > > #define cc_vendor (CC_VENDOR_NONE) > > if CONFIG_ARCH_HAS_CC_PLATFORM is not set, since it can never be changed > from the default in arch/x86/coco/core.c. I think this approach is cleaner. Could you post a proper patch? > > diff --git a/arch/x86/include/asm/coco.h b/arch/x86/include/asm/coco.h > index 6ae2d16a7613..f3909894f82f 100644 > --- a/arch/x86/include/asm/coco.h > +++ b/arch/x86/include/asm/coco.h > @@ -10,13 +10,13 @@ enum cc_vendor { > CC_VENDOR_INTEL, > }; > > -extern enum cc_vendor cc_vendor; > - > #ifdef CONFIG_ARCH_HAS_CC_PLATFORM > +extern enum cc_vendor cc_vendor; > void cc_set_mask(u64 mask); > u64 cc_mkenc(u64 val); > u64 cc_mkdec(u64 val); > #else > +#define cc_vendor (CC_VENDOR_NONE) > static inline u64 cc_mkenc(u64 val) > { > return val; > > Cheers, > Nathan > -- Kiryl Shutsemau / Kirill A. Shutemov