* [Qemu-devel] [PATCH] target-arm: Make '-cpu any' available in linux-user mode only
@ 2013-09-03 13:13 Peter Maydell
2013-09-03 15:23 ` Andreas Färber
0 siblings, 1 reply; 2+ messages in thread
From: Peter Maydell @ 2013-09-03 13:13 UTC (permalink / raw)
To: qemu-devel; +Cc: patches
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 <peter.maydell@linaro.org>
---
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)
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] target-arm: Make '-cpu any' available in linux-user mode only
2013-09-03 13:13 [Qemu-devel] [PATCH] target-arm: Make '-cpu any' available in linux-user mode only Peter Maydell
@ 2013-09-03 15:23 ` Andreas Färber
0 siblings, 0 replies; 2+ messages in thread
From: Andreas Färber @ 2013-09-03 15:23 UTC (permalink / raw)
To: Peter Maydell; +Cc: qemu-devel, patches
Am 03.09.2013 15:13, schrieb Peter Maydell:
> 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 <peter.maydell@linaro.org>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-09-03 15:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-03 13:13 [Qemu-devel] [PATCH] target-arm: Make '-cpu any' available in linux-user mode only Peter Maydell
2013-09-03 15:23 ` Andreas Färber
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).