[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 01/35] target-arm: Fix raw read and write fun
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH v2 01/35] target-arm: Fix raw read and write functions on AArch64 registers |
Date: |
Fri, 31 Jan 2014 16:06:50 +0000 |
On 31 January 2014 15:56, Rob Herring <address@hidden> wrote:
> On 31 January 2014 09:45, Peter Maydell <address@hidden> wrote:
>> The raw read and write functions were using the ARM_CP_64BIT flag in
>> ri->type to determine whether to treat the register's state field as
>> uint32_t or uint64_t; however AArch64 register info structs don't use
>> that flag. Abstract out the "how big is the field?" test into a
>> function and fix it to work for AArch64 registers.
>> +/* Return true if this reginfo struct's field in the cpu state struct
>> + * is 64 bits wide.
>> + */
>> +static inline bool cpreg_field_is_64bit(const ARMCPRegInfo *ri)
>> +{
>> + return (ri->state == ARM_CP_STATE_AA64) || (ri->type & ARM_CP_64BIT);
>
> Won't this fail when state is ARM_CP_STATE_BOTH? That was what I found
> in testing as TTBR writes were not causing a tlb_flush.
Hmm. You're right that this won't work as it stands.
We could either fix this condition or we could make the code
that puts reginfo structs into the hashtable fix the state
so that the reginfo for the AArch64 register said _AA64
and the one for AArch32 said _AA32.
(And/or we could make that code force ARM_CP_64BIT for the AArch64
entry, but I felt it would be a bit confusing having that be
present on none of the structs in the source code but on all
of them at runtime.)
Anybody got a preference? If not I think I'll take the
path of least resistance and change this condition to
/* Only AArch32-only non-64-bit registers have a 32 bit
* backing field.
*/
return (ri->state != ARM_CP_STATE_AA32) || (ri->type & ARM_CP_64BIT);
thanks
-- PMM
- [Qemu-devel] [PATCH v2 04/35] target-arm: Restrict check_ap() use of S and R bits to v6 and earlier, (continued)
- [Qemu-devel] [PATCH v2 04/35] target-arm: Restrict check_ap() use of S and R bits to v6 and earlier, Peter Maydell, 2014/01/31
- [Qemu-devel] [PATCH v2 26/35] target-arm: Implement AArch64 memory attribute registers, Peter Maydell, 2014/01/31
- [Qemu-devel] [PATCH v2 09/35] target-arm: A64: Implement MSR (immediate) instructions, Peter Maydell, 2014/01/31
- [Qemu-devel] [PATCH v2 02/35] target-arm/kvm-consts.h: Define QEMU constants for known KVM CPUs, Peter Maydell, 2014/01/31
- [Qemu-devel] [PATCH v2 34/35] target-arm: Implement AArch64 dummy breakpoint and watchpoint registers, Peter Maydell, 2014/01/31
- [Qemu-devel] [PATCH v2 15/35] target-arm: Drop success/fail return from cpreg read and write functions, Peter Maydell, 2014/01/31
- [Qemu-devel] [PATCH v2 32/35] target-arm: Implement AArch64 generic timers, Peter Maydell, 2014/01/31
- [Qemu-devel] [PATCH v2 35/35] target-arm: Implement AArch64 OSLAR_EL1 sysreg as WI, Peter Maydell, 2014/01/31
- [Qemu-devel] [PATCH v2 01/35] target-arm: Fix raw read and write functions on AArch64 registers, Peter Maydell, 2014/01/31
- [Qemu-devel] [PATCH v2 30/35] target-arm: Implement AArch64 TTBR*, Peter Maydell, 2014/01/31
- [Qemu-devel] [PATCH v2 08/35] target-arm: A64: Implement store-exclusive for system mode, Peter Maydell, 2014/01/31
- [Qemu-devel] [PATCH v2 28/35] target-arm: Implement AArch64 TCR_EL1, Peter Maydell, 2014/01/31
- [Qemu-devel] [PATCH v2 11/35] target-arm: Split cpreg access checks out from read/write functions, Peter Maydell, 2014/01/31
- [Qemu-devel] [PATCH v2 22/35] target-arm: Implement AArch64 DAIF system register, Peter Maydell, 2014/01/31