public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Avi Kivity <avi@qumranet.com>
Cc: kvm <kvm@vger.kernel.org>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	Carsten Otte <cotte@de.ibm.com>, Olaf Schnapper <os@de.ibm.com>
Subject: [PATCH] kvm-s390: Fix facility bits for guest
Date: Wed, 30 Jul 2008 14:51:02 +0200	[thread overview]
Message-ID: <200807301451.03085.borntraeger@de.ibm.com> (raw)
In-Reply-To: <200807292348.42820.borntraeger@de.ibm.com>

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));



           reply	other threads:[~2008-07-30 12:52 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <200807292348.42820.borntraeger@de.ibm.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200807301451.03085.borntraeger@de.ibm.com \
    --to=borntraeger@de.ibm.com \
    --cc=avi@qumranet.com \
    --cc=cotte@de.ibm.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=os@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox