[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 03/19] target/arm: Restrict DC-CVAP instruction to TCG acc
From: |
Peter Maydell |
Subject: |
Re: [PATCH v3 03/19] target/arm: Restrict DC-CVAP instruction to TCG accel |
Date: |
Mon, 16 Mar 2020 20:11:34 +0000 |
On Mon, 16 Mar 2020 at 19:36, Richard Henderson
<address@hidden> wrote:
> I'm not 100% sure how the system regs function under kvm.
>
> If they are not used at all, then we should avoid them all en masse an not
> piecemeal like this.
>
> If they are used for something, then we should keep them registered and change
> the writefn like so:
>
> #ifdef CONFIG_TCG
> /* existing stuff */
> #else
> /* Handled by hardware accelerator. */
> g_assert_not_reached();
> #endif
(1) for those registers where we need to know the value within
QEMU code (notably anything involved in VA-to-PA translation,
as this is used by gdbstub accesses, etc, but sometimes we
want other register values too): the sysreg struct is
what lets us map from the KVM register to the field in the
CPU struct when we do a sync of data to/from the kernel.
(2) for other registers, the sync lets us make the register
visible as an r/o register in the gdbstub. (this is not
very important, but it's nice)
(3) Either way, the sync works via the raw_read/raw_write
accessors (this is a big part of what they're for), which are
supposed to just stuff the data into/out of the underlying
CPU struct field. (But watch out because we fall back to
using the non-raw read/writefn if there's no raw version
provided for a particular register.) If a regdef is marked
as NO_RAW then it means there is no raw access and we don't
sync the value.
(4) I think that in KVM mode we won't deliberately do
non-raw accesses, and a quick grep through of the places
that do 'readfn' accesses supports that.
thanks
-- PMM
- [PATCH v3 00/19] Support disabling TCG on ARM (part 2), Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 01/19] target/arm: Rename KVM set_feature() as kvm_set_feature(), Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 02/19] target/arm: Make set_feature() available for other files, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 03/19] target/arm: Restrict DC-CVAP instruction to TCG accel, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 04/19] target/arm: Restric the Address Translate operations to TCG accel, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 05/19] target/arm: Restrict Virtualization Host Extensions instructions to TCG, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 06/19] target/arm: Move Makefile variable restricted to CONFIG_TCG, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 08/19] target/arm: Add semihosting stub to allow building without TCG, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 07/19] target/arm: Make cpu_register() available for other files, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 09/19] target/arm: Move ARM_V7M Kconfig from hw/ to target/, Philippe Mathieu-Daudé, 2020/03/16