* Detecting PV drivers
@ 2013-04-04 16:30 Jon Ludlam
2013-04-04 17:00 ` Andrew Cooper
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Jon Ludlam @ 2013-04-04 16:30 UTC (permalink / raw)
To: xen-devel@lists.xen.org; +Cc: Paul.Durrant
Hi,
I'm trying find out the best way of detecting whether PV drivers have
loaded in an HVM guest. For example, this is so we can decide whether or
not to wait for a response from the guest when suspending.
I think the best way of doing this is to find out whether the hypercall
page has been populated or not, as this is the first thing that any PV
drivers will have to do, but I don't know how to detect this, or even if
this is possible - is there any way of finding this out?
At the moment we're currently thinking of looking at status of the
callback IRQ, which is the second thing that the Citrix PV drivers
currently do, but I'm not sure about any other drivers. Would this be a
reasonable thing to do if we can't detect the hypercall page?
Cheers,
Jon
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Detecting PV drivers
2013-04-04 16:30 Detecting PV drivers Jon Ludlam
@ 2013-04-04 17:00 ` Andrew Cooper
2013-04-05 8:53 ` Jan Beulich
2013-04-05 1:01 ` James Harper
2013-04-05 10:14 ` Stefano Stabellini
2 siblings, 1 reply; 7+ messages in thread
From: Andrew Cooper @ 2013-04-04 17:00 UTC (permalink / raw)
To: Jon Ludlam; +Cc: Paul Durrant, xen-devel@lists.xen.org
On 04/04/13 17:30, Jon Ludlam wrote:
> Hi,
>
> I'm trying find out the best way of detecting whether PV drivers have
> loaded in an HVM guest. For example, this is so we can decide whether or
> not to wait for a response from the guest when suspending.
>
> I think the best way of doing this is to find out whether the hypercall
> page has been populated or not, as this is the first thing that any PV
> drivers will have to do, but I don't know how to detect this, or even if
> this is possible - is there any way of finding this out?
Not currently as far as I can tell, but intercepting
hvm_hypercall_page_initialise() and setting a boolean in struct domain
would be easy.
The better question would be how to get this information out of Xen.
Given that the memory claim hypercall has already bumped the hypercall
interface version, would it be acceptable to have another change to
struct xen_domctl_getdomaininfo ?
~Andrew
>
> At the moment we're currently thinking of looking at status of the
> callback IRQ, which is the second thing that the Citrix PV drivers
> currently do, but I'm not sure about any other drivers. Would this be a
> reasonable thing to do if we can't detect the hypercall page?
>
> Cheers,
>
> Jon
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Detecting PV drivers
2013-04-04 16:30 Detecting PV drivers Jon Ludlam
2013-04-04 17:00 ` Andrew Cooper
@ 2013-04-05 1:01 ` James Harper
2013-04-05 10:14 ` Stefano Stabellini
2 siblings, 0 replies; 7+ messages in thread
From: James Harper @ 2013-04-05 1:01 UTC (permalink / raw)
To: Jon Ludlam, xen-devel@lists.xen.org; +Cc: Paul.Durrant@citrix.com
>
> Hi,
>
> I'm trying find out the best way of detecting whether PV drivers have
> loaded in an HVM guest. For example, this is so we can decide whether or
> not to wait for a response from the guest when suspending.
>
>From memory, 'xm shutdown' already checks to see if something in the domu can handle a shutdown, and writes to xenstore to trigger an orderly shutdown if it can, or otherwise just pulls the plug. Looking at how that works might be a good place to start.
James
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Detecting PV drivers
2013-04-04 17:00 ` Andrew Cooper
@ 2013-04-05 8:53 ` Jan Beulich
2013-04-05 9:01 ` Paul Durrant
0 siblings, 1 reply; 7+ messages in thread
From: Jan Beulich @ 2013-04-05 8:53 UTC (permalink / raw)
To: Andrew Cooper, Jon Ludlam; +Cc: Paul Durrant, xen-devel@lists.xen.org
>>> On 04.04.13 at 19:00, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
> On 04/04/13 17:30, Jon Ludlam wrote:
>> Hi,
>>
>> I'm trying find out the best way of detecting whether PV drivers have
>> loaded in an HVM guest. For example, this is so we can decide whether or
>> not to wait for a response from the guest when suspending.
>>
>> I think the best way of doing this is to find out whether the hypercall
>> page has been populated or not, as this is the first thing that any PV
>> drivers will have to do, but I don't know how to detect this, or even if
>> this is possible - is there any way of finding this out?
>
> Not currently as far as I can tell, but intercepting
> hvm_hypercall_page_initialise() and setting a boolean in struct domain
> would be easy.
But that doesn't in any way mean PV drivers are present. We have
a PV ticket lock implementation for HVM guests that necessarily also
sets up the hypercall page, yet this is in no way connected to the
presence of PV drivers.
> The better question would be how to get this information out of Xen.
And to me it's not obvious why looking at xenstore wouldn't be the
right thing - any frontend in connected state would indicate presence
of PV drivers, wouldn't it?
Jan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Detecting PV drivers
2013-04-05 8:53 ` Jan Beulich
@ 2013-04-05 9:01 ` Paul Durrant
0 siblings, 0 replies; 7+ messages in thread
From: Paul Durrant @ 2013-04-05 9:01 UTC (permalink / raw)
To: Jan Beulich, Andrew Cooper, Jonathan Ludlam; +Cc: xen-devel@lists.xen.org
> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: 05 April 2013 09:54
> To: Andrew Cooper; Jonathan Ludlam
> Cc: Paul Durrant; xen-devel@lists.xen.org
> Subject: Re: [Xen-devel] Detecting PV drivers
>
> >>> On 04.04.13 at 19:00, Andrew Cooper <andrew.cooper3@citrix.com>
> wrote:
> > On 04/04/13 17:30, Jon Ludlam wrote:
> >> Hi,
> >>
> >> I'm trying find out the best way of detecting whether PV drivers have
> >> loaded in an HVM guest. For example, this is so we can decide whether or
> >> not to wait for a response from the guest when suspending.
> >>
> >> I think the best way of doing this is to find out whether the hypercall
> >> page has been populated or not, as this is the first thing that any PV
> >> drivers will have to do, but I don't know how to detect this, or even if
> >> this is possible - is there any way of finding this out?
> >
> > Not currently as far as I can tell, but intercepting
> > hvm_hypercall_page_initialise() and setting a boolean in struct domain
> > would be easy.
>
> But that doesn't in any way mean PV drivers are present. We have
> a PV ticket lock implementation for HVM guests that necessarily also
> sets up the hypercall page, yet this is in no way connected to the
> presence of PV drivers.
>
> > The better question would be how to get this information out of Xen.
>
> And to me it's not obvious why looking at xenstore wouldn't be the
> right thing - any frontend in connected state would indicate presence
> of PV drivers, wouldn't it?
>
I think the concern is that that might be too late. To get something into xenstore the PV drivers clearly must have initialized the store ring. So, if tools were to wait for something in xenstore they may well suspend a guest that had mapped the store ring, sent a write request, and was waiting for a response from xenstore. If the xenstore had not yet serviced that request and responded then, when the guest was resumed, it would wait forever for a response that would never come.
Paul
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Detecting PV drivers
2013-04-04 16:30 Detecting PV drivers Jon Ludlam
2013-04-04 17:00 ` Andrew Cooper
2013-04-05 1:01 ` James Harper
@ 2013-04-05 10:14 ` Stefano Stabellini
2013-04-05 17:16 ` Jonathan Ludlam
2 siblings, 1 reply; 7+ messages in thread
From: Stefano Stabellini @ 2013-04-05 10:14 UTC (permalink / raw)
To: Jon Ludlam; +Cc: Paul Durrant, xen-devel@lists.xen.org
On Thu, 4 Apr 2013, Jon Ludlam wrote:
> Hi,
>
> I'm trying find out the best way of detecting whether PV drivers have
> loaded in an HVM guest. For example, this is so we can decide whether or
> not to wait for a response from the guest when suspending.
>
> I think the best way of doing this is to find out whether the hypercall
> page has been populated or not, as this is the first thing that any PV
> drivers will have to do, but I don't know how to detect this, or even if
> this is possible - is there any way of finding this out?
>
> At the moment we're currently thinking of looking at status of the
> callback IRQ, which is the second thing that the Citrix PV drivers
> currently do, but I'm not sure about any other drivers. Would this be a
> reasonable thing to do if we can't detect the hypercall page?
This is exactly what libxl does right now, see:
tools/libxl/libxl_dom.c:libxl__domain_suspend_common_callback
Libxl also checks the state of HVM_PARAM_ACPI_S_STATE.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Detecting PV drivers
2013-04-05 10:14 ` Stefano Stabellini
@ 2013-04-05 17:16 ` Jonathan Ludlam
0 siblings, 0 replies; 7+ messages in thread
From: Jonathan Ludlam @ 2013-04-05 17:16 UTC (permalink / raw)
To: Stefano Stabellini; +Cc: Paul Durrant, xen-devel@lists.xen.org
Excellent, in that case if we do this in the short term then we'll be consistent with the behaviour when we switch to using libxl later.
Should have looked there first, really. Apologies.
Jon
Sent from my iPad
On 5 Apr 2013, at 11:14, "Stefano Stabellini" <stefano.stabellini@eu.citrix.com> wrote:
> On Thu, 4 Apr 2013, Jon Ludlam wrote:
>> Hi,
>>
>> I'm trying find out the best way of detecting whether PV drivers have
>> loaded in an HVM guest. For example, this is so we can decide whether or
>> not to wait for a response from the guest when suspending.
>>
>> I think the best way of doing this is to find out whether the hypercall
>> page has been populated or not, as this is the first thing that any PV
>> drivers will have to do, but I don't know how to detect this, or even if
>> this is possible - is there any way of finding this out?
>>
>> At the moment we're currently thinking of looking at status of the
>> callback IRQ, which is the second thing that the Citrix PV drivers
>> currently do, but I'm not sure about any other drivers. Would this be a
>> reasonable thing to do if we can't detect the hypercall page?
>
> This is exactly what libxl does right now, see:
>
> tools/libxl/libxl_dom.c:libxl__domain_suspend_common_callback
>
> Libxl also checks the state of HVM_PARAM_ACPI_S_STATE.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-04-05 17:16 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-04 16:30 Detecting PV drivers Jon Ludlam
2013-04-04 17:00 ` Andrew Cooper
2013-04-05 8:53 ` Jan Beulich
2013-04-05 9:01 ` Paul Durrant
2013-04-05 1:01 ` James Harper
2013-04-05 10:14 ` Stefano Stabellini
2013-04-05 17:16 ` Jonathan Ludlam
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.