public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] kvm-s390: provide get/set_mp_state stubs to fix compile error
       [not found] <1208354539.6122.6.camel@cotte.boeblingen.de.ibm.com>
@ 2008-04-16 14:06 ` Carsten Otte
  2008-04-16 16:21   ` Hollis Blanchard
  2008-04-16 14:06 ` [PATCH 2/2] virtio-s390: Change virtio interrupt definitions to follow architecture Carsten Otte
  1 sibling, 1 reply; 8+ messages in thread
From: Carsten Otte @ 2008-04-16 14:06 UTC (permalink / raw)
  To: Avi Kivity
  Cc: kvm-devel@lists.sourceforge.net, schwidefsky, Olaf Schnapper,
	Heiko Carstens, Christian Borntraeger

From: Christian Borntraeger <borntraeger@de.ibm.com>

Since 

commit ded6fb24fb694bcc5f308a02ec504d45fbc8aaa6
Author: Marcelo Tosatti <mtosatti@redhat.com>
Date:   Fri Apr 11 13:24:45 2008 -0300
    KVM: add ioctls to save/store mpstate

kvm does not compile on s390. 
This patch provides ioctl stubs for s390 to make kvm.git compile again.
As migration is not yet supported, the ioctl definitions are empty.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Carsten Otte <cotte@de.ibm.com>
---
 arch/s390/kvm/kvm-s390.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)

Index: kvm/arch/s390/kvm/kvm-s390.c
===================================================================
--- kvm.orig/arch/s390/kvm/kvm-s390.c
+++ kvm/arch/s390/kvm/kvm-s390.c
@@ -414,6 +414,18 @@ int kvm_arch_vcpu_ioctl_debug_guest(stru
 	return -EINVAL; /* not implemented yet */
 }
 
+int kvm_arch_vcpu_ioctl_get_mpstate(struct kvm_vcpu *vcpu,
+				    struct kvm_mp_state *mp_state)
+{
+	return -EINVAL; /* not implemented yet */
+}
+
+int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu,
+				    struct kvm_mp_state *mp_state)
+{
+	return -EINVAL; /* not implemented yet */
+}
+
 static void __vcpu_run(struct kvm_vcpu *vcpu)
 {
 	memcpy(&vcpu->arch.sie_block->gg14, &vcpu->arch.guest_gprs[14], 16);



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

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

* [PATCH 2/2] virtio-s390: Change virtio interrupt definitions to follow architecture
       [not found] <1208354539.6122.6.camel@cotte.boeblingen.de.ibm.com>
  2008-04-16 14:06 ` [PATCH 1/2] kvm-s390: provide get/set_mp_state stubs to fix compile error Carsten Otte
@ 2008-04-16 14:06 ` Carsten Otte
  2008-04-17  8:44   ` Avi Kivity
  1 sibling, 1 reply; 8+ messages in thread
From: Carsten Otte @ 2008-04-16 14:06 UTC (permalink / raw)
  To: Avi Kivity
  Cc: kvm-devel@lists.sourceforge.net, schwidefsky, Olaf Schnapper,
	Heiko Carstens, Christian Borntraeger

From: Christian Borntraeger <borntraeger@de.ibm.com>

This patch changes the interrupt defintions for virtio on s390. We now use
the extint number 0x2603, which is used as a host interrupt already by z/VM
for pfault and dasd_diag.
We will use subcode 0x0D to distinguish virtio from dasd and pfault.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Carsten Otte <cotte@de.ibm.com>
---
 arch/s390/kvm/interrupt.c     |    6 +++++-
 drivers/s390/kvm/kvm_virtio.c |    8 +++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

