[Top][All Lists]

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

Re: [Qemu-arm] [RFC PATCH v1 4/4] target-arm: Compute page size based on

From: Peter Maydell
Subject: Re: [Qemu-arm] [RFC PATCH v1 4/4] target-arm: Compute page size based on ARM target cpu type
Date: Tue, 14 Jun 2016 12:36:02 +0100

On 14 June 2016 at 12:14, Vijay Kilari <address@hidden> wrote:
> On Mon, Jun 13, 2016 at 3:40 PM, Peter Maydell <address@hidden> wrote:
>> On 13 June 2016 at 10:43, Peter Maydell <address@hidden> wrote:
>>> On 13 June 2016 at 10:08,  <address@hidden> wrote:
>>>> +/*
>>>> + * based on the the cpu type emulated at runtime.
>>>> + */
>>>> +static uint32_t target_page_bits;
>>> The CPU page size is not specific to the 'virt' board, so this
>>> is the wrong place to do this. You should identify the
>>> page size in arm_cpu_realizefn() based on the set of feature
>>> bits the CPU has: anything with ARM_FEATURE_V7 has a 4K page
>>> table (this includes a lot of 32-bit CPUs).
>   cpu_init and cpu_realizefn() of required cpu model is called in
> machvirt_init(),
> which is quite late in the initialization sequence.
> The cpu_exec_init_all() which calls memory_map_init() is called very
> early stage,
> is where TARGET_PAGE_BITS information is required.
> In order to get feature information of CPU early, one option is to
> create cpu object
> early, initialize it. This means moving some cpu object creation and
> initalization
> code from machvirt_init().

It would be better to delay the point at which we allocate
the data structures which care about page size, rather than
moving init of the CPU earlier.

Also we should consider what happens if we have decided
the page size is X, and then a CPU is hotplugged which
requires a page size Y where Y < X.

>> Actually that should be "with ARM_FEATURE_V7 and not
>> ARM_FEATURE_MPU", or we'll break the PMSA code.
>> Note that you'll also need to handle systems where the
>> different CPUs in it disagree about the preferred target
>> page size -- the xlnx-ep108 board can have both
>> Cortex-A53 (prefers 4K) and Cortex-R5 (prefers 1K) CPUs in it.
>> "Use the smallest value required by any CPU on the board"
>> is probably the best approach.
> How -cpu options are passed for xlnx-ep108 board in qemu command?

They aren't -- you always get the cpus the board has in real h/w.

-- PMM

reply via email to

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