All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Vijay Kilari <vijay.kilari@gmail.com>
Cc: Vijaya Kumar K <vijayak@caviumnetworks.com>,
	qemu-arm <qemu-arm@nongnu.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Juan Quintela <quintela@redhat.com>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Prasun Kapoor <Prasun.Kapoor@caviumnetworks.com>,
	Vijaya Kumar K <Vijaya.Kumar@caviumnetworks.com>,
	Vijaya Kumar K <vijayak@cavium.com>
Subject: Re: [Qemu-devel] [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	[thread overview]
Message-ID: <CAFEAcA-=iT1r1mJgr94JUP9XfMJ2XxxW47pMF3vZ6btdO=MnUw@mail.gmail.com> (raw)
In-Reply-To: <CALicx6tYEX-6u7anPb=kgvOtg4HQriC5oRJPQtZiMipeBJazVw@mail.gmail.com>

On 14 June 2016 at 12:14, Vijay Kilari <vijay.kilari@gmail.com> wrote:
> On Mon, Jun 13, 2016 at 3:40 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
>> On 13 June 2016 at 10:43, Peter Maydell <peter.maydell@linaro.org> wrote:
>>> On 13 June 2016 at 10:08,  <vijayak@caviumnetworks.com> wrote:
>>>> +/*
>>>> + * Holds TARGET_AARCH_64_PAGE_BITS or TARGET_ARM_PAGE_BITS
>>>> + * 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.

thanks
-- PMM

  reply	other threads:[~2016-06-14 11:36 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-13  9:08 [Qemu-devel] [RFC PATCH v1 0/4] ARM/AARCH64: Runtime page size computation vijayak
2016-06-13  9:08 ` [Qemu-devel] [RFC PATCH v1 1/4] migration: Remove static allocation of xzblre cache buffer vijayak
2016-06-13  9:08 ` [Qemu-devel] [RFC PATCH v1 2/4] exec.c: Remove static allocation of sub_section of sub_page vijayak
2016-06-13  9:32   ` Peter Maydell
2016-06-13  9:52   ` Paolo Bonzini
2016-06-17 10:14     ` Vijay Kilari
2016-06-17 10:29       ` Peter Maydell
2016-06-13  9:08 ` [Qemu-devel] [RFC PATCH v1 3/4] translate-all.c: Compute L1 page table properties at runtime vijayak
2016-06-13  9:25   ` Paolo Bonzini
2016-06-13  9:36     ` Peter Maydell
2016-06-13 10:06       ` Paolo Bonzini
2016-06-21 11:53     ` Peter Maydell
2016-06-21 11:57       ` Paolo Bonzini
2016-06-13  9:08 ` [Qemu-devel] [RFC PATCH v1 4/4] target-arm: Compute page size based on ARM target cpu type vijayak
2016-06-13  9:25   ` Paolo Bonzini
2016-06-13  9:43   ` Peter Maydell
2016-06-13 10:10     ` Peter Maydell
2016-06-14 11:14       ` Vijay Kilari
2016-06-14 11:36         ` Peter Maydell [this message]
2016-06-16 19:42           ` Richard Henderson
2016-06-17 10:20             ` Vijay Kilari
2016-06-17 10:30               ` Peter Maydell
2016-06-17 10:39                 ` Vijay Kilari
2016-06-17 10:42                   ` Peter Maydell
2016-06-21 11:55               ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFEAcA-=iT1r1mJgr94JUP9XfMJ2XxxW47pMF3vZ6btdO=MnUw@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=Prasun.Kapoor@caviumnetworks.com \
    --cc=Vijaya.Kumar@caviumnetworks.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=vijay.kilari@gmail.com \
    --cc=vijayak@cavium.com \
    --cc=vijayak@caviumnetworks.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.