From: Keir Fraser <keir.xen@gmail.com>
To: Juergen Gross <juergen.gross@ts.fujitsu.com>,
xen-devel@lists.xensource.com
Subject: Re: [PATCH] Allow wake up of offline vcpu via nmi-ipi
Date: Wed, 18 Jan 2012 09:36:13 +0000 [thread overview]
Message-ID: <CB3C430D.29008%keir.xen@gmail.com> (raw)
In-Reply-To: <CB3C41F0.28FFA%keir.xen@gmail.com>
On 18/01/2012 09:31, "Keir Fraser" <keir.xen@gmail.com> wrote:
> On 18/01/2012 09:07, "Juergen Gross" <juergen.gross@ts.fujitsu.com> wrote:
>
>> On 01/18/2012 09:48 AM, Juergen Gross wrote:
>>> On a real machine a cpu disabled via hlt with interrupts disabled can be
>>> reactivated via a nmi ipi. Enable the hypervisor to do this for hvm, too.
>>>
>>> Signed-off-by: juergen.gross@ts.fujitsu.com
>>>
>>>
>>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>> xen/arch/x86/hvm/vlapic.c | 5 ++++-
>>
>> BTW: I was not able to reactivate a vcpu via INIT/SIPI/SIPI sequence. It
>> works
>> on initial system boot when the target vcpu is activated the first time. If I
>> deactivate a vcpu and try to activate it again it will start to run, but it
>> is
>> not starting at the specified entry point (at least it isn't performing the
>> first instruction there).
>> Is there some special initialization needed to make this work? Do I have to
>> reset
>> something on the vcpu before deactivating it?
>
> No it should just work. Hvmloader wakes and then sleeps every AP, in
> hvmloader/smp.c. So even the first INIT-SIPI wakeup of an AP in the guest OS
> is not the first, as hvmloader already did it once! So this path should be
> working and indeed tested on every HVM guest boot.
Bit more info: INIT-SIPI logic is complicated by needing to avoid deadlocks
between two VCPUs attempting to pause and reset each other. But the core
dispatch logic is in vlapic_init_sipi_action(). You will see that on INIT,
we should call vcpu_reset() which will de-initialise and VCPU_down the vcpu.
And then on SIPI we call hvm_vcpu_reset_state(), which should reinitialise
and wake the vcpu to start running at the specified CS:IP.
So the above will be good places for you to add tracing and work out what's
going on. :-)
-- Keir
> -- Keir
>
>>
>> Juergen
>
>
next prev parent reply other threads:[~2012-01-18 9:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-18 8:48 [PATCH] Allow wake up of offline vcpu via nmi-ipi Juergen Gross
2012-01-18 9:07 ` Juergen Gross
2012-01-18 9:31 ` Keir Fraser
2012-01-18 9:36 ` Keir Fraser [this message]
2012-01-18 10:39 ` Juergen Gross
2012-01-18 9:29 ` Keir Fraser
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=CB3C430D.29008%keir.xen@gmail.com \
--to=keir.xen@gmail.com \
--cc=juergen.gross@ts.fujitsu.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 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.