Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp207266ybb; Tue, 14 Apr 2020 23:09:23 -0700 (PDT) X-Google-Smtp-Source: APiQypKw5UR5aGYv/jISAGP+0zn3d+q2boj66ORDYgfiRRGwdcQpI3OxOsPeikcm+v7fMHGVKIP0 X-Received: by 2002:a17:906:2962:: with SMTP id x2mr3225176ejd.233.1586930963126; Tue, 14 Apr 2020 23:09:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586930963; cv=none; d=google.com; s=arc-20160816; b=ex5X9OYVprvWmM72oQSYvTAOjifrXnbmh0kTY+w0p5d8jq3TYeb/XmFT57EKIQk/Zf KrhAQHVFf1rs7uIPJcnSUNQc7HUGvRKFtxMODH9VfZqLZt2g6xRW64bWGie2q+oWBu0h ovBdYfNGLaTOR2c/Jcgh+lfDqjFm56Sn7E+w1s9CcXUd3mbvbw0Y0WhhvU4FvM2Bd1Uj DaJpe14x3eOn+nPd/F7O83lV9xdyVYNVgu1z9s5YrZ3HYBNw2phK7I7neZTga8HARXOs rgfET3xnIHviO9+EYBZ1fzr/8UYslcbkcqPjfUokBdhuH0lwZtmuTlfjicwfXG1F0Iqb Ky1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=xa5TeX8TatMGlkudm3Ms1WOCXXW9/RaUfuQG+VLbMiA=; b=WHq814QM5blDjPkootXQlmv/hSU3Tf9p89Jl9YWzNotp7c8O2kaxoNaiA44N1b8HS/ QDORYE5vvVWftDudd109/SjHkgDcvp8DGHcjVcuqWmsK8xg1fTuoa3u3ex460/8VhjeQ E3fyHwfFU7gffmUS1u026RiJ/4QHu21NLEQtBY+Sl4FXs0Ktv5AUKYrkArxVuHD2PZbI tfZT12xB4H5QOwGBDZRpDj2dTZ7a9XPH5KblT2scAu8zlwAT46s+RzDQRYni+8idYpFO qzgXsQGc9AGR3dRAy485PL8WK4kM+Z59/F+tfvS9wlX7/2exBORq9zguZyHW7lzaYUQF kFnQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u2si8506215ejr.370.2020.04.14.23.08.56; Tue, 14 Apr 2020 23:09:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389995AbgDMXav (ORCPT + 99 others); Mon, 13 Apr 2020 19:30:51 -0400 Received: from mga04.intel.com ([192.55.52.120]:61968 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727839AbgDMXav (ORCPT ); Mon, 13 Apr 2020 19:30:51 -0400 IronPort-SDR: uL+o9OnxC0Ku67lo1TM/m+AXMaflaHOtCK9YlzPUKWF34dJsIzqJef7YtJBQ/Wy9GVGPb4ICJt cpEdOaOAol1Q== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2020 16:30:50 -0700 IronPort-SDR: 6xS3oIyiWPYzbuRuMfCpwesOhyBvX6iAngnFLjtn/UTd6IYVL3OoZLFq+1VlApXBC2iDRMQ/DC oVRktY4SdKOg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,380,1580803200"; d="scan'208";a="399774243" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.202]) by orsmga004.jf.intel.com with ESMTP; 13 Apr 2020 16:30:47 -0700 Date: Mon, 13 Apr 2020 16:30:47 -0700 From: Sean Christopherson To: Paolo Bonzini Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, ubizjak@gmail.com Subject: Re: [PATCH] KVM: SVM: fix compilation with modular PSP and non-modular KVM Message-ID: <20200413233047.GJ21204@linux.intel.com> References: <20200413075032.5546-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200413075032.5546-1-pbonzini@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 13, 2020 at 03:50:31AM -0400, Paolo Bonzini wrote: > Use svm_sev_enabled() in order to cull all calls to PSP code. Otherwise, > compilation fails with undefined symbols if the PSP device driver is compiled > as a module and KVM is not. > > Reported-by: Uros Bizjak > Signed-off-by: Paolo Bonzini > --- > arch/x86/kvm/svm/sev.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c > index 0e3fc311d7da..364ffe32139c 100644 > --- a/arch/x86/kvm/svm/sev.c > +++ b/arch/x86/kvm/svm/sev.c > @@ -1117,7 +1117,7 @@ int __init sev_hardware_setup(void) > /* Maximum number of encrypted guests supported simultaneously */ > max_sev_asid = cpuid_ecx(0x8000001F); > > - if (!max_sev_asid) > + if (!svm_sev_enabled()) > return 1; > > /* Minimum ASID value that should be used for SEV guest */ > @@ -1156,6 +1156,9 @@ int __init sev_hardware_setup(void) > > void sev_hardware_teardown(void) > { > + if (!svm_sev_enabled()) > + return; > + Tabs instead of spaces. Checkpatch also whinges about going past 75 chars in the changelog. > bitmap_free(sev_asid_bitmap); > bitmap_free(sev_reclaim_asid_bitmap); > > -- > 2.18.2 >