From patchwork Thu Jan 22 09:27:38 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Borntraeger X-Patchwork-Id: 3546 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n0M9QJSX031303 for ; Thu, 22 Jan 2009 01:26:19 -0800 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757056AbZAVJab (ORCPT ); Thu, 22 Jan 2009 04:30:31 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757052AbZAVJab (ORCPT ); Thu, 22 Jan 2009 04:30:31 -0500 Received: from mtagate8.uk.ibm.com ([195.212.29.141]:65252 "EHLO mtagate8.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756644AbZAVJa2 (ORCPT ); Thu, 22 Jan 2009 04:30:28 -0500 Received: from d06nrmr1407.portsmouth.uk.ibm.com (d06nrmr1407.portsmouth.uk.ibm.com [9.149.38.185]) by mtagate8.uk.ibm.com (8.13.8/8.13.8) with ESMTP id n0M9Rhac572256 for ; Thu, 22 Jan 2009 09:27:43 GMT Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by d06nrmr1407.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id n0M9RgdU1609970 for ; Thu, 22 Jan 2009 09:27:42 GMT Received: from d06av03.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n0M9RftV005475 for ; Thu, 22 Jan 2009 09:27:42 GMT Received: from dyn-9-152-212-32.boeblingen.de.ibm.com (dyn-9-152-212-32.boeblingen.de.ibm.com [9.152.212.32]) by d06av03.portsmouth.uk.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n0M9RdSA005403 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 22 Jan 2009 09:27:41 GMT From: Christian Borntraeger To: Avi Kivity , kvm@vger.kernel.org Subject: [PATCH 1/3] kvm-s390: Fix printk on SIGP set arch Date: Thu, 22 Jan 2009 10:27:38 +0100 User-Agent: KMail/1.9.9 Cc: Christian Ehrhardt , Carsten Otte , Olaf Schnapper References: <200901221026.13261.borntraeger@de.ibm.com> In-Reply-To: <200901221026.13261.borntraeger@de.ibm.com> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200901221027.38992.borntraeger@de.ibm.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Christian Borntraeger KVM on s390 does not support the ESA/390 architecture. We refuse to change the architecture mode and print a warning. While testing a crashme for kvm, I spotted two problems with the printk: o A malicious can flood host dmesg o There was no newline at the end of the printk This patch fixes both problems. Signed-off-by: Christian Borntraeger --- arch/s390/kvm/sigp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: kvm/arch/s390/kvm/sigp.c =================================================================== --- kvm.orig/arch/s390/kvm/sigp.c +++ kvm/arch/s390/kvm/sigp.c @@ -153,8 +153,9 @@ static int __sigp_set_arch(struct kvm_vc switch (parameter & 0xff) { case 0: - printk(KERN_WARNING "kvm: request to switch to ESA/390 mode" - " not supported"); + if (printk_ratelimit()) + printk(KERN_WARNING "kvm: request to switch to ESA/390" + " mode not supported\n"); rc = 3; /* not operational */ break; case 1: