public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* PPC: RFC: proposal for VM reset & shutdown hcall (v4)
@ 2013-07-03 19:29 Yoder Stuart-B08248
  2013-07-03 19:32 ` Alexander Graf
  0 siblings, 1 reply; 5+ messages in thread
From: Yoder Stuart-B08248 @ 2013-07-03 19:29 UTC (permalink / raw)
  To: Bhushan Bharat-R65777, Alexander Graf, Wood Scott-B07421,
	kvm@vger.kernel.org list, kvm-ppc@vger.kernel.org

Version 4 changes
   -clarified that KVM zeros the upper half of the struct fields
    if the VM is not in 64-bit mode

------------------------------------------------------------------------
KVM_CAP_EXIT_EPAPR_HCALL  Capability

A new capability KVM_CAP_EXIT_EPAPR_HCALL is defined to advertise
the new KVM_EXIT_EPAPR_HCALL exit .

------------------------------------------------------------------------
KVM_EXIT_EPAPR_HCALL exit definition

                /* KVM_EXIT_EPAPR_HCALL */
                struct {
                        __u64 nr;
                        __u64 ret;
                        __u64 args[8];
                } epapr_hcall;

This is used on Power/PowerPC platforms that support ePAPR hcalls.
It occurs when a guest does a hypercall (as defined
in the ePAPR 1.1) and the hcall is not handled by the kernel.

The 'nr' field contains the hypercall number (from the guest R11),
and 'args' contains the arguments (from the guest R3 - R10).
Userspace should put the return code in 'ret' and any extra returned
values in args[].  If the VM is not in 64-bit mode KVM zeros
the upper half of each field in the struct.

As per the ePAPR hcall ABI, the return value is returned to
the guest in R3 and output return values in R4 - R10.

------------------------------------------------------------------------
Advertising reset and shutdown in device tree.

A virtual machine can detect the availability of the reset 
and shutdown hcalls by looking at properties on the /hypervisor
node in the device tree passed to the VM.

    Property name: kvm,has-reset
    Value type: <none>
    Definition:  If the property is present the hypervisor supports
                 the KVM_HC_VM_RESET hcall.

    Property name: kvm,has-shutdown
    Value type: <none>
    Definition:  If the property is present the hypervisor supports
                 the KVM_HC_VM_SHUTDOWN hcall.

------------------------------------------------------------------------
Hypercall: KVM_HC_VM_RESET
Description:  Requests that the virtual machine be reset.  The
              hcall takes no arguments. If successful the hcall does not
              return.

Arguments:
     r11    hcall-token   KVM_HC_VM_RESET

Return values
     r3     status        Status of the hcall.  If the hcall succeeds
                          it does not return.  If an error occurs
                          EV_INTERNAL is returned.

------------------------------------------------------------------------
Hypercall: KVM_HC_VM_SHUTDOWN
Description:  Requests that the virtual machine be powered-off/halted.
              The hcall takes no arguments. If successful the hcall does not
              return.

Arguments:
     r11    hcall-token   KVM_HC_VM_SHUTDOWN

Return values
     r3     status        Status of the hcall.  If the hcall succeeds
                          it does not return.  If an error occurs
                          EV_INTERNAL is returned.


Regards,
Stuart

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PPC: RFC: proposal for VM reset & shutdown hcall (v4)
  2013-07-03 19:29 PPC: RFC: proposal for VM reset & shutdown hcall (v4) Yoder Stuart-B08248
@ 2013-07-03 19:32 ` Alexander Graf
  2013-07-03 19:40   ` Scott Wood
  2013-07-03 20:16   ` Yoder Stuart-B08248
  0 siblings, 2 replies; 5+ messages in thread
From: Alexander Graf @ 2013-07-03 19:32 UTC (permalink / raw)
  To: Yoder Stuart-B08248
  Cc: Bhushan Bharat-R65777, Wood Scott-B07421,
	kvm@vger.kernel.org list, kvm-ppc@vger.kernel.org


On 03.07.2013, at 21:29, Yoder Stuart-B08248 wrote:

> Version 4 changes
>   -clarified that KVM zeros the upper half of the struct fields
>    if the VM is not in 64-bit mode
> 
> ------------------------------------------------------------------------
> KVM_CAP_EXIT_EPAPR_HCALL  Capability
> 
> A new capability KVM_CAP_EXIT_EPAPR_HCALL is defined to advertise
> the new KVM_EXIT_EPAPR_HCALL exit .
> 
> ------------------------------------------------------------------------
> KVM_EXIT_EPAPR_HCALL exit definition
> 
>                /* KVM_EXIT_EPAPR_HCALL */
>                struct {
>                        __u64 nr;
>                        __u64 ret;
>                        __u64 args[8];
>                } epapr_hcall;
> 
> This is used on Power/PowerPC platforms that support ePAPR hcalls.

