From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Borntraeger Subject: [PATCH] kvm-s390: Fix facility bits for guest Date: Wed, 30 Jul 2008 14:51:02 +0200 Message-ID: <200807301451.03085.borntraeger@de.ibm.com> References: <200807292348.42820.borntraeger@de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Cc: kvm , Heiko Carstens , Carsten Otte , Olaf Schnapper To: Avi Kivity Return-path: Received: from mtagate5.de.ibm.com ([195.212.29.154]:9488 "EHLO mtagate5.de.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753362AbYG3Mw0 (ORCPT ); Wed, 30 Jul 2008 08:52:26 -0400 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate5.de.ibm.com (8.13.8/8.13.8) with ESMTP id m6UCp4ZW474848 for ; Wed, 30 Jul 2008 12:51:04 GMT Received: from d12av03.megacenter.de.ibm.com (d12av03.megacenter.de.ibm.com [9.149.165.213]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v9.0) with ESMTP id m6UCp3tN3072240 for ; Wed, 30 Jul 2008 14:51:03 +0200 Received: from d12av03.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av03.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m6UCp3Gr012058 for ; Wed, 30 Jul 2008 14:51:03 +0200 In-Reply-To: <200807292348.42820.borntraeger@de.ibm.com> Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: 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 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 --- 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));