From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759818AbbCDJdG (ORCPT ); Wed, 4 Mar 2015 04:33:06 -0500 Received: from smtp.citrix.com ([66.165.176.89]:63478 "EHLO SMTP.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756231AbbCDJdE (ORCPT ); Wed, 4 Mar 2015 04:33:04 -0500 X-IronPort-AV: E=Sophos;i="5.09,686,1418083200"; d="scan'208";a="239728807" Message-ID: <54F6D14D.8070908@citrix.com> Date: Wed, 4 Mar 2015 09:33:01 +0000 From: David Vrabel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.4.0 MIME-Version: 1.0 To: Konrad Rzeszutek Wilk , , , Subject: Re: [PATCH 1/2] x86/xen/apic: Work with UP, non-SMP 32-bit kernels. References: <1425414042-13897-1-git-send-email-konrad.wilk@oracle.com> <1425414042-13897-2-git-send-email-konrad.wilk@oracle.com> <20150303202928.GA15436@l.oracle.com> In-Reply-To: <20150303202928.GA15436@l.oracle.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-DLP: MIA2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/03/15 20:29, Konrad Rzeszutek Wilk wrote: > On Tue, Mar 03, 2015 at 03:20:41PM -0500, Konrad Rzeszutek Wilk wrote: >> Most of the APIC code that use APIC_LDR is not used on >> 64-bit. On 32-bit it is bit of an hack - and the mechanism >> it is uses is to "setup" the APIC_LDR via apci->init_apic_ldr >> (which we set to NULL) and then use apic->x86_32_early_logical_apicid >> to get an CPU to APIC ID mapping and also apic->read to match >> the APIC_LDR. >> >> The 'x86_32_early_logical_apicid' is called from 'setup_local_APIC' >> which is called from the following functions: >> - start_secondary ->smp_callin -> apic_ap_setup [not called on PV] >> - native_smp_prepare_cpus -> apci_bsp_setup [not called on PV] >> - up_late_init -> APIC_init_uniprocessor -> apic_bsp_setup ->setup_local_APIC >> [called on PV with CONFIG_SMP not defined, CONFIG_X86_32 and UP kernel] >> >> This patch fixes the build issue and also allows the bootup >> to continue without warnings. >> >> Reported-by: Boris Ostrovsky >> Signed-off-by: Konrad Rzeszutek Wilk >> --- >> arch/x86/xen/apic.c | 15 ++++++++++++--- >> 1 file changed, 12 insertions(+), 3 deletions(-) >> >> diff --git a/arch/x86/xen/apic.c b/arch/x86/xen/apic.c >> index 86bea3e..de1c74d 100644 >> --- a/arch/x86/xen/apic.c >> +++ b/arch/x86/xen/apic.c >> @@ -56,7 +56,10 @@ static u32 xen_apic_read(u32 reg) >> >> if (reg == APIC_LVR) >> return 0x10; >> - >> +#ifdef CONFIG_X86_32 >> + if (reg == APIC_LDR) >> + return SET_APIC_LOGICAL_ID(1UL << smp_processor_id()); >> +#endif >> if (reg != APIC_ID) >> return 0; >> >> @@ -117,6 +120,12 @@ static int xen_phys_pkg_id(int initial_apic_id, int index_msb) >> return initial_apic_id >> index_msb; >> } >> >> +static int xen_x86_32_early_logical_apicid(int cpu) >> +{ >> + /* Match with APIC_LDR read. Otherwise setup_local_APIC complains. */ >> + return 1 << cpu; >> +} >> + > > Argh. That should have been wrapped with CONFIG_X86_32 otherwise it will complain > on 64-bit (not used.. etc). > > David, I can commit it in and fix it up. Can you fold all fixes these into the original patch? No need to unnecessary break bisection. David