From patchwork Wed Jul 13 09:10:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kurz X-Patchwork-Id: 647788 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rqCkp1NPyz9sxb for ; Wed, 13 Jul 2016 19:11:46 +1000 (AEST) Received: from localhost ([::1]:46099 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNGCm-0002Ro-3m for incoming@patchwork.ozlabs.org; Wed, 13 Jul 2016 05:11:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56694) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNGBd-0001e9-R1 for qemu-devel@nongnu.org; Wed, 13 Jul 2016 05:10:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bNGBY-0003s7-F9 for qemu-devel@nongnu.org; Wed, 13 Jul 2016 05:10:33 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:55345 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNGBY-0003rx-8B for qemu-devel@nongnu.org; Wed, 13 Jul 2016 05:10:28 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u6D99wPq116854 for ; Wed, 13 Jul 2016 05:10:28 -0400 Received: from e18.ny.us.ibm.com (e18.ny.us.ibm.com [129.33.205.208]) by mx0b-001b2d01.pphosted.com with ESMTP id 24566wvtq9-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 13 Jul 2016 05:10:27 -0400 Received: from localhost by e18.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 13 Jul 2016 05:10:27 -0400 Received: from d01dlp03.pok.ibm.com (9.56.250.168) by e18.ny.us.ibm.com (146.89.104.205) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 13 Jul 2016 05:10:24 -0400 X-IBM-Helo: d01dlp03.pok.ibm.com X-IBM-MailFrom: groug@kaod.org Received: from b01cxnp22035.gho.pok.ibm.com (b01cxnp22035.gho.pok.ibm.com [9.57.198.25]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id F034DC90045; Wed, 13 Jul 2016 05:10:13 -0400 (EDT) Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u6D9AG9K58589390; Wed, 13 Jul 2016 09:10:23 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A7A78AC040; Wed, 13 Jul 2016 05:10:23 -0400 (EDT) Received: from bahia.lan (unknown [9.164.146.113]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP id F25F7AC041; Wed, 13 Jul 2016 05:10:22 -0400 (EDT) From: Greg Kurz To: David Gibson Date: Wed, 13 Jul 2016 11:10:21 +0200 User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16071309-0044-0000-0000-000000A3CC68 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16071309-0045-0000-0000-000004B9EA7F Message-Id: <146840102187.900.13546085522655887765.stgit@bahia.lan> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-07-13_03:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=2 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1607130103 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH] ppc: exit if compat mode is unknown X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Bharata B Rao Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Now that properties are set with -global, if we pass a bogus value for compat mode, a warning is printed and the property is simply ignored. For example, if the host is POWER8 and we pass compat=POWER7 instead of compat=power7 the guest will see a POWER8 cpu. While here, this patch also changes the error message to be more explicit. Signed-off-by: Greg Kurz --- target-ppc/translate_init.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c index 8f257fb74aa7..55688db9c9db 100644 --- a/target-ppc/translate_init.c +++ b/target-ppc/translate_init.c @@ -8475,7 +8475,11 @@ static void powerpc_set_compat(Object *obj, Visitor *v, const char *name, } else if (strcmp(value, "power8") == 0) { *max_compat = CPU_POWERPC_LOGICAL_2_07; } else { - error_setg(errp, "Invalid compatibility mode \"%s\"", value); + /* This is called from -global, which does not exit on error. Since we + * don't want to start with a wrong compat mode, we exit now. + */ + error_report("PPC does not support compatibility mode \"%s\"", value); + exit(1); } g_free(value);