Re: [PATCH 10/18] KVM/MIPS32-VZ: Add API for VZ-ASE Capability

2013-05-30 Thread David Daney

On 05/28/2013 09:34 AM, Paolo Bonzini wrote:

Il 19/05/2013 07:47, Sanjay Lal ha scritto:

- Add API to allow clients (QEMU etc.) to check whether the H/W
   supports the MIPS VZ-ASE.


Why does this matter to userspace?  Do the userspace have some way to
detect if the kernel is unmodified or minimally-modified?



There are (will be) two types of VM presented by MIPS KVM:

1) That provided by the initial patch where a faux-MIPS is emulated and 
all kernel code must be in the USEG address space.


2) Real MIPS, addressing works as per the architecture specification.

Presumably the user-space client would like to know which of these are 
supported, as well as be able to select the desired model.


I don't know the best way to do this, but I agree that 
KVM_CAP_MIPS_VZ_ASE is probably not the best name for it.


My idea was to have the arg of the KVM_CREATE_VM ioctl specify the 
desired style


David Daney




Paolo


Signed-off-by: Sanjay Lal sanj...@kymasys.com
---
  include/uapi/linux/kvm.h | 1 +
  1 file changed, 1 insertion(+)

diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
index a5c86fc..5889e976 100644
--- a/include/uapi/linux/kvm.h
+++ b/include/uapi/linux/kvm.h
@@ -666,6 +666,7 @@ struct kvm_ppc_smmu_info {
  #define KVM_CAP_IRQ_MPIC 90
  #define KVM_CAP_PPC_RTAS 91
  #define KVM_CAP_IRQ_XICS 92
+#define KVM_CAP_MIPS_VZ_ASE 93

  #ifdef KVM_CAP_IRQ_ROUTING




--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html




--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 10/18] KVM/MIPS32-VZ: Add API for VZ-ASE Capability

2013-05-30 Thread Paolo Bonzini
Il 30/05/2013 19:07, David Daney ha scritto:
 On 05/28/2013 09:34 AM, Paolo Bonzini wrote:
 Il 19/05/2013 07:47, Sanjay Lal ha scritto:
 - Add API to allow clients (QEMU etc.) to check whether the H/W
supports the MIPS VZ-ASE.

 Why does this matter to userspace?  Do the userspace have some way to
 detect if the kernel is unmodified or minimally-modified?

 
 There are (will be) two types of VM presented by MIPS KVM:
 
 1) That provided by the initial patch where a faux-MIPS is emulated and
 all kernel code must be in the USEG address space.
 
 2) Real MIPS, addressing works as per the architecture specification.
 
 Presumably the user-space client would like to know which of these are
 supported, as well as be able to select the desired model.

Understood.  It's really two different machine types.

 I don't know the best way to do this, but I agree that
 KVM_CAP_MIPS_VZ_ASE is probably not the best name for it.
 
 My idea was to have the arg of the KVM_CREATE_VM ioctl specify the
 desired style

Ok.  How complex is it?  Do you plan to do this when the patches are
really ready for Linus' tree?

Paolo
--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 10/18] KVM/MIPS32-VZ: Add API for VZ-ASE Capability

2013-05-30 Thread Sanjay Lal

On May 30, 2013, at 10:07 AM, David Daney wrote:

 On 05/28/2013 09:34 AM, Paolo Bonzini wrote:
 Il 19/05/2013 07:47, Sanjay Lal ha scritto:
 - Add API to allow clients (QEMU etc.) to check whether the H/W
   supports the MIPS VZ-ASE.
 
 Why does this matter to userspace?  Do the userspace have some way to
 detect if the kernel is unmodified or minimally-modified?
 
 
 There are (will be) two types of VM presented by MIPS KVM:
 
 1) That provided by the initial patch where a faux-MIPS is emulated and all 
 kernel code must be in the USEG address space.
 
 2) Real MIPS, addressing works as per the architecture specification.
 
 Presumably the user-space client would like to know which of these are 
 supported, as well as be able to select the desired model.
 
 I don't know the best way to do this, but I agree that KVM_CAP_MIPS_VZ_ASE is 
 probably not the best name for it.
 
 My idea was to have the arg of the KVM_CREATE_VM ioctl specify the desired 
 style
 
 David Daney
 
 


