[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 27/40] target/arm: Add VHE system register redirection and
From: |
Peter Maydell |
Subject: |
Re: [PATCH v4 27/40] target/arm: Add VHE system register redirection and aliasing |
Date: |
Fri, 6 Dec 2019 18:41:16 +0000 |
On Fri, 6 Dec 2019 at 18:36, Richard Henderson
<address@hidden> wrote:
> >> +static void el2_e2h_write(CPUARMState *env, const ARMCPRegInfo *ri,
> >> + uint64_t value)
> >> +{
> >> + CPWriteFn *writefn;
> >> +
> >> + if (redirect_for_e2h(env)) {
> >> + /* Switch to the saved EL2 version of the register. */
> >> + ri = ri->opaque;
> >> + writefn = ri->writefn;
> >> + } else {
> >> + writefn = ri->orig_writefn;
> >> + }
> >> + if (writefn == NULL) {
> >> + writefn = raw_write;
> >> + }
> >> + writefn(env, ri, value);
> >> +}
> >
> > I see how this works when we have a readfn or writefn,
> > but how does the redirection work where the access
> > goes directly via .fieldoffset ?
>
> When there is no .writefn, we use raw_write, which uses fieldoffset.
Yes, that's what I mean. There's no 'if redirect then this
fieldoffset else that fieldoffset' codepath, so how does
it update the right field?
thanks
-- PMM
- [PATCH v4 29/40] target/arm: Flush tlb for ASID changes in EL2&0 translation regime, (continued)
- [PATCH v4 29/40] target/arm: Flush tlb for ASID changes in EL2&0 translation regime, Richard Henderson, 2019/12/02
- [PATCH v4 24/40] target/arm: Add the hypervisor virtual counter, Richard Henderson, 2019/12/02
- [PATCH v4 30/40] target/arm: Flush tlbs for E2&0 translation regime, Richard Henderson, 2019/12/02
- [PATCH v4 36/40] target/arm: Enable ARMv8.1-VHE in -cpu max, Richard Henderson, 2019/12/02
- [PATCH v4 27/40] target/arm: Add VHE system register redirection and aliasing, Richard Henderson, 2019/12/02
[PATCH v4 18/40] target/arm: Reorganize ARMMMUIdx, Richard Henderson, 2019/12/02
[PATCH v4 32/40] target/arm: Update {fp,sve}_exception_el for VHE, Richard Henderson, 2019/12/02
[PATCH v4 40/40] target/arm: Raise only one interrupt in arm_cpu_exec_interrupt, Richard Henderson, 2019/12/02
[PATCH v4 39/40] target/arm: Use bool for unmasked in arm_excp_unmasked, Richard Henderson, 2019/12/02
[PATCH v4 25/40] target/arm: Update timer access for VHE, Richard Henderson, 2019/12/02