From patchwork Thu Dec 1 23:26:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Christopherson X-Patchwork-Id: 28600 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp540954wrr; Thu, 1 Dec 2022 15:29:45 -0800 (PST) X-Google-Smtp-Source: AA0mqf6/k3Z3h0EQHjC7cuYILXhT2Y51FT0Zrfj4aljB2wIM1dyv2cufFAFMSVOfrAxH/AUJT4Q6 X-Received: by 2002:a05:6402:206b:b0:46a:d5ed:e066 with SMTP id bd11-20020a056402206b00b0046ad5ede066mr27877854edb.335.1669937385705; Thu, 01 Dec 2022 15:29:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669937385; cv=none; d=google.com; s=arc-20160816; b=RwIcxCWsl/EFXj7O8xtyGqQq1bG9z/4t/yga5cGhQNehquwFsMJM/ruKbxhSXVC8ep vk4Vwv5Zasq4TzmROUrKTR413yZjqkpuv1pThSWCVSeS6KQWCbgDyXmqQcDJbRf0Txkj QEoMS2VDhVgMH5TEkNSTU6x0YVk4oneM8wvNEMeArW1XH6IKUzkx2doBedcIo85Z1n2+ X1lvRV/ZwZlVnsqoiaVGDjjMoGVjGp0Pt2ux62dHeHxuc2GEXaDanzlZlzMdtJ81rOxt hthXNep31pXFAA3WibHL40nV8ZO+GLZUuH0JrvHJBxKyIh5Ez2WPfxqz7U7Z7uvUtwEQ 5Ifg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:reply-to:dkim-signature; bh=cZG0yqcEStsxMCOsGsLbuxg5UhLo/05v+igNhXo+egE=; b=mZOxTwfDlUzW+vYFwNutjdLbYT+2d2QqebuBGL8DjH9pfkJCMm9DBzD5g3nx2TJjNE qligsIrj6WeXXUruu9uy9BhpQrmTih9klIGb3S/mKYs57hSJIiXjB0q2lFATtIctniaQ mrHSiz6CQvQuB42Fg1WoDEp7QjEHb3d5RoisM9pLZ0rvkgG3TgwNgrx9sW16GXTB5ZHe rShpLrcjdlnrzN2xnWVYEJrSghFIfXQHQ5FdWfOH/XFV8WZYIKmkeq6UX7VxdCnICtPa s8BlkNH/62sL1SJZcr00U3Zg8wkKzT5FHmr24uEaACNlM/7HLHsqhtNckmBMedmkzags QGng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Rotdmcnd; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ce12-20020a170906b24c00b007c0ae8c7512si2397653ejb.251.2022.12.01.15.29.22; Thu, 01 Dec 2022 15:29:45 -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=@google.com header.s=20210112 header.b=Rotdmcnd; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232029AbiLAX2b (ORCPT + 99 others); Thu, 1 Dec 2022 18:28:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231866AbiLAX2N (ORCPT ); Thu, 1 Dec 2022 18:28:13 -0500 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9E3ECD9AF for ; Thu, 1 Dec 2022 15:27:20 -0800 (PST) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-3b0af5bcbd3so31937297b3.0 for ; Thu, 01 Dec 2022 15:27:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=cZG0yqcEStsxMCOsGsLbuxg5UhLo/05v+igNhXo+egE=; b=RotdmcndZEfo541ypzSPA7Gcqjp5N5B+Rvwnjgnlg21E5OPmwUUXI5ZMNxXAnzf52t IhdK5L/SO2/0KxmL3DKN+rfrgSmI/ZkWytNZTRoph0+fvkqxhzuuLUSw4nUmof/0Udsy iMa5J7R6rApimfrhjQMQ8hhXvU75Xj8K8YoDsaiXGKftndME+NVFdnVaPKbV8S2b10Fu 6gTcApWj7SRS7ZErG2x0H9djRoGdZX/kHKFwcOvoKZCEGCwmWmx9HJ10rz6o0kkDi3Qa 4Ehw0p1YJjZ8tWZNRYLdgtcMZUyVcpBwAuEpg09goY7gr85IH0GXMeA53TfVd4aZmVsy 9jTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=cZG0yqcEStsxMCOsGsLbuxg5UhLo/05v+igNhXo+egE=; b=P3wQ2dlwhert5h4NDIBlgrwBGtdcyBIIYJSKoHvFUGgyRshZaoP0ISjGrlYJC0mZeC UxBl52DMKklsl0uvbvcvzDC+e1xFfRUMD0sJsLRHAh85e0oysTmAjmp0qBwI/YUAstaS FK8NYRnJQ8Fit1AeRWAJWqQQWag049EMd4s//HnAPiA+nsp3C0rwSQRzuAegjRJcrdUj zHG9+CZppcN+z4yUVpqMKri4KPiltOGCVASydfzQpW5A8Du1onfnkCMNF0FthnWkqYmK kJeWa7DgRP4XecZ019bkCEk6NL6y9IZG3JcswRikSWEnTKzXd3kNoqpvfC3LSruMPBrw 1X3A== X-Gm-Message-State: ANoB5plk8zFJsEnt/Ug8fSvk/PMej285fe4/Wp+PMMTYcsNvaq29WTc+ 8+wOxrpieGDNnFT4NWzMugeMCWEjQq0= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a25:ef4c:0:b0:6f5:f4bc:1327 with SMTP id w12-20020a25ef4c000000b006f5f4bc1327mr23058180ybm.244.1669937240562; Thu, 01 Dec 2022 15:27:20 -0800 (PST) Reply-To: Sean Christopherson Date: Thu, 1 Dec 2022 23:26:50 +0000 In-Reply-To: <20221201232655.290720-1-seanjc@google.com> Mime-Version: 1.0 References: <20221201232655.290720-1-seanjc@google.com> X-Mailer: git-send-email 2.39.0.rc0.267.gcb52ba06e7-goog Message-ID: <20221201232655.290720-12-seanjc@google.com> Subject: [PATCH 11/16] KVM: SVM: Make KVM_AMD depend on CPU_SUP_AMD or CPU_SUP_HYGON From: Sean Christopherson To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Sean Christopherson , Paolo Bonzini Cc: "H. Peter Anvin" , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Andrew Cooper X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751056264096948799?= X-GMAIL-MSGID: =?utf-8?q?1751056264096948799?= Make building KVM SVM support depend on support for AMD or Hygon. KVM already effectively restricts SVM support to AMD and Hygon by virtue of the vendor string checks in cpu_has_svm(), and KVM VMX supports depends on one of its three known vendors (Intel, Centaur, or Zhaoxin). Add the CPU_SUP_HYGON clause even though CPU_SUP_HYGON selects CPU_SUP_AMD to document that KVM SVM support isn't just for AMD CPUs, and to prevent breakage should Hygon support ever become a standalone thing. Signed-off-by: Sean Christopherson --- arch/x86/kvm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig index 8e578311ca9d..0d403e9b6a47 100644 --- a/arch/x86/kvm/Kconfig +++ b/arch/x86/kvm/Kconfig @@ -102,7 +102,7 @@ config X86_SGX_KVM config KVM_AMD tristate "KVM for AMD processors support" - depends on KVM + depends on KVM && (CPU_SUP_AMD || CPU_SUP_HYGON) help Provides support for KVM on AMD processors equipped with the AMD-V (SVM) extensions.