All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@arm.com>
To: Mirela Simonovic <mirela.simonovic@aggios.com>
Cc: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Xen Devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH v2 05/10] xen/arm: Setup virtual paging for non-boot CPUs on hotplug/resume
Date: Wed, 25 Apr 2018 09:23:22 +0100	[thread overview]
Message-ID: <a8a4933c-c211-52a2-6861-fb47cafd0d9b@arm.com> (raw)
In-Reply-To: <CAKPH-Ni802SEDkXfkZhbD3ULNuBLaPzE2Seiy6za641YFaen3w@mail.gmail.com>



On 04/24/2018 03:50 PM, Mirela Simonovic wrote:
> Hi Julien,

Hi,

Sorry I forgot to answer to some part of the e-mail.

> On Mon, Apr 23, 2018 at 1:28 PM, Julien Grall <julien.grall@arm.com> wrote:
>> Hi Mirela,
>> On 20/04/18 13:25, Mirela Simonovic wrote:
>>> diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
>>> index d43c3aa896..9bb62c13cd 100644
>>> --- a/xen/arch/arm/p2m.c
>>> +++ b/xen/arch/arm/p2m.c
>>> @@ -1451,13 +1451,21 @@ err:
>>>        return page;
>>>    }
>>>    -static void __init setup_virt_paging_one(void *data)
>>> +static void setup_virt_paging_one(void *data)
>>>    {
>>>        unsigned long val = (unsigned long)data;
>>>        WRITE_SYSREG32(val, VTCR_EL2);
>>>        isb();
>>>    }
>>>    +/* VTCR value to be configured by all CPUs. Set only once by the boot
>>> CPU */
>>> +static unsigned long __read_mostly vtcr_value;
>>
>>
>> VTCR is a register, so the type should be represented in term of bits (i.e
>> uint*_t).
> 
> I followed the type used in setup_virt_paging() and it's unsigned
> long. However, the spec says the VTCR_EL2 is 32-bit register, meaning
> that in the current implementation the type is not correct.
> If I want the type to be correct in this patch Xen will not compile.
> Are you suggesting to fix the type in existing implementation?

The unsigned long is just a workaround to avoid an extra variable for 
the cast. As you introduce a static variable, then the cast become 
unnecessary.

> 
>>
>>> +
>>> +void setup_virt_paging_secondary(void)
>>> +{
>>> +    setup_virt_paging_one((void *)vtcr_value);
>>
>>
>> That's fairly ugly. Is there any way to rework the interface? For instance,
>> because you have a static variable which contain the VTCR, you could just
>> use the variable in setup_virt_paging one.
>>
>  I 
> If the argument provided to setup_virt_paging_one() is NULL within the
> setup_virt_paging_one() I configure saved static vtcr_value? If that
> is what you meant it was submitted in previous version of this patch
> :)
> Are you suggesting to revert the change to v1?

I would suggest a mix between v1 and v2. Something like:

static uint64_t vtcr;

static setup_init_paging_one(void *data)
{
    WRITE_SYSREG(vtcr, VTRC_EL2);
    [...]
}
r

void __init setup_virt_paging(...)
{
     vtcr = val;
}

Potentially, you could drop val and use vtcr everywhere in 
setup_virt_paging().

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2018-04-25  8:23 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-20 12:25 [PATCH v2 00/10] xen/arm64: Suspend preconditions and CPU hotplug fixes Mirela Simonovic
2018-04-20 12:25 ` [PATCH v2 01/10] xen/arm64: Added handling of the trapped access to OSLSR register Mirela Simonovic
2018-04-23 11:13   ` Julien Grall
2018-04-20 12:25 ` [PATCH v2 02/10] xen/arm: Ignore write to GICD_ISACTIVERn registers (vgic-v2) Mirela Simonovic
2018-04-23 11:15   ` Julien Grall
2018-04-24 11:02     ` Mirela Simonovic
2018-04-24 16:12       ` Julien Grall
2018-04-24 16:45         ` Mirela Simonovic
2018-04-20 12:25 ` [PATCH v2 03/10] xen/arm: Implement CPU_OFF PSCI call (physical interface) Mirela Simonovic
2018-04-23 11:21   ` Julien Grall
2018-04-23 17:12     ` Mirela Simonovic
2018-04-23 17:15       ` Julien Grall
2018-04-20 12:25 ` [PATCH v2 04/10] xen/arm: Remove __initdata and __init to enable CPU hotplug Mirela Simonovic
2018-04-23 11:21   ` Julien Grall
2018-04-20 12:25 ` [PATCH v2 05/10] xen/arm: Setup virtual paging for non-boot CPUs on hotplug/resume Mirela Simonovic
2018-04-23 11:28   ` Julien Grall
2018-04-24 14:50     ` Mirela Simonovic
2018-04-24 16:33       ` Julien Grall
2018-04-25  8:23       ` Julien Grall [this message]
2018-04-20 12:25 ` [PATCH v2 06/10] xen/common: Restore IRQ affinity when hotplugging a pCPU Mirela Simonovic
2018-04-20 12:25 ` [PATCH v2 07/10] xen/arm: Release maintenance interrupt when CPU is hot-unplugged Mirela Simonovic
2018-04-23 11:33   ` Julien Grall
2018-04-25 13:09     ` Mirela Simonovic
2018-04-25 13:23       ` Julien Grall
2018-04-25 14:28         ` Mirela Simonovic
2018-04-26 10:08           ` Julien Grall
2018-04-26 14:23             ` Tim Deegan
2018-04-27  9:28               ` Julien Grall
2018-04-27 14:15                 ` Tim Deegan
2018-04-27 14:38                   ` Mirela Simonovic
2018-04-27 15:12                     ` Julien Grall
2018-05-09 10:10                       ` Mirela Simonovic
2018-05-09 11:01                         ` Julien Grall
2018-05-09 11:14                           ` Mirela Simonovic
2018-05-09 11:15                             ` Julien Grall
2018-04-20 12:25 ` [PATCH v2 08/10] xen/arm: Release timer interrupts " Mirela Simonovic
2018-04-25 10:34   ` Mirela Simonovic
2018-04-25 10:38     ` Julien Grall
2018-04-20 12:25 ` [PATCH v2 09/10] xen/arm: Free memory allocated for sibling/core maps on CPU hot-unplug Mirela Simonovic
2018-04-23 11:38   ` Julien Grall
2018-04-27 11:14     ` Mirela Simonovic
2018-04-20 12:25 ` [PATCH v2 10/10] xen/arm: Call check_local_cpu_errata for secondary CPU only on boot Mirela Simonovic
2018-04-23 11:46   ` Julien Grall
2018-04-25 15:13     ` Mirela Simonovic
2018-04-26 10:18       ` Julien Grall

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=a8a4933c-c211-52a2-6861-fb47cafd0d9b@arm.com \
    --to=julien.grall@arm.com \
    --cc=edgar.iglesias@xilinx.com \
    --cc=mirela.simonovic@aggios.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xen.org \
    /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.