public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kvm-s390: Fix facility bits for guest
       [not found] <200807292348.42820.borntraeger@de.ibm.com>
@ 2008-07-30 12:51 ` Christian Borntraeger
  0 siblings, 0 replies; only message in thread
From: Christian Borntraeger @ 2008-07-30 12:51 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm, Heiko Carstens, Carsten Otte, Olaf Schnapper

Am Dienstag, 29. Juli 2008 schrieb Christian Borntraeger:

> @@ -158,6 +158,7 @@ static int handle_stfl(struct kvm_vcpu *
>  
>  	vcpu->stat.instruction_stfl++;
>  	facility_list &= ~(1UL<<24); /* no stfle */
> +	facility_list &= ~(1UL<<23); /* no large pages */
>  
>  	rc = copy_to_guest(vcpu, offsetof(struct _lowcore, stfl_fac_list),
>  			   &facility_list, sizeof(facility_list));


Hello Avi,

please dont apply this patch, there is a better one...

Heiko pointed out, that its generally safer to use an opt-in method instead
of killing problematic cases.

What about this updated patch:

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

Newer machine models can add new feature bits, which might require host 
changes. We have to ensure that we only advertise feature flags which we 
consider save. I disabled all unassigned feature flags, as well as stfle, 
large pages and some others.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 arch/s390/kvm/priv.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: kvm/arch/s390/kvm/priv.c
===================================================================
--- kvm.orig/arch/s390/kvm/priv.c
+++ kvm/arch/s390/kvm/priv.c
@@ -157,7 +157,8 @@ static int handle_stfl(struct kvm_vcpu *
 	int rc;
 
 	vcpu->stat.instruction_stfl++;
-	facility_list &= ~(1UL<<24); /* no stfle */
+	/* only pass the facility bits, which we can handle */
+	facility_list &= 0xfe00fff3;
 
 	rc = copy_to_guest(vcpu, offsetof(struct _lowcore, stfl_fac_list),
 			   &facility_list, sizeof(facility_list));



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-07-30 12:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <200807292348.42820.borntraeger@de.ibm.com>
2008-07-30 12:51 ` [PATCH] kvm-s390: Fix facility bits for guest Christian Borntraeger

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