xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@amd.com>
To: Konrad Rzeszutek Wilk <konrad@darnok.org>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Jan Beulich <jbeulich@suse.com>,
	Stefan Bader <stefan.bader@canonical.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: Workings/effectiveness of the xen-acpi-processor driver
Date: Thu, 3 May 2012 13:02:50 -0400	[thread overview]
Message-ID: <4FA2BA3A.7070100@amd.com> (raw)
In-Reply-To: <20120503154620.GB3464@andromeda.dapyr.net>

On 05/03/2012 11:46 AM, Konrad Rzeszutek Wilk wrote:
> On Thu, May 03, 2012 at 04:47:46PM +0200, Stefan Bader wrote:
>> On 03.05.2012 14:58, Stefan Bader wrote:
>>
>>>>>>> So this shoudl solve the problem for the bootup processor.
>>>>>>>>
>>>>>>>> -boris
>>>>>>>>
>>>>>>>>
>>>>>>>>> +    };
>>>>>>>>> +    int ret = 0;
>>>>>>>>> +
>>>>>>>>> +    /* Shouldn't need this as APIC is turned off for PV, and we only
>>>>>>>>> +     * get called on the bootup processor. But just in case. */
>>>>>>>>> +    if (!xen_initial_domain() || smp_processor_id())
>>>>>>>>> +        return 0;
>>>>>>>>> +
>>>>>>>>> +    if (reg == APIC_LVR)
>>>>>>>>> +        return 0x10;
>>>>>>>>> +
>>>>>>>>> +    if (reg != APIC_ID)
>>>>>>>>> +        return 0;
>>>>>>>>> +
>>>>>>>>> +    ret = HYPERVISOR_dom0_op(&op);
>>>>>>>>> +    if (ret)
>>>>>>>>> +        return 0;
>>>>>>>>> +
>>>>>>>>> +    return op.u.pcpu_info.apic_id;


	return (op.u.pcpu_info.apic_id << 24);

indeed fixes the problem.

-boris


>>>>>>>>>    }
>>>>>>>>>
>>>>>>>>>    static void xen_apic_write(u32 reg, u32 val)
>>>
>>> I added debugging to all exit paths that could return 0 (which is what the
>>> boot_cpu_physical_apicid is set to with that patch. Which would only leave the
>>> case of the HV call returning the wrong value somehow...
>>>
>> Hmmm, so xen_apic_read is still correct...
>>
>> [    0.000000] ACPI: Local APIC address 0xfee00000
>> [    0.000000] xxx xen_apic_read(20)
>> [    0.000000] xxx xen_apic_read ->  10
>> [    0.000000] boot_cpu_physical_apicid = 0
>> [    0.000000] xxx xen_apic_read(30)
>> [    0.000000] +- apic version = 10
>>
>> there seems to be a slightly strange tweak (at least for me) in read_apic_id...
>>
>> static inline unsigned int read_apic_id(void)
>> {
>>          unsigned int reg;
>>
>>          reg = apic_read(APIC_ID); // calls apic->read(reg)
>>
>>          return apic->get_apic_id(reg);
>
> Duh!! Let me spin out a new patch that will do this.
>> }
>>
>>
>
>
>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel
>
>

  reply	other threads:[~2012-05-03 17:02 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-25 13:00 Workings/effectiveness of the xen-acpi-processor driver Stefan Bader
2012-04-26 15:50 ` Konrad Rzeszutek Wilk
2012-04-26 16:25   ` Stefan Bader
2012-04-26 17:04     ` Konrad Rzeszutek Wilk
2012-05-06 15:23       ` Pasi Kärkkäinen
2012-05-07 17:33         ` Konrad Rzeszutek Wilk
2012-05-07 17:44           ` Pasi Kärkkäinen
2012-05-01 20:02     ` Konrad Rzeszutek Wilk
2012-05-01 22:35       ` Boris Ostrovsky
2012-05-01 22:54         ` Konrad Rzeszutek Wilk
2012-05-02  0:47           ` Konrad Rzeszutek Wilk
2012-05-02  1:11             ` Boris Ostrovsky
2012-05-02  9:19               ` Jan Beulich
2012-05-02 14:56           ` Stefan Bader
2012-05-02  8:36         ` Stefan Bader
2012-05-02 15:01         ` Stefan Bader
2012-05-02 16:08           ` Konrad Rzeszutek Wilk
2012-05-02 17:06             ` Boris Ostrovsky
2012-05-02 17:14               ` Konrad Rzeszutek Wilk
2012-05-02 21:31                 ` Boris Ostrovsky
2012-05-02 21:41                   ` Konrad Rzeszutek Wilk
2012-05-02 22:09                     ` Boris Ostrovsky
2012-05-03  6:55                       ` Stefan Bader
2012-05-03 10:00                         ` Stefan Bader
2012-05-03 12:58                       ` Stefan Bader
2012-05-03 14:47                         ` Stefan Bader
2012-05-03 15:46                           ` Konrad Rzeszutek Wilk
2012-05-03 17:02                             ` Boris Ostrovsky [this message]
2012-05-03 17:08                             ` Konrad Rzeszutek Wilk
2012-05-04  8:00                               ` Stefan Bader
2012-05-03 16:14                       ` Konrad Rzeszutek Wilk
2012-05-02 21:29             ` Stefan Bader
2012-05-02  8:22       ` Stefan Bader

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=4FA2BA3A.7070100@amd.com \
    --to=boris.ostrovsky@amd.com \
    --cc=jbeulich@suse.com \
    --cc=konrad.wilk@oracle.com \
    --cc=konrad@darnok.org \
    --cc=stefan.bader@canonical.com \
    --cc=xen-devel@lists.xensource.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).