From patchwork Tue Sep 10 18:51:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 274031 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)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C6D4C2C010B for ; Wed, 11 Sep 2013 05:56:38 +1000 (EST) Received: from localhost ([::1]:59579 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJT8g-0004MV-0X for incoming@patchwork.ozlabs.org; Tue, 10 Sep 2013 14:58:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51794) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJT3B-0004iF-4y for qemu-devel@nongnu.org; Tue, 10 Sep 2013 14:52:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJT38-0005Lv-VD for qemu-devel@nongnu.org; Tue, 10 Sep 2013 14:52:32 -0400 Received: from 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa ([2001:8b0:1d0::1]:43707 helo=mnementh.archaic.org.uk) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJT38-00056X-GS for qemu-devel@nongnu.org; Tue, 10 Sep 2013 14:52:30 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1VJT30-000218-89; Tue, 10 Sep 2013 19:52:22 +0100 From: Peter Maydell To: Anthony Liguori Date: Tue, 10 Sep 2013 19:51:55 +0100 Message-Id: <1378839142-7726-2-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1378839142-7726-1-git-send-email-peter.maydell@linaro.org> References: <1378839142-7726-1-git-send-email-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Cc: qemu-devel@nongnu.org Subject: [Qemu-devel] [PULL 01/28] target-arm: Make '-cpu any' available in linux-user mode only X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Make the 'any' CPU for target-arm available only in linux-user mode. The ARM target provides a CPU named "any", which turns on support for all user-level instruction set extensions we know about. This is intended for linux-user emulation mode, where it is the default CPU type. It makes no sense to try to use this for system emulation, since we don't initialize it with any system-level information like feature register values or implementation specific cp15 registers. (Unsurprisingly, some boards won't boot at all, though you might get lucky in some cases where the guest doesn't happen to prod things that aren't there.) Prevent users from making this command line error by removing the CPU definition from the softmmu build. Signed-off-by: Peter Maydell Reviewed-by: Andreas Färber Message-id: 1378213995-12945-1-git-send-email-peter.maydell@linaro.org --- target-arm/cpu.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target-arm/cpu.c b/target-arm/cpu.c index b2556c6..827e28e 100644 --- a/target-arm/cpu.c +++ b/target-arm/cpu.c @@ -822,6 +822,7 @@ static void pxa270c5_initfn(Object *obj) cpu->reset_sctlr = 0x00000078; } +#ifdef CONFIG_USER_ONLY static void arm_any_initfn(Object *obj) { ARMCPU *cpu = ARM_CPU(obj); @@ -834,6 +835,7 @@ static void arm_any_initfn(Object *obj) set_feature(&cpu->env, ARM_FEATURE_V7MP); cpu->midr = 0xffffffff; } +#endif typedef struct ARMCPUInfo { const char *name; @@ -874,7 +876,9 @@ static const ARMCPUInfo arm_cpus[] = { { .name = "pxa270-b1", .initfn = pxa270b1_initfn }, { .name = "pxa270-c0", .initfn = pxa270c0_initfn }, { .name = "pxa270-c5", .initfn = pxa270c5_initfn }, +#ifdef CONFIG_USER_ONLY { .name = "any", .initfn = arm_any_initfn }, +#endif }; static void arm_cpu_class_init(ObjectClass *oc, void *data)