From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932461AbcFNVW3 (ORCPT ); Tue, 14 Jun 2016 17:22:29 -0400 Received: from mx5-phx2.redhat.com ([209.132.183.37]:52384 "EHLO mx5-phx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752770AbcFNVW2 (ORCPT ); Tue, 14 Jun 2016 17:22:28 -0400 Date: Tue, 14 Jun 2016 17:22:24 -0400 (EDT) From: Paolo Bonzini To: Suravee Suthikulanit Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, rkrcmar@redhat.com Message-ID: <29661011.22418691.1465939344668.JavaMail.zimbra@redhat.com> In-Reply-To: <573935ff-2310-b64f-d3c9-260a89de6752@amd.com> References: <1465922420-53802-1-git-send-email-pbonzini@redhat.com> <573935ff-2310-b64f-d3c9-260a89de6752@amd.com> Subject: Re: [PATCH] KVM: SVM: compile out AVIC if !CONFIG_X86_LOCAL_APIC MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [10.4.164.1, 10.5.100.50] X-Mailer: Zimbra 8.0.6_GA_5922 (ZimbraWebClient - FF46 (Linux)/8.0.6_GA_5922) Thread-Topic: compile out AVIC if !CONFIG_X86_LOCAL_APIC Thread-Index: Bt6HidMJ8y4IKHnrun0I0O7/+ChfKQ== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- Original Message ----- > From: "Suravee Suthikulanit" > To: "Paolo Bonzini" , linux-kernel@vger.kernel.org, kvm@vger.kernel.org > Cc: rkrcmar@redhat.com > Sent: Tuesday, June 14, 2016 8:20:30 PM > Subject: Re: [PATCH] KVM: SVM: compile out AVIC if !CONFIG_X86_LOCAL_APIC > > Hi Paolo, > > On 6/14/2016 11:40 AM, Paolo Bonzini wrote: > > AVIC needs __default_cpu_present_to_apicid. Stub out all functions > > that use it, and disable the module parameter, if Linux is > > compiled without local APIC support. > > I think you are right that we should disable AVIC #ifndef > CONFIG_X86_LOCAL_APIC. However, do you think we should just use > default_cpu_present_to_apicid() instead of the > __default_cpu_present_to_apicid()? I'm not sure why that would help? default_cpu_present_to_apicid is also declared only if CONFIG_X86_LOCAL_APIC is defined. > As for disabling AVIC, I think we can also do: > > if (!IS_ENABLED(CONFIG_X86_LOCAL_APIC)) > avic = false; Yes, we'll need to do that once AVIC is enabled by default; or static bool avic = IS_ENABLED(CONFIG_X86_LOCAL_APIC); In any case the module parameter must be hidden if there's no support in the kernel for the local APIC. Paolo