From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752126AbcFNWBX (ORCPT ); Tue, 14 Jun 2016 18:01:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37503 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751150AbcFNWBW (ORCPT ); Tue, 14 Jun 2016 18:01:22 -0400 Subject: Re: [PATCH] KVM: SVM: compile out AVIC if !CONFIG_X86_LOCAL_APIC To: Suravee Suthikulanit References: <1465922420-53802-1-git-send-email-pbonzini@redhat.com> <573935ff-2310-b64f-d3c9-260a89de6752@amd.com> <29661011.22418691.1465939344668.JavaMail.zimbra@redhat.com> Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, rkrcmar@redhat.com From: Paolo Bonzini Message-ID: Date: Wed, 15 Jun 2016 00:01:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 14 Jun 2016 22:01:21 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14/06/2016 23:44, Suravee Suthikulanit wrote: > On 6/14/2016 4:22 PM, Paolo Bonzini wrote: >> ----- 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. > > Actually, I also meant to include the change that I sent out > (https://lkml.org/lkml/2016/6/13/898), which declares a dummy for the > case #ifndef CONFIG_X86_LOCAL_APIC. That should help with the issue here. I think it is by design that default_cpu_present_to_apicid() is absent. Perhaps you could create a kvm_cpu_get_apicid() function that is either __default_cpu_present_to_apicid() or WARN_ON_ONCE(1)+return 0? Paolo