From patchwork Tue Sep 3 19:12:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 19714 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f69.google.com (mail-yh0-f69.google.com [209.85.213.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6096124869 for ; Tue, 3 Sep 2013 19:12:29 +0000 (UTC) Received: by mail-yh0-f69.google.com with SMTP id f11sf6074287yha.4 for ; Tue, 03 Sep 2013 12:12:29 -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:in-reply-to:references:sender:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=VtpirDcSuHEJTMk50drMXQJJF7ifqVnxox+IRfsvvts=; b=mYf0pqP/nqTjIdPbO/QeqRY7zC7Km9gnj/0D3IDOAlqmmRDOiegtfKFZ7BrdIoK12I nghPsddPC1NLsVDyh3By9tOAqO60CVfnBZUGnLikjLQ2piLnsVMgt7Fna7DJV1b6Ij+/ JL146Wmrt7DV9beayeV/2+SKDk9BZ1od073m3Mx/wcvBOaaNZV6I5oEb8Q9taMCfr820 LpLMKigW13oRytWnQfAlqRZvtE5GTM6rYSetnlG3B/aqbeYrcnq2TdUbVk94noXUPfno GihYAAHAjmn5jBT3t8rStfEIBYsI7+F40JIxhkVRyUYpqOKd0AsxAGbCjwxoWG7NW5wX 26vg== X-Received: by 10.236.222.228 with SMTP id t94mr11143348yhp.18.1378235549161; Tue, 03 Sep 2013 12:12:29 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.60.9 with SMTP id d9ls2685723qer.55.gmail; Tue, 03 Sep 2013 12:12:29 -0700 (PDT) X-Received: by 10.52.35.171 with SMTP id i11mr24265260vdj.4.1378235549078; Tue, 03 Sep 2013 12:12:29 -0700 (PDT) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id st7si4797437vec.125.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Sep 2013 12:12:29 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.176; Received: by mail-ve0-f176.google.com with SMTP id b10so4332238vea.7 for ; Tue, 03 Sep 2013 12:12:29 -0700 (PDT) X-Gm-Message-State: ALoCoQm2Dmh9gZpY1qMCtEfiDwiIvzyz1X0niQ0N56NWeIZxvV9jzFGuIhH+76j/Uo72ZjvipoRl X-Received: by 10.58.155.68 with SMTP id vu4mr9535117veb.21.1378235548964; Tue, 03 Sep 2013 12:12:28 -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 u4csp190446vcz; Tue, 3 Sep 2013 12:12:28 -0700 (PDT) X-Received: by 10.194.122.99 with SMTP id lr3mr28309290wjb.21.1378235545867; Tue, 03 Sep 2013 12:12:25 -0700 (PDT) Received: from chiark.greenend.org.uk (v6.chiark.greenend.org.uk. [2001:ba8:1e3::]) by mx.google.com with ESMTPS id w7si7640157wje.104.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 03 Sep 2013 12:12:25 -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 1VGw1Y-0005nx-4Y; Tue, 03 Sep 2013 20:12:24 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Andreas Schwab , Alexander Graf , "Mian M. Hamayun" , kvmarm@lists.cs.columbia.edu, =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [PATCH v6 01/24] target-arm: Make '-cpu any' available in linux-user mode only Date: Tue, 3 Sep 2013 20:12:01 +0100 Message-Id: <1378235544-22290-2-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1378235544-22290-1-git-send-email-peter.maydell@linaro.org> References: <1378235544-22290-1-git-send-email-peter.maydell@linaro.org> 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.128.176 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 --- 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)