xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: xen-devel@lists.xenproject.org, Andrew Jones <drjones@redhat.com>,
	David Vrabel <david.vrabel@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [PATCH RFC 0/1] Introduce VCPUOP_reset_vcpu_info
Date: Wed, 06 Aug 2014 17:03:25 +0200	[thread overview]
Message-ID: <87a97h64oy.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <53E253470200007800029C1D@mail.emea.novell.com> (Jan Beulich's message of "Wed, 06 Aug 2014 15:09:43 +0100")

"Jan Beulich" <JBeulich@suse.com> writes:

>>>> On 06.08.14 at 15:08, <vkuznets@redhat.com> wrote:
>> --- a/arch/x86/xen/enlighten.c
>> +++ b/arch/x86/xen/enlighten.c
>> @@ -183,8 +183,6 @@ static void xen_vcpu_setup(int cpu)
>>          * This path is called twice on PVHVM - first during bootup via
>>          * smp_init -> xen_hvm_cpu_notify, and then if the VCPU is being
>>          * hotplugged: cpu_up -> xen_hvm_cpu_notify.
>> -        * As we can only do the VCPUOP_register_vcpu_info once lets
>> -        * not over-write its result.
>>          *
>>          * For PV it is called during restore (xen_vcpu_restore) and bootup
>>          * (xen_setup_vcpu_info_placement). The hotplug mechanism does not
>> @@ -207,14 +205,23 @@ static void xen_vcpu_setup(int cpu)
>>         info.mfn = arbitrary_virt_to_mfn(vcpup);
>>         info.offset = offset_in_page(vcpup);
>>  
>> +       /*
>> +        * Call VCPUOP_reset_vcpu_info before VCPUOP_register_vcpu_info, this
>> +        * is required if we boot after kexec.
>> +        */
>> +
>> +       if (cpu != 0) {
>> +               err = HYPERVISOR_vcpu_op(VCPUOP_reset_vcpu_info, cpu, NULL);
>> +               if (err)
>> +                       pr_warn("VCPUOP_reset_vcpu_info for CPU%d failed: %d\n",
>> +                               cpu, err);
>> +       }
>
> Just for my understanding of why exactly you need the new operation:
> Why is this being done here, when you already do the reset in the
> cpu-die/shutdown paths? 

We can avoid doing it here if we put VCPUOP_reset_vcpu_info to kdump
handler in addition to kexec path. 

> And why not for CPU 0?
>

Because the suggested op will fail for already running CPU0..

> Furthermore, what is the state of vCPU-s beyond 31 going to be after
> they got their vCPU info reset? They won't have any other area as
> fallback.

In xen their vcpu_info will point to dummy_vcpu_info (that's what we
have there before VCPUOP_register_vcpu_info I guess). I tested kexec
with 64 vcpus case, no issues noticed.

> Yet I don't think you can now and forever guarantee that
> native_cpu_die() won't do anything requiring that structure.

I agree with Konrad, we can exclude native_cpu_die() as it does
almost nothing (or call VCPUOP_reset_vcpu_info after it).

Thank you for your comments (especially for your other email), I'll try
addressing them.

-- 
  Vitaly

  parent reply	other threads:[~2014-08-06 15:03 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-06 13:08 [PATCH RFC 0/1] Introduce VCPUOP_reset_vcpu_info Vitaly Kuznetsov
2014-08-06 13:08 ` [PATCH RFC 1/1] " Vitaly Kuznetsov
2014-08-06 14:36   ` Jan Beulich
2014-08-06 14:09 ` [PATCH RFC 0/1] " Jan Beulich
2014-08-06 14:49   ` Konrad Rzeszutek Wilk
2014-08-06 14:54     ` Jan Beulich
2014-08-06 15:03       ` Konrad Rzeszutek Wilk
2014-08-06 14:51   ` Konrad Rzeszutek Wilk
2014-08-06 15:00     ` Jan Beulich
2014-08-06 15:02       ` Konrad Rzeszutek Wilk
2014-08-06 15:38         ` Jan Beulich
2014-08-06 15:03   ` Vitaly Kuznetsov [this message]
2014-08-06 15:43     ` Jan Beulich
2014-08-07 11:41       ` Vitaly Kuznetsov
2014-08-07 11:48         ` Jan Beulich
2014-08-07 11:54           ` 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=87a97h64oy.fsf@vitty.brq.redhat.com \
    --to=vkuznets@redhat.com \
    --cc=JBeulich@suse.com \
    --cc=david.vrabel@citrix.com \
    --cc=drjones@redhat.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --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).