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

Re: [PATCH v4 09/14] xen/arm32: head: Remove restriction where to load Xen


  • To: Julien Grall <julien@xxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Fri, 13 Jan 2023 14:58:39 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gPUmg80n0eB51azLxyi5e7OIc/4qg3yfsmv3NZ6ZT8c=; b=hlk2oOFlbkpbKwyWae4OgTi4qP3MKiE7sn8ziF7QbwNoVW+a8R549FtyLPmlbDqI7tRLqGMEtNLc13o6Y2a9nDoZmbJUxsM0ti0iwO3ZP06nMMDCG49dZnnEufzeqdpKIaq4dS1mtAIN+/HFSivdjTO1u64A4b2dnr2MhISJVWgXk+nvQni7xeeYPMaBo4sh3sbffBdRsmOoPwGL5PxxMg2fVQ5IaiaKva8hyu3Bg9hIZRTuPUmnHY2NPzcwJMlt9/z2Qt84iaBV6l+0y0AWvGbfprROuZnZjWSg42c3gI+U15rxLTpFOK/Mu9u1QADN4quAkn5KM/2nBeiA75rkBQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F/F8stLFm3SmCDoQh30GV6qqxr8OoteSBbEbDAnS62QCrZ9XL5b2TKMZMjw0Cvi5ChZIqIT74wkb2/T/xTEnds/SYzp7vcLUCs7Y6pLVN80I0r8q5KLHYu3povfEwSVtEFh/YldcHzxjVkCDcoBm5YAXUzjIXJ02o6fIW1bCTEsSodTj+i5Ij5W2ukN7HoD3rg8Ygithssvj//YM1/LeblqEAUJBz66LRmZZ6XWrmf5hm7hgE35OpNCk+yCMoXEzgpkaxK8i+kfziIy2Hq3JdCVwAxi9jCWhoEkgzP13894HpzihFv9WGFOfnHC8o7+fvUsnsl0GH3NyRv/KJ3vYMQ==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Julien Grall <jgrall@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Fri, 13 Jan 2023 14:59:08 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHZJzd+ffGmBsJNbUGFhc+Z6Z3UHa6ccI0A
  • Thread-topic: [PATCH v4 09/14] xen/arm32: head: Remove restriction where to load Xen


> On 13 Jan 2023, at 10:11, Julien Grall <julien@xxxxxxx> wrote:
> 
> From: Julien Grall <jgrall@xxxxxxxxxx>
> 
> At the moment, bootloaders can load Xen anywhere in memory but the
> region 2MB - 4MB. While I am not aware of any issue, we have no way
> to tell the bootloader to avoid that region.
> 
> In addition to that, in the future, Xen may grow over 2MB if we
> enable feature like UBSAN or GCOV. To avoid widening the restriction
> on the load address, it would be better to get rid of it.
> 
> When the identity mapping is clashing with the Xen runtime mapping,
> we need an extra indirection to be able to replace the identity
> mapping with the Xen runtime mapping.
> 
> Reserve a new memory region that will be used to temporarily map Xen.
> For convenience, the new area is re-using the same first slot as the
> domheap which is used for per-cpu temporary mapping after a CPU has
> booted.
> 
> Furthermore, directly map boot_second (which cover Xen and more)
> to the temporary area. This will avoid to allocate an extra page-table
> for the second-level and will helpful for follow-up patches (we will
> want to use the fixmap whilst in the temporary mapping).
> 
> Lastly, some part of the code now needs to know whether the temporary
> mapping was created. So reserve r12 to store this information.
> 
> Signed-off-by: Julien Grall <jgrall@xxxxxxxxxx>
> ----
> 

Hi Julien,

> 
> +/*
> + * Remove the temporary mapping of Xen starting at TEMPORARY_XEN_VIRT_START.
> + *
> + * Clobbers r0 - r1

NIT: r0 - r3?

> + */
> +remove_temporary_mapping:
> +        /* r2:r3 := invalid page-table entry */
> +        mov   r2, #0
> +        mov   r3, #0
> +
> +        adr_l r0, boot_pgtable
> +        mov_w r1, TEMPORARY_XEN_VIRT_START
> +        get_table_slot r1, r1, 1     /* r1 := first slot */
> +        lsl   r1, r1, #3             /* r1 := first slot offset */
> +        strd  r2, r3, [r0, r1]
> +
> +        flush_xen_tlb_local r0
> +
> +        mov  pc, lr
> +ENDPROC(remove_temporary_mapping)
> +

The rest looks good to me, I’ve also built for arm64/32 and test this patch on 
fvp aarch32 mode,
booting Dom0 and creating/running/destroying some guests.

Reviewed-by: Luca Fancellu <luca.fancellu@xxxxxxx>
Tested-by: Luca Fancellu <luca.fancellu@xxxxxxx>

Cheers,
Luca

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.