qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] AArch64 QEMU System emulation: issue with TTBR0


From: Peter Maydell
Subject: Re: [Qemu-devel] AArch64 QEMU System emulation: issue with TTBR0
Date: Sun, 8 Jun 2014 13:19:44 +0100

On 8 June 2014 12:26, Ian Campbell <address@hidden> wrote:
> On Tue, 2014-06-03 at 14:28 +0200, Claudio Fontana wrote:
>> Thank you for the clarifications and advice, I think executable
>> permissions might be involved, as removing the NX / PNX check in
>> get_phys_addr_lpae() makes it proceed ahead
>
> I'm seeing something very similar running modprobe, I get a kernel fault
> (see below) which I also tracked down to the NX/PNX checks in
> get_phys_addr_lpae().
>
> At the moment I'm a bit suspicious of:
>         /* Extract attributes from the descriptor and merge with table attrs 
> */
>         if (arm_feature(env, ARM_FEATURE_V8)) {
>             attrs = extract64(descriptor, 2, 10)
>                 | (extract64(descriptor, 53, 11) << 10);
>         } else {
>             attrs = extract64(descriptor, 2, 10)
>                 | (extract64(descriptor, 52, 12) << 10);
>         }
>
> I'm not sure what the reason for the v8 difference is, it seems like it
> is skipping extracting the CONTIG bit but I've not dug into the v8 ARM
> ARM to figure out why that might be desirable...

The CONTIG bit is purely a hint to the implementation, so it's
valid to completely ignore it. (Given how QEMU's TLB works it
doesn't really make sense for us.) However it's present in v7's
long descriptor format as well, so I'm not sure why this change
is guarded by ARM_FEATURE_V8. Rob?

> Since in the v8 case extracts fewer bits from higher up but uses the
> same << 10 shift, which seems like it ought to then confuse later checks
> with use 1<<11 and 1<<12. Making that <<10 into <<11 doesn't help though
> so I think I might be barking up the wrong tree...

I think this should be unconditionally
            attrs = extract64(descriptor, 2, 10)
                 | (extract64(descriptor, 52, 12) << 10);
(as we currently have for v7 LPAE)
as we're just assembling the upper and lower attribute bits
into a contiguous set. We can then happily ignore anything
like CONTIG that we don't care about.

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]