[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] linux-user: Use the 5KEf processor for 64-bit e
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH] linux-user: Use the 5KEf processor for 64-bit emulation |
Date: |
Thu, 20 Nov 2014 17:33:48 +0000 |
On 20 November 2014 17:21, Maciej W. Rozycki <address@hidden> wrote:
> It's not possible, the MIPS16 and microMIPS instruction sets are
> mutually exclusive as the same resource (the ISA bit or the LSB of the
> PC) is used to switch to either mode from the standard MIPS mode,
> depending on what a given processor implements.
Pity.
> Besides it is worthwhile to have a processor that implements the
> microMIPS or the standard MIPS instruction set only, to trap unwanted
> mode switches in software that is supposed to use one of these
> instruction sets only (there is no such issue with the MIPS16
> instruction set as it it not fully self-contained and the presence of
> the standard MIPS instruction set is also required).
Indeed; for ARM "any" is an addition to the usual set of
CPU options, not a replacement for them.
> The rest can probably be arranged although there are grey areas,
> specifically not all optional instruction sets have their opcodes
> defined in the microMIPS instruction set. But for the user emulation
> mode that should probably be OK as long the artificial processor is not
> available for the system emulation mode.
Yes; for ARM we don't define the "any" CPU in system mode for
pretty much this reason.
> Please note that as I suggested the right emulation could be chosen
> automagically based on ELF file header flags. In fact I have a patch
> outstanding already down the queue that does some processor
> reconfiguration based on that, just like the Linux kernel would do.
> That approach could be further extended up to selecting among processors
> available, so e.g. a program that contains some microMIPS code would
> pick up a microMIPS-enabled processor and one including MIPS16 code
> would pick up one with the MIPS16 extension instead.
That would probably be a useful default. My views here are really
based on two things:
* the binfmt-misc registration just starts QEMU with no -cpu options,
so it's helpful if the default can run any binary that matches the
ELF magic specification
* the ifdef ladder in linux-user/main.c is kind of ugly :-)
thanks
-- PMM