Received: by 2002:a05:7208:3188:b0:7e:5202:c8b4 with SMTP id r8csp970022rbd; Fri, 23 Feb 2024 09:02:07 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVWGzoteB8ZssXa0ACGLMF4oTMLNezz0w3jkoG/zcTKDVq4QixIyRaiSWaXCMCOyLRMRYLpwtSWfGAbF9XMX9i8Qi0wIaOwBbLlS1aNQQ== X-Google-Smtp-Source: AGHT+IGe9ebGK5ezES0OOW3ESxEllYDeh/DK44Cjl5iv72LKanRDPCdMUg/4E41F+YEImeuPbdB0 X-Received: by 2002:a17:906:3b03:b0:a3e:422d:a27d with SMTP id g3-20020a1709063b0300b00a3e422da27dmr253687ejf.47.1708707727757; Fri, 23 Feb 2024 09:02:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708707727; cv=pass; d=google.com; s=arc-20160816; b=z2iUeSbnEXY8XkWmv7FMdVB2pAz//cIOPwTkQzAp6Od7y7H3RX7+4qIuFgglJIpHX2 BX4fwcxhy3DmIqZMv+gHVbi7At0C/RAUipAE6norkLqCwTGBmmp9qchslZ9HHVcr6gea kosGSdBVNWkIO90If68x2r+SLiz5XQmG71kDGddHm8LsRnx9H8hQBFe4SBMPaqjd9ESy 8p6K4zFa5LTrYOhEj7m/0/1ynNR4p2djHE/xMIFHMJv721Du9eMK8naaUI4MNuc7POfX QC/TWUUEMH1LlSPrCIhCc7NCBCCIOm9LKQq5y5y8VJbnLExjsLGwuUMU5tRw+51Ujnn6 pYaA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :dkim-signature; bh=Pfc17/TKkSDYgpRi5ALTWEPHfW2uf7bskubXgF1ZJyM=; fh=snuN8lTu7CCcd4L/3/zvkp75hhbwDFXBlKsWrCpSFxM=; b=yWLD6FeevhJ88eeblsqxfrc9R5+iuxveQJFpROP+DMI1NY8BLjR6BOj8uSY2AIOhPi Tm+g234lE+w5lyfu6Y6UMyp6wuL3g1lMjCgSO/TOPB0MsnMVr5Cglv17aFP6az8Tf/W7 DJ0SufuMSSexAK64Y5p/+dOnWcj2+kji7t0UqzT7RUNqYBCAZyAgKqEsDRUyLIfViJvk A7KRIbcaPBZ9OzH3dO72SumFri91Nq2mnUPCQFON1Hzi8uPMHX7356wXBOS83mXGpC/c Hg+tJ2i1P9r0Rxdu0+f5qEJu6OlkZUdemweZjveW51PgOMa/Z22eQQBAfLSgFiL7IgDB tJ4Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=XYzNY+5N; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-78774-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78774-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id v15-20020a1709061dcf00b00a3d00ac3c3fsi6357442ejh.1010.2024.02.23.09.02.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 09:02:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-78774-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=XYzNY+5N; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-78774-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78774-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 2FC661F25F2F for ; Fri, 23 Feb 2024 17:02:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 490FC12CD90; Fri, 23 Feb 2024 17:01:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="XYzNY+5N" Received: from mail-pg1-f202.google.com (mail-pg1-f202.google.com [209.85.215.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1728D12BE99 for ; Fri, 23 Feb 2024 17:01:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708707708; cv=none; b=sar8NuEWQ3buKlSiQ5WnxJDZFCgH6HhYgCktuaGj2JI41Tsll0O0IA/jzUS+L0N1Dpyw8KgO/2y2L9xmKLMphpkbwzNuM40553C77VL3OAxwmIVttn4P7KKO2DDuerbXdpFiJKsg+uJKxeHXqjPRKq1/BR/YHWwAlM/1rWJMawA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708707708; c=relaxed/simple; bh=x9++INN2m+gpmUh/KCO+PSvjrYfe9RJFSkVt3950PsA=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=Z8aDoQ9zOEg8jp4uf9DBGXMxj3/J+MCPyQwqjRUyBC7u7oDpX+Ywqtr16EveOZinFpS8UuCZh0/NUpmxjcyioQmDELRB3D50sNoq2wQTe2zABv3cFtVL9zbx7v+0zG3iiyf0ulYLygbMBhXtnl1DXziTSrHzzfToF/bNWcVhSh0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=XYzNY+5N; arc=none smtp.client-ip=209.85.215.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Received: by mail-pg1-f202.google.com with SMTP id 41be03b00d2f7-5cfc2041cdfso759535a12.2 for ; Fri, 23 Feb 2024 09:01:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1708707706; x=1709312506; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=Pfc17/TKkSDYgpRi5ALTWEPHfW2uf7bskubXgF1ZJyM=; b=XYzNY+5N9nDJwUBFHJ59wyzsY5acfJX/77wylFZqBcvmkBkeuLWfpsTkVO627VN/k7 8qhGqEK5DnMb21wTWOxk42QNwALjarm7cAIGJVz/NoAV2yrbybNK9M1PGKclu/RlkiBA MiOD2u+LG1vIzDmYLEgfq3f+SlWY6lm5fsSxg4ZtG72oTUo9yMkoVnWsl9R2znh8+vlZ kJf0ROc3egeebelhdlu/EgLbFNrN8E0vH8sn7q1Kbnhd1Ix9jhncccIcdtm5SL/4Iy+L 0Dt4wrIFe0Q0Ibs2EJ6FkZlsqnHO6oeSM2i0lHnj3k9GXIrZWXdt8TXGVxoClmuXqGUm ix3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708707706; x=1709312506; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Pfc17/TKkSDYgpRi5ALTWEPHfW2uf7bskubXgF1ZJyM=; b=W9YCt7fnkE+uqAL0hwXdk/ZTTGf4+lfTpLl6lvj6vsY+GyOJxkmumrH9Gt8WFhNpse ugXulpyfzNC6/G9u4OtBlpy6FpOY444Crd4vxq5nOi43KJzYMPs/G12mkA/76k5hSND/ UhUQOZqF2Np98jIVVcyaw4PrAVluJPxfsUTrubbvB7owJWwc2q9Ppi8zaVpGopAJGRcw pXLGdzcLI7zI19vBjtjR9u8S1GyxWZvC1r+xnPHPXvyMwoAo9A3SNlGQnLFwCYiibdpb zvKKF2mSX5025jhgZ1x4vbOdnsaGp43R/8fnapfADcmBZv0qrrd95iWUq5aSKXwu0+bC v3Lw== X-Gm-Message-State: AOJu0YyTb/N4GuhPdyEulF6+bDBQZGKx4uA0QLVpFrnFq6rGSTVp9UUW N3SD9hvXSJhPLkCLmtz2vJHhOxMkl9+iiZQ4CS/b+vUCAmib6tfBSXALX6FSGJJrlio/6t+xvDb zjA== X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:6a02:995:b0:5ca:43c7:a67 with SMTP id cl21-20020a056a02099500b005ca43c70a67mr997pgb.9.1708707706441; Fri, 23 Feb 2024 09:01:46 -0800 (PST) Date: Fri, 23 Feb 2024 09:01:44 -0800 In-Reply-To: <43b9125f-35d4-4368-8783-a41799b11c21@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240223104009.632194-1-pbonzini@redhat.com> <20240223104009.632194-5-pbonzini@redhat.com> <43b9125f-35d4-4368-8783-a41799b11c21@redhat.com> Message-ID: Subject: Re: [PATCH v2 04/11] KVM: SEV: publish supported VMSA features From: Sean Christopherson To: Paolo Bonzini Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, michael.roth@amd.com, aik@amd.com Content-Type: text/plain; charset="us-ascii" On Fri, Feb 23, 2024, Paolo Bonzini wrote: > On 2/23/24 17:07, Sean Christopherson wrote: > > > diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c > > > index f760106c31f8..53e958805ab9 100644 > > > --- a/arch/x86/kvm/svm/sev.c > > > +++ b/arch/x86/kvm/svm/sev.c > > > @@ -59,10 +59,12 @@ module_param_named(sev_es, sev_es_enabled, bool, 0444); > > > /* enable/disable SEV-ES DebugSwap support */ > > > static bool sev_es_debug_swap_enabled = true; > > > module_param_named(debug_swap, sev_es_debug_swap_enabled, bool, 0444); > > > +static u64 sev_supported_vmsa_features; > > > #else > > > #define sev_enabled false > > > #define sev_es_enabled false > > > #define sev_es_debug_swap_enabled false > > > +#define sev_supported_vmsa_features 0 > > > > Ok, I've reached my breaking point. Compiling sev.c for CONFIG_KVM_AMD_SEV=n is > > getting untenable. Splattering #ifdefs _inside_ SEV specific functions is weird > > and confusing. > > Ok, I think in some cases I prefer stubs but I'll weave your 4 patches in > v3. No problem, I don't have a strong preference. I initially added stubs instead of the IS_ENABLED(). The main reason I switched is when I realized that sev_set_cpu_caps() *cleared* capabilities, and so decided it would be safer to have a separate patch that effectively stubbed out the global SEV calls.