This still says Power :(. It's either POWER or PowerPC. There is no "Power" platform :). As mentioned before, I think "PowerPC" is good enough to cover everything.

The rest looks great.


Alex

> It occurs when a guest does a hypercall (as defined
> in the ePAPR 1.1) and the hcall is not handled by the kernel.
> 
> The 'nr' field contains the hypercall number (from the guest R11),
> and 'args' contains the arguments (from the guest R3 - R10).
> Userspace should put the return code in 'ret' and any extra returned
> values in args[].  If the VM is not in 64-bit mode KVM zeros
> the upper half of each field in the struct.
> 
> As per the ePAPR hcall ABI, the return value is returned to
> the guest in R3 and output return values in R4 - R10.
> 
> ------------------------------------------------------------------------
> Advertising reset and shutdown in device tree.
> 
> A virtual machine can detect the availability of the reset 
> and shutdown hcalls by looking at properties on the /hypervisor
> node in the device tree passed to the VM.
> 
>    Property name: kvm,has-reset
>    Value type: <none>
>    Definition:  If the property is present the hypervisor supports
>                 the KVM_HC_VM_RESET hcall.
> 
>    Property name: kvm,has-shutdown
>    Value type: <none>
>    Definition:  If the property is present the hypervisor supports
>                 the KVM_HC_VM_SHUTDOWN hcall.
> 
> ------------------------------------------------------------------------
> Hypercall: KVM_HC_VM_RESET
> Description:  Requests that the virtual machine be reset.  The
>              hcall takes no arguments. If successful the hcall does not
>              return.
> 
> Arguments:
>     r11    hcall-token   KVM_HC_VM_RESET
> 
> Return values
>     r3     status        Status of the hcall.  If the hcall succeeds
>                          it does not return.  If an error occurs
>                          EV_INTERNAL is returned.
> 
> ------------------------------------------------------------------------
> Hypercall: KVM_HC_VM_SHUTDOWN
> Description:  Requests that the virtual machine be powered-off/halted.
>              The hcall takes no arguments. If successful the hcall does not
>              return.
> 
> Arguments:
>     r11    hcall-token   KVM_HC_VM_SHUTDOWN
> 
> Return values
>     r3     status        Status of the hcall.  If the hcall succeeds
>                          it does not return.  If an error occurs
>                          EV_INTERNAL is returned.
> 
> 
> Regards,
> Stuart
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PPC: RFC: proposal for VM reset & shutdown hcall (v4)
  2013-07-03 19:32 ` Alexander Graf
@ 2013-07-03 19:40   ` Scott Wood
  2013-07-03 20:16   ` Yoder Stuart-B08248
  1 sibling, 0 replies; 5+ messages in thread
From: Scott Wood @ 2013-07-03 19:40 UTC (permalink / raw)
  To: Alexander Graf
  Cc: Yoder Stuart-B08248, Bhushan Bharat-R65777, Wood Scott-B07421,
	kvm@vger.kernel.org list, kvm-ppc@vger.kernel.org

On 07/03/2013 02:32:07 PM, Alexander Graf wrote:
> 
> On 03.07.2013, at 21:29, Yoder Stuart-B08248 wrote:
> 
> > Version 4 changes
> >   -clarified that KVM zeros the upper half of the struct fields
> >    if the VM is not in 64-bit mode
> >
> >  
> ------------------------------------------------------------------------
> > KVM_CAP_EXIT_EPAPR_HCALL  Capability
> >
> > A new capability KVM_CAP_EXIT_EPAPR_HCALL is defined to advertise
> > the new KVM_EXIT_EPAPR_HCALL exit .
> >
> >  
> ------------------------------------------------------------------------
> > KVM_EXIT_EPAPR_HCALL exit definition
> >
> >                /* KVM_EXIT_EPAPR_HCALL */
> >                struct {
> >                        __u64 nr;
> >                        __u64 ret;
> >                        __u64 args[8];
> >                } epapr_hcall;
> >
> > This is used on Power/PowerPC platforms that support ePAPR hcalls.
> 
> This still says Power :(. It's either POWER or PowerPC. There is no  
> "Power" platform :). As mentioned before, I think "PowerPC" is good  
> enough to cover everything.

Tell that to power.org. :-)

That said, in the context of Linux, we still call it powerpc.

-Scott

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: PPC: RFC: proposal for VM reset & shutdown hcall (v4)
  2013-07-03 19:32 ` Alexander Graf
  2013-07-03 19:40   ` Scott Wood
@ 2013-07-03 20:16   ` Yoder Stuart-B08248
  2013-07-03 21:41     ` Alexander Graf
  1 sibling, 1 reply; 5+ messages in thread
From: Yoder Stuart-B08248 @ 2013-07-03 20:16 UTC (permalink / raw)
  To: Alexander Graf
  Cc: Bhushan Bharat-R65777, Wood Scott-B07421,
	kvm@vger.kernel.org list, kvm-ppc@vger.kernel.org



> -----Original Message-----
> From: Alexander Graf [mailto:agraf@suse.de]
> Sent: Wednesday, July 03, 2013 2:32 PM
> To: Yoder Stuart-B08248
> Cc: Bhushan Bharat-R65777; Wood Scott-B07421; kvm@vger.kernel.org list; kvm-ppc@vger.kernel.org
> Subject: Re: PPC: RFC: proposal for VM reset & shutdown hcall (v4)
> 
> 
> On 03.07.2013, at 21:29, Yoder Stuart-B08248 wrote:
> 
> > Version 4 changes
> >   -clarified that KVM zeros the upper half of the struct fields
> >    if the VM is not in 64-bit mode
> >
> > ------------------------------------------------------------------------
> > KVM_CAP_EXIT_EPAPR_HCALL  Capability
> >
> > A new capability KVM_CAP_EXIT_EPAPR_HCALL is defined to advertise
> > the new KVM_EXIT_EPAPR_HCALL exit .
> >
> > ------------------------------------------------------------------------
> > KVM_EXIT_EPAPR_HCALL exit definition
> >
> >                /* KVM_EXIT_EPAPR_HCALL */
> >                struct {
> >                        __u64 nr;
> >                        __u64 ret;
> >                        __u64 args[8];
> >                } epapr_hcall;
> >
> > This is used on Power/PowerPC platforms that support ePAPR hcalls.
> 
> This still says Power :(. It's either POWER or PowerPC. There is no "Power" platform :). As mentioned
> before, I think "PowerPC" is good enough to cover everything.

I'll ask Bharat to change it to just PowerPC.

Stuart

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PPC: RFC: proposal for VM reset & shutdown hcall (v4)
  2013-07-03 20:16   ` Yoder Stuart-B08248
@ 2013-07-03 21:41     ` Alexander Graf
  0 siblings, 0 replies; 5+ messages in thread
From: Alexander Graf @ 2013-07-03 21:41 UTC (permalink / raw)
  To: Yoder Stuart-B08248
  Cc: Bhushan Bharat-R65777, Wood Scott-B07421,
	kvm@vger.kernel.org list, kvm-ppc@vger.kernel.org


On 03.07.2013, at 22:16, Yoder Stuart-B08248 wrote:

> 
> 
>> -----Original Message-----
>> From: Alexander Graf [mailto:agraf@suse.de]
>> Sent: Wednesday, July 03, 2013 2:32 PM
>> To: Yoder Stuart-B08248
>> Cc: Bhushan Bharat-R65777; Wood Scott-B07421; kvm@vger.kernel.org list; kvm-ppc@vger.kernel.org
>> Subject: Re: PPC: RFC: proposal for VM reset & shutdown hcall (v4)
>> 
>> 
>> On 03.07.2013, at 21:29, Yoder Stuart-B08248 wrote:
>> 
>>> Version 4 changes
>>>  -clarified that KVM zeros the upper half of the struct fields
>>>   if the VM is not in 64-bit mode
>>> 
>>> ------------------------------------------------------------------------
>>> KVM_CAP_EXIT_EPAPR_HCALL  Capability
>>> 
>>> A new capability KVM_CAP_EXIT_EPAPR_HCALL is defined to advertise
>>> the new KVM_EXIT_EPAPR_HCALL exit .
>>> 
>>> ------------------------------------------------------------------------
>>> KVM_EXIT_EPAPR_HCALL exit definition
>>> 
>>>               /* KVM_EXIT_EPAPR_HCALL */
>>>               struct {
>>>                       __u64 nr;
>>>                       __u64 ret;
>>>                       __u64 args[8];
>>>               } epapr_hcall;
>>> 
>>> This is used on Power/PowerPC platforms that support ePAPR hcalls.
>> 
>> This still says Power :(. It's either POWER or PowerPC. There is no "Power" platform :). As mentioned
>> before, I think "PowerPC" is good enough to cover everything.
> 
> I'll ask Bharat to change it to just PowerPC.

Yup, works for me. Thanks a lot :)


Alex

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-07-03 21:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-03 19:29 PPC: RFC: proposal for VM reset & shutdown hcall (v4) Yoder Stuart-B08248
2013-07-03 19:32 ` Alexander Graf
2013-07-03 19:40   ` Scott Wood
2013-07-03 20:16   ` Yoder Stuart-B08248
2013-07-03 21:41     ` Alexander Graf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox