[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v9 40/84] target/mips: Fix pre-nanoMIPS MT ASE i
From: |
Aleksandar Markovic |
Subject: |
Re: [Qemu-devel] [PATCH v9 40/84] target/mips: Fix pre-nanoMIPS MT ASE instructions availability control |
Date: |
Thu, 16 Aug 2018 17:06:41 +0000 |
> From: Richard Henderson <address@hidden>
> Sent: Thursday, August 16, 2018 6:37 PM
>
> Subject: Re: [PATCH v9 40/84] target/mips: Fix pre-nanoMIPS MT ASE
> instructions availability control
>
> On 08/16/2018 07:57 AM, Aleksandar Markovic wrote:
> > From: Aleksandar Rikalo <address@hidden>
> >
> > Use bits from configuration registers for availability control
> > of MT ASE instructions, rather than only ISA_MT bit in insn_flags.
> > This is done by adding a field in hflags for MT bit, and adding
> > functions check_mt() and check_cp0_mt().
> >
> > Reviewed-by: Aleksandar Markovic <address@hidden>
> > Signed-off-by: Aleksandar Markovic <address@hidden>
> > Signed-off-by: Stefan Markovic <address@hidden>
> > ---
> > target/mips/cpu.h | 3 ++-
> > target/mips/internal.h | 6 +++++-
> > target/mips/translate.c | 45 +++++++++++++++++++++++++++++++++++++--------
> > 3 files changed, 44 insertions(+), 10 deletions(-)
>
> What was wrong with using insn_flags?
>
The problem with using ISA_MT from insn_flags is that it doesn't provide the
correct availability control. Even though all instructions from MT ASE are
related, they are available under different conditions:
Case 1 - DMT, DVPE, EMT, EVPE:
if IsCoprocessorEnabled(0) then
if Config3 MT then
<main fuctionality>
else
SignalException(ReservedInstruction)
endif
else
SignalException(CoprocessorUnusable, 0)
endif
Case 2 - FORK, YIELD:
if Config3 MT then
<main fuctionality>
else
SignalException(ReservedInstruction)
endif
Case 3 - MFTR, MTTR:
if IsCoprocessorEnabled(0) then
<main fuctionality>
else
SignalException(CoprocessorUnusable, 0)
endif
> I'll note that hflags should be reserved for things that can change at
> runtime.
> I thought all of these configuration registers were read-only.
>
> Anyway, with this plus the XNP patch from earlier, you now only have one
> remaining bit within hflags and then that resource is exhausted.
>
I think some of the previously-implemented similar cases involving read-only
bits were handled the same way, and we just built on that. What would you
suggest as a more appropriate solution in such cases (of accessing "preset by
hardware" bits)?
Regards,
Aleksandar
- [Qemu-devel] [PATCH v9 04/84] target/mips: Mark switch fallthroughs with interpretable comments, (continued)
- [Qemu-devel] [PATCH v9 04/84] target/mips: Mark switch fallthroughs with interpretable comments, Aleksandar Markovic, 2018/08/16
- [Qemu-devel] [PATCH v9 03/84] target/mips: Avoid case statements formulated by ranges - part 2, Aleksandar Markovic, 2018/08/16
- [Qemu-devel] [PATCH v9 15/84] qemu-doc: Amend MIPS-related items, Aleksandar Markovic, 2018/08/16
- [Qemu-devel] [PATCH v9 13/84] linux-user: Update MIPS syscall numbers up to kernel 4.18 headers, Aleksandar Markovic, 2018/08/16
- [Qemu-devel] [PATCH v9 35/84] target/mips: Implement emulation of nanoMIPS ROTX instruction, Aleksandar Markovic, 2018/08/16
- [Qemu-devel] [PATCH v9 40/84] target/mips: Fix pre-nanoMIPS MT ASE instructions availability control, Aleksandar Markovic, 2018/08/16
[Qemu-devel] [PATCH v9 19/84] target/mips: Add placeholder and invocation of decode_nanomips_opc(), Aleksandar Markovic, 2018/08/16
[Qemu-devel] [PATCH v9 25/84] target/mips: Add emulation of nanoMIPS 16-bit load and store instructions, Aleksandar Markovic, 2018/08/16
[Qemu-devel] [PATCH v9 20/84] target/mips: Add nanoMIPS decoding and extraction utilities, Aleksandar Markovic, 2018/08/16
[Qemu-devel] [PATCH v9 24/84] target/mips: Add emulation of nanoMIPS 16-bit misc instructions, Aleksandar Markovic, 2018/08/16
[Qemu-devel] [PATCH v9 26/84] target/mips: Add emulation of nanoMIPS 16-bit logic instructions, Aleksandar Markovic, 2018/08/16
[Qemu-devel] [PATCH v9 11/84] elf: Remove duplicate preprocessor constant definition, Aleksandar Markovic, 2018/08/16
[Qemu-devel] [PATCH v9 23/84] target/mips: Add emulation of nanoMIPS 16-bit shift instructions, Aleksandar Markovic, 2018/08/16