linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joao Martins <joao.m.martins@oracle.com>
To: Jan Beulich <JBeulich@suse.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Juergen Gross <JGross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Ingo Molnar <mingo@redhat.com>,
	David Vrabel <david.vrabel@citrix.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	xen-devel@lists.xenproject.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>
Subject: Re: [Xen-devel] [PATCH linux 2/8] xen: introduce xen_vcpu_id mapping
Date: Thu, 7 Jul 2016 11:15:55 +0100	[thread overview]
Message-ID: <577E2BDB.7070902@oracle.com> (raw)
In-Reply-To: <577BF1FC02000078000FB51A@prv-mh.provo.novell.com>

On 07/05/2016 04:44 PM, Jan Beulich wrote:
>>>> On 05.07.16 at 17:34, <konrad.wilk@oracle.com> wrote:
>> On Thu, Jun 30, 2016 at 03:10:11AM -0600, Jan Beulich wrote:
>>>>>> On 29.06.16 at 18:27, <andrew.cooper3@citrix.com> wrote:
>>>> On 29/06/16 17:19, Vitaly Kuznetsov wrote:
>>>>> To explain better what I'm trying to suggest here please take a look at
>>>>> the attached patch. If we can guarantee long term that ACPI id always
>>>>> equals to Xen's idea of vCPU id this is probably the easiest way.
>>>>>
>>>>> -- Vitaly
>>>>
>>>> The code in hvmloader which sets up the MADT does:
>>>>
>>>>     for ( i = 0; i < hvm_info->nr_vcpus; i++ )
>>>>     {
>>>>         memset(lapic, 0, sizeof(*lapic));
>>>>         lapic->type    = ACPI_PROCESSOR_LOCAL_APIC;
>>>>         lapic->length  = sizeof(*lapic);
>>>>         /* Processor ID must match processor-object IDs in the DSDT. */
>>>>         lapic->acpi_processor_id = i;
>>>>         lapic->apic_id = LAPIC_ID(i);
>>>>         lapic->flags = (test_bit(i, hvm_info->vcpu_online)
>>>>                         ? ACPI_LOCAL_APIC_ENABLED : 0);
>>>>         lapic++;
>>>>     }
>>>>
>>>> So relying on the acpi_processor_id does look to be reliable.  That code
>>>> hasn't changed since 2007, and that was only a bugfix.  I would go so
>>>> far as to say it is reasonable for us to guarantee this in the guest ABI.
>>>
>>> In fact - is there any other way a guest could learn the vCPU IDs
>>> of its CPUs in a reliable way? I don't think so, and hence this de
>>> facto already is part of the ABI; we should of course spell it out
>>> somewhere.
>>
>> CCing Joao.
>>
>> Joao worked (and I think he posted an RFC patchset?) where this is changed so
>> that the true hardware topology (core, thread, etc) is exposed. This is obviously
>> for cases where you want pinning.
>>
>> I would hesistate to spell this out as an ABI..
> 
> Are you perhaps mixing up ACPI and APIC IDs? Here talk is of the
> former, while Joao's patch set was about the latter iirc.
> 
Correct, my patch series indeed changed APIC IDs. I guess making acpi_processor_id to
get vcpu_id reliably stated as guest ABI, is safe wrt to future arrangements to apic_ids.

Joao

  reply	other threads:[~2016-07-07 10:15 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-28 16:47 [PATCH linux 0/8] xen: pvhvm: support bootup on secondary vCPUs Vitaly Kuznetsov
2016-06-28 16:47 ` [PATCH linux 1/8] x86/xen: update cpuid.h from Xen-4.7 Vitaly Kuznetsov
2016-06-28 16:47 ` [PATCH linux 2/8] xen: introduce xen_vcpu_id mapping Vitaly Kuznetsov
2016-06-28 17:28   ` [Xen-devel] " Andrew Cooper
2016-06-29 12:16     ` Vitaly Kuznetsov
2016-06-29 12:30       ` Andrew Cooper
2016-06-29 12:50         ` Vitaly Kuznetsov
2016-06-29 16:19           ` Vitaly Kuznetsov
     [not found]             ` <5040c916-279f-c350-383a-583ec1700686@citrix.com>
2016-06-30  9:10               ` Jan Beulich
2016-07-01 12:06                 ` Vitaly Kuznetsov
2016-07-01 13:33                   ` Jan Beulich
2016-07-05 15:34                 ` Konrad Rzeszutek Wilk
2016-07-05 15:44                   ` Jan Beulich
2016-07-07 10:15                     ` Joao Martins [this message]
2016-06-28 16:47 ` [PATCH linux 3/8] x86/xen: use xen_vcpu_id mapping for HYPERVISOR_vcpu_op Vitaly Kuznetsov
2016-06-29 12:26   ` [Xen-devel] " David Vrabel
2016-06-28 16:47 ` [PATCH linux 4/8] x86/xen: use xen_vcpu_id mapping when pointing vcpu_info to the shared_info page Vitaly Kuznetsov
2016-06-29 12:32   ` [Xen-devel] " David Vrabel
2016-06-28 16:47 ` [PATCH linux 5/8] xen/events: use xen_vcpu_id mapping in events_base Vitaly Kuznetsov
2016-06-28 16:47 ` [PATCH linux 6/8] xen/events: fifo: use xen_vcpu_id mapping Vitaly Kuznetsov
2016-06-28 16:47 ` [PATCH linux 7/8] xen/evtchn: " Vitaly Kuznetsov
2016-06-28 16:47 ` [PATCH linux 8/8] xen/pvhvm: run xen_vcpu_setup() for the boot CPU Vitaly Kuznetsov
2016-06-28 17:32 ` [PATCH linux 0/8] xen: pvhvm: support bootup on secondary vCPUs David Vrabel
2016-06-29  9:16   ` Vitaly Kuznetsov
2016-06-29 12:36     ` David Vrabel
2016-07-01  9:24       ` Vitaly Kuznetsov

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=577E2BDB.7070902@oracle.com \
    --to=joao.m.martins@oracle.com \
    --cc=JBeulich@suse.com \
    --cc=JGross@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=david.vrabel@citrix.com \
    --cc=hpa@zytor.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=sstabellini@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=vkuznets@redhat.com \
    --cc=x86@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 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).