Index: kvm/arch/s390/kvm/interrupt.c
===================================================================
--- kvm.orig/arch/s390/kvm/interrupt.c
+++ kvm/arch/s390/kvm/interrupt.c
@@ -162,7 +162,11 @@ static void __do_deliver_interrupt(struc
 		VCPU_EVENT(vcpu, 4, "interrupt: virtio parm:%x,parm64:%lx",
 			   inti->ext.ext_params, inti->ext.ext_params2);
 		vcpu->stat.deliver_virtio_interrupt++;
-		rc = put_guest_u16(vcpu, __LC_EXT_INT_CODE, 0x1237);
+		rc = put_guest_u16(vcpu, __LC_EXT_INT_CODE, 0x2603);
+		if (rc == -EFAULT)
+			exception = 1;
+
+		rc = put_guest_u16(vcpu, __LC_CPU_ADDRESS, 0x0d00);
 		if (rc == -EFAULT)
 			exception = 1;
 
Index: kvm/drivers/s390/kvm/kvm_virtio.c
===================================================================
--- kvm.orig/drivers/s390/kvm/kvm_virtio.c
+++ kvm/drivers/s390/kvm/kvm_virtio.c
@@ -23,6 +23,8 @@
 #include <asm/setup.h>
 #include <asm/s390_ext.h>
 
+#define VIRTIO_SUBCODE_64 0x0D00
+
 /*
  * The pointer to our (page) of device descriptions.
  */
@@ -291,6 +293,10 @@ static void scan_devices(void)
 static void kvm_extint_handler(u16 code)
 {
 	void *data = (void *) *(long *) __LC_PFAULT_INTPARM;
+	u16 subcode = S390_lowcore.cpu_addr;
+
+	if ((subcode & 0xff00) != VIRTIO_SUBCODE_64)
+		return;
 
 	vring_interrupt(0, data);
 }
@@ -319,8 +325,8 @@ static int __init kvm_devices_init(void)
 
 	kvm_devices  = (void *) (max_pfn << PAGE_SHIFT);
 
-	register_external_interrupt(0x1237, kvm_extint_handler);
 	ctl_set_bit(0, 9);
+	register_external_interrupt(0x2603, kvm_extint_handler);
 
 	scan_devices();
 	return 0;



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

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

* Re: [PATCH 1/2] kvm-s390: provide get/set_mp_state stubs to fix compile error
  2008-04-16 14:06 ` [PATCH 1/2] kvm-s390: provide get/set_mp_state stubs to fix compile error Carsten Otte
@ 2008-04-16 16:21   ` Hollis Blanchard
  2008-04-16 17:44     ` Marcelo Tosatti
  0 siblings, 1 reply; 8+ messages in thread
From: Hollis Blanchard @ 2008-04-16 16:21 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: kvm-devel, Carsten Otte, kvm-ia64-devel, Avi Kivity

By the way Marcelo, it would be polite to provide these stubs yourself to 
avoid breaking the build on other architectures.

It looks like IA64 is still broken because of this.

-- 
Hollis Blanchard
IBM Linux Technology Center

On Wednesday 16 April 2008 09:06:34 Carsten Otte wrote:
> From: Christian Borntraeger <borntraeger@de.ibm.com>
> 
> Since 
> 
> commit ded6fb24fb694bcc5f308a02ec504d45fbc8aaa6
> Author: Marcelo Tosatti <mtosatti@redhat.com>
> Date:   Fri Apr 11 13:24:45 2008 -0300
>     KVM: add ioctls to save/store mpstate
> 
> kvm does not compile on s390. 
> This patch provides ioctl stubs for s390 to make kvm.git compile again.
> As migration is not yet supported, the ioctl definitions are empty.
> 
> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
> Signed-off-by: Carsten Otte <cotte@de.ibm.com>
> ---
>  arch/s390/kvm/kvm-s390.c |   12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> Index: kvm/arch/s390/kvm/kvm-s390.c
> ===================================================================
> --- kvm.orig/arch/s390/kvm/kvm-s390.c
> +++ kvm/arch/s390/kvm/kvm-s390.c
> @@ -414,6 +414,18 @@ int kvm_arch_vcpu_ioctl_debug_guest(stru
>  	return -EINVAL; /* not implemented yet */
>  }
> 
> +int kvm_arch_vcpu_ioctl_get_mpstate(struct kvm_vcpu *vcpu,
> +				    struct kvm_mp_state *mp_state)
> +{
> +	return -EINVAL; /* not implemented yet */
> +}
> +
> +int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu,
> +				    struct kvm_mp_state *mp_state)
> +{
> +	return -EINVAL; /* not implemented yet */
> +}
> +
>  static void __vcpu_run(struct kvm_vcpu *vcpu)
>  {
>  	memcpy(&vcpu->arch.sie_block->gg14, &vcpu->arch.guest_gprs[14], 16);
> 
> 
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
> Don't miss this year's exciting event. There's still time to save $100. 
> Use priority code J8TL2D2. 
> 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
> kvm-devel mailing list
> kvm-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/kvm-devel
> 



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

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

* Re: [PATCH 1/2] kvm-s390: provide get/set_mp_state stubs to fix compile error
  2008-04-16 16:21   ` Hollis Blanchard
@ 2008-04-16 17:44     ` Marcelo Tosatti
  2008-04-17  8:18       ` Avi Kivity
  0 siblings, 1 reply; 8+ messages in thread
From: Marcelo Tosatti @ 2008-04-16 17:44 UTC (permalink / raw)
  To: Hollis Blanchard; +Cc: kvm-devel, Carsten Otte, kvm-ia64-devel, Avi Kivity

On Wed, Apr 16, 2008 at 11:21:05AM -0500, Hollis Blanchard wrote:
> By the way Marcelo, it would be polite to provide these stubs yourself to 
> avoid breaking the build on other architectures.

Indeed, should have been more careful.

> It looks like IA64 is still broken because of this.

Now I'm not sure if IA64 supports migration. Should it return -EINVAL or
the ia64 mpstate ?


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

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

* Re: [PATCH 1/2] kvm-s390: provide get/set_mp_state stubs to fix compile error
  2008-04-16 17:44     ` Marcelo Tosatti
@ 2008-04-17  8:18       ` Avi Kivity
  0 siblings, 0 replies; 8+ messages in thread
From: Avi Kivity @ 2008-04-17  8:18 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: kvm-devel, Carsten Otte, kvm-ia64-devel, Hollis Blanchard

Marcelo Tosatti wrote:
> On Wed, Apr 16, 2008 at 11:21:05AM -0500, Hollis Blanchard wrote:
>   
>> By the way Marcelo, it would be polite to provide these stubs yourself to 
>> avoid breaking the build on other architectures.
>>     
>
> Indeed, should have been more careful.
>
>   

And I should have caught this on my build machine.  I'll get this automated.

>> It looks like IA64 is still broken because of this.
>>     
>
> Now I'm not sure if IA64 supports migration. Should it return -EINVAL or
> the ia64 mpstate ?
>   

There is an mp_state in ia64's kvm_regs, so this is already taken care of.

-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

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

* Re: [PATCH 2/2] virtio-s390: Change virtio interrupt definitions to follow architecture
  2008-04-16 14:06 ` [PATCH 2/2] virtio-s390: Change virtio interrupt definitions to follow architecture Carsten Otte
@ 2008-04-17  8:44   ` Avi Kivity
  2008-04-17  9:14     ` Christian Borntraeger
  0 siblings, 1 reply; 8+ messages in thread
From: Avi Kivity @ 2008-04-17  8:44 UTC (permalink / raw)
  To: Carsten Otte
  Cc: kvm-devel@lists.sourceforge.net, schwidefsky, Olaf Schnapper,
	Heiko Carstens, Christian Borntraeger

Carsten Otte wrote:
> From: Christian Borntraeger <borntraeger@de.ibm.com>
>
> This patch changes the interrupt defintions for virtio on s390. We now use
> the extint number 0x2603, which is used as a host interrupt already by z/VM
> for pfault and dasd_diag.
> We will use subcode 0x0D to distinguish virtio from dasd and pfault.
>   

Don't you need to change KVM_S390_INT_VIRTIO as well?

-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

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

* Re: [PATCH 2/2] virtio-s390: Change virtio interrupt definitions to follow architecture
  2008-04-17  8:44   ` Avi Kivity
@ 2008-04-17  9:14     ` Christian Borntraeger
  2008-04-17  9:27       ` Avi Kivity
  0 siblings, 1 reply; 8+ messages in thread
From: Christian Borntraeger @ 2008-04-17  9:14 UTC (permalink / raw)
  To: kvm-devel
  Cc: schwidefsky, Carsten Otte, Olaf Schnapper, Heiko Carstens,
	Avi Kivity

Am Donnerstag, 17. April 2008 schrieb Avi Kivity:
> Don't you need to change KVM_S390_INT_VIRTIO as well?

Good catch.
It works without that change, but its cleaner to change that. We can also 
remove another fixme, as the host interrupt uses the same control register 
bit 9.

Can you merge this into the first patch?

Christian

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Acked-by: Carsten Otte <cotte@de.ibm.com>

---
 arch/s390/kvm/interrupt.c |    2 +-
 include/linux/kvm.h       |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Index: kvm/arch/s390/kvm/interrupt.c
===================================================================
--- kvm.orig/arch/s390/kvm/interrupt.c
+++ kvm/arch/s390/kvm/interrupt.c
@@ -50,7 +50,7 @@ static int __interrupt_is_deliverable(st
 		if (psw_extint_disabled(vcpu))
 			return 0;
 		if (vcpu->arch.sie_block->gcr[0] & 0x200ul)
-			return 1; /*FIXME virtio control register bit */
+			return 1;
 		return 0;
 	case KVM_S390_PROGRAM_INT:
 	case KVM_S390_SIGP_STOP:
Index: kvm/include/linux/kvm.h
===================================================================
--- kvm.orig/include/linux/kvm.h
+++ kvm/include/linux/kvm.h
@@ -250,7 +250,7 @@ struct kvm_s390_psw {
 #define KVM_S390_PROGRAM_INT		0xfffe0001u
 #define KVM_S390_SIGP_SET_PREFIX	0xfffe0002u
 #define KVM_S390_RESTART		0xfffe0003u
-#define KVM_S390_INT_VIRTIO		0xffff1237u /*FIXME arch number */
+#define KVM_S390_INT_VIRTIO		0xffff2603u
 #define KVM_S390_INT_SERVICE		0xffff2401u
 #define KVM_S390_INT_EMERGENCY		0xffff1201u
 


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

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

* Re: [PATCH 2/2] virtio-s390: Change virtio interrupt definitions to follow architecture
  2008-04-17  9:14     ` Christian Borntraeger
@ 2008-04-17  9:27       ` Avi Kivity
  0 siblings, 0 replies; 8+ messages in thread
From: Avi Kivity @ 2008-04-17  9:27 UTC (permalink / raw)
  To: Christian Borntraeger
  Cc: kvm-devel, Carsten Otte, Olaf Schnapper, Heiko Carstens,
	schwidefsky

Christian Borntraeger wrote:
> Am Donnerstag, 17. April 2008 schrieb Avi Kivity:
>   
>> Don't you need to change KVM_S390_INT_VIRTIO as well?
>>     
>
> Good catch.
> It works without that change, but its cleaner to change that. We can also 
> remove another fixme, as the host interrupt uses the same control register 
> bit 9.
>
> Can you merge this into the first patch?
>
>   

Sure thing, merged.

-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

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

end of thread, other threads:[~2008-04-17  9:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1208354539.6122.6.camel@cotte.boeblingen.de.ibm.com>
2008-04-16 14:06 ` [PATCH 1/2] kvm-s390: provide get/set_mp_state stubs to fix compile error Carsten Otte
2008-04-16 16:21   ` Hollis Blanchard
2008-04-16 17:44     ` Marcelo Tosatti
2008-04-17  8:18       ` Avi Kivity
2008-04-16 14:06 ` [PATCH 2/2] virtio-s390: Change virtio interrupt definitions to follow architecture Carsten Otte
2008-04-17  8:44   ` Avi Kivity
2008-04-17  9:14     ` Christian Borntraeger
2008-04-17  9:27       ` Avi Kivity

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