From patchwork Tue Sep 3 13:13:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 19710 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f199.google.com (mail-ye0-f199.google.com [209.85.213.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D9A1725DFC for ; Tue, 3 Sep 2013 13:13:18 +0000 (UTC) Received: by mail-ye0-f199.google.com with SMTP id l13sf6035506yen.2 for ; Tue, 03 Sep 2013 06:13:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:sender:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=qcduRpEWFwnRTNcjjyYtmf1Z2+dOC+GiTvn3y2xgxuw=; b=fFzKF8T7Mxubg2U+6IfD6j4bH6G9TG0DR3rA4NI4T8Wi2N9D5vaDlXU1yzdBa3SkU1 edwJ24qVAOcz/FOoPnDjTjih706ZTJnAXHDdQaP6JU0Rw+ZIFGCvzhMunm94kcGikMaC Guc9ySXDR79BuQZ0G/13k/WwVZj/jczM0ePR/sFLtRQDFqyb5Ok5VzuPsCCfBNDbGdfN rZz6lwwIl9sSq0iXsrsx8Fp/zXA5yI4moZL4/ANC2pE/R4m6Pym38s3D/oa/ewgfbN3O 5Z7P5v4iGWtY1rUr4jb47duZ9y15pW8eQiF+ZE9moNzhM0hpB1UIrNlOeCk6kGfe6A2k 6C1Q== X-Received: by 10.236.7.130 with SMTP id 2mr10428889yhp.4.1378213998553; Tue, 03 Sep 2013 06:13:18 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.14.106 with SMTP id o10ls2517715qec.36.gmail; Tue, 03 Sep 2013 06:13:18 -0700 (PDT) X-Received: by 10.58.196.132 with SMTP id im4mr364810vec.28.1378213998453; Tue, 03 Sep 2013 06:13:18 -0700 (PDT) Received: from mail-vb0-f44.google.com (mail-vb0-f44.google.com [209.85.212.44]) by mx.google.com with ESMTPS id dr1si4398544ved.115.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Sep 2013 06:13:18 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.44 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.44; Received: by mail-vb0-f44.google.com with SMTP id e13so3842514vbg.17 for ; Tue, 03 Sep 2013 06:13:18 -0700 (PDT) X-Gm-Message-State: ALoCoQmwDZWgRl6gD/OE906FlX90Sw+KQWbyJG6cGEbW5ExEsfG7UrqXHLM3gQLuzIAc8yf/NzFj X-Received: by 10.58.196.132 with SMTP id im4mr364800vec.28.1378213998325; Tue, 03 Sep 2013 06:13:18 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp170751vcz; Tue, 3 Sep 2013 06:13:17 -0700 (PDT) X-Received: by 10.180.9.203 with SMTP id c11mr18084521wib.64.1378213996764; Tue, 03 Sep 2013 06:13:16 -0700 (PDT) Received: from chiark.greenend.org.uk (v6.chiark.greenend.org.uk. [2001:ba8:1e3::]) by mx.google.com with ESMTPS id nb15si7117364wic.62.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 03 Sep 2013 06:13:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pmaydell@chiark.greenend.org.uk designates 2001:ba8:1e3:: as permitted sender) client-ip=2001:ba8:1e3::; Received: by chiark.greenend.org.uk (Debian Exim 4.72 #1) with local (return-path pmaydell@chiark.greenend.org.uk) id 1VGqPz-0003NC-Nx; Tue, 03 Sep 2013 14:13:15 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org Subject: [PATCH] target-arm: Make '-cpu any' available in linux-user mode only Date: Tue, 3 Sep 2013 14:13:15 +0100 Message-Id: <1378213995-12945-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 Sender: Peter Maydell X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.44 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 --- As well as cutting off a user error, this conveniently avoids what would otherwise be a clash between an aarch64 'cpu any' and the 32 bit version. 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)