From: David Vrabel <david.vrabel@citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
<boris.ostrovsky@oracle.com>, <xen-devel@lists.xenproject.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] x86/xen/apic: Work with UP, non-SMP 32-bit kernels.
Date: Wed, 4 Mar 2015 09:33:01 +0000 [thread overview]
Message-ID: <54F6D14D.8070908@citrix.com> (raw)
In-Reply-To: <20150303202928.GA15436@l.oracle.com>
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 <boris.ostrovsky@oracle.com>
>> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>> ---
>> 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
next prev parent reply other threads:[~2015-03-04 9:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-03 20:20 [PATCH] Fixes to x86/xen: Provide a Xen PV APIC driver to support patch Konrad Rzeszutek Wilk
2015-03-03 20:20 ` [PATCH 1/2] x86/xen/apic: Work with UP, non-SMP 32-bit kernels Konrad Rzeszutek Wilk
2015-03-03 20:29 ` Konrad Rzeszutek Wilk
2015-03-04 9:33 ` David Vrabel [this message]
2015-03-04 9:33 ` David Vrabel
2015-03-03 20:29 ` Konrad Rzeszutek Wilk
2015-03-03 20:20 ` Konrad Rzeszutek Wilk
2015-03-03 20:20 ` [PATCH 2/2] x86/xen/apic: WARN with details Konrad Rzeszutek Wilk
2015-03-03 20:20 ` Konrad Rzeszutek Wilk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54F6D14D.8070908@citrix.com \
--to=david.vrabel@citrix.com \
--cc=boris.ostrovsky@oracle.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.