Hi Paolo, just wanted to add to David's comments.  KVM/MIPS currently supports 
the two modes David mentioned, based on a kernel config option.   
KVM_CAP_MIPS_VZ_ASE is used by QEMU to make sure that the kvm module currently 
loaded supports the H/W virtualization.

Its a bit cumbersome on MIPS, because you really can't fall back to trap and 
emulate, since the guest kernel for trap and emulate has a user mode link 
address.

I am open to other ways of doing this.

Regards
Sanjay

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 10/18] KVM/MIPS32-VZ: Add API for VZ-ASE Capability

2013-05-30 Thread David Daney

On 05/30/2013 10:51 AM, Paolo Bonzini wrote:

Il 30/05/2013 19:07, David Daney ha scritto:

On 05/28/2013 09:34 AM, Paolo Bonzini wrote:

Il 19/05/2013 07:47, Sanjay Lal ha scritto:

- Add API to allow clients (QEMU etc.) to check whether the H/W
supports the MIPS VZ-ASE.


Why does this matter to userspace?  Do the userspace have some way to
detect if the kernel is unmodified or minimally-modified?



There are (will be) two types of VM presented by MIPS KVM:

1) That provided by the initial patch where a faux-MIPS is emulated and
all kernel code must be in the USEG address space.

2) Real MIPS, addressing works as per the architecture specification.

Presumably the user-space client would like to know which of these are
supported, as well as be able to select the desired model.


Understood.  It's really two different machine types.


I don't know the best way to do this, but I agree that
KVM_CAP_MIPS_VZ_ASE is probably not the best name for it.

My idea was to have the arg of the KVM_CREATE_VM ioctl specify the
desired style


Ok.  How complex is it?  Do you plan to do this when the patches are
really ready for Linus' tree?


I am currently working on preparing a patch set that implements MIPS-VZ 
in a slightly different manner than Sanjay's patches.  So there will 
likely be some back and forth getting everything properly integrated 
into a sane implementation


So I don't know exactly how to answer this question other than to say, 
that I don't think things should go into Linus's tree until they are 
really ready, which would include resolving this issue.


David Daney


--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 10/18] KVM/MIPS32-VZ: Add API for VZ-ASE Capability

2013-05-28 Thread Paolo Bonzini
Il 19/05/2013 07:47, Sanjay Lal ha scritto:
 - Add API to allow clients (QEMU etc.) to check whether the H/W
   supports the MIPS VZ-ASE.

Why does this matter to userspace?  Do the userspace have some way to
detect if the kernel is unmodified or minimally-modified?

Paolo

 Signed-off-by: Sanjay Lal sanj...@kymasys.com
 ---
  include/uapi/linux/kvm.h | 1 +
  1 file changed, 1 insertion(+)
 
 diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
 index a5c86fc..5889e976 100644
 --- a/include/uapi/linux/kvm.h
 +++ b/include/uapi/linux/kvm.h
 @@ -666,6 +666,7 @@ struct kvm_ppc_smmu_info {
  #define KVM_CAP_IRQ_MPIC 90
  #define KVM_CAP_PPC_RTAS 91
  #define KVM_CAP_IRQ_XICS 92
 +#define KVM_CAP_MIPS_VZ_ASE 93
  
  #ifdef KVM_CAP_IRQ_ROUTING
  
 

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 10/18] KVM/MIPS32-VZ: Add API for VZ-ASE Capability

2013-05-18 Thread Sanjay Lal
- Add API to allow clients (QEMU etc.) to check whether the H/W
  supports the MIPS VZ-ASE.

Signed-off-by: Sanjay Lal sanj...@kymasys.com
---
 include/uapi/linux/kvm.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
index a5c86fc..5889e976 100644
--- a/include/uapi/linux/kvm.h
+++ b/include/uapi/linux/kvm.h
@@ -666,6 +666,7 @@ struct kvm_ppc_smmu_info {
 #define KVM_CAP_IRQ_MPIC 90
 #define KVM_CAP_PPC_RTAS 91
 #define KVM_CAP_IRQ_XICS 92
+#define KVM_CAP_MIPS_VZ_ASE 93
 
 #ifdef KVM_CAP_IRQ_ROUTING
 
-- 
1.7.11.3

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html