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

Re: [RFC v2 04/12] xen/arm32: head: Remove restriction where to load Xen


  • To: Julien Grall <julien@xxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Fri, 25 Nov 2022 15:50:09 +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=8MrgEbLZWE8VLGcUb0mBrzk3xTtNJtTmq9OaRn7gMEY=; b=KRXy7/v4oRXxAAfBlUQ1AbrkkqQ0iJbsSiJItbK8teaZeVVc/f+oaWdoQIVoW9kXRmdGDJxgZXLLtIvFLgWkykWIEXhAeETHMqPYwwEYnfJo7yqTWiCBe59Psc6Iuv5e9V9cc8XFICrnh7dr0OAClWVJCL4YD6sFyAII6wGnPRlPlX4VAq7knTWsT104AK9mWLCQRJNdZ5whLpW2CSDyEPXh+8CohlYOVttfoIi54MIj2zSokY1hIVjU7qUSx7ZnS3LuzEotUZm9zNZMZTqFguBRn5leb3hv2oWFz+G7UyZuAKgXzS8PEvxvZ4xYyDPiiwgEidWP41JBLZEeNjcsBw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aaMTjXI2rQM7m0eAzpnI1czvE5yjWxTyN0MsM8vS09oAnJxj97c/FoL6l/2RNXwQwYjcTs7ixwXbuKIcLnYn/2Ocx0Nypr6qzS0AJZsm4hkHsWHjvPOwjwicEfYtAP7GGl2qV/YNI+xhYZRpJBqp++qFnok3Jc0mloU1dL28l4XhE+pwQfGXysvPAh9qZKFH7FI/ibDKp6pU4NI1bswRhLEpZ0Ycq17FUH2Fvbj90QlsF/lHmXNFKs31/cmj+2UXM+dPzdKy0YNwd6g3Jm7deBI1vyH6+s9OO5/+/zCg8rukReyFWfH1KYYFgj6oIsjj9VZggy7cJfq+U63KoX2oZw==
  • 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>, "marco.solieri@xxxxxxxxxxxxxxx" <marco.solieri@xxxxxxxxxxxxxxx>, "lucmiccio@xxxxxxxxx" <lucmiccio@xxxxxxxxx>, "carlo.nonato@xxxxxxxxxxxxxxx" <carlo.nonato@xxxxxxxxxxxxxxx>, Julien Grall <jgrall@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Fri, 25 Nov 2022 15:51:00 +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: AQHY5iekhdeljnYaKUO3Ilpr3vGfIK4fBWIAgCSx6ACADEeWAA==
  • Thread-topic: [RFC v2 04/12] xen/arm32: head: Remove restriction where to load Xen


> On 17 Nov 2022, at 20:18, Julien Grall <julien@xxxxxxx> wrote:
> 
> Hi Luca,
> 
> On 25/10/2022 12:56, Luca Fancellu wrote:
>>> On 22 Oct 2022, at 16:04, 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>
>>> ----
>>> 
>>>    Changes in v2:
>>>        - Patch added
>>> ---
>> Hi Julien,
>> I’m hitting an assert with this one, tested on qemu and fvp:
> 
> Thanks for testing the series!
> 
>> Xen 4.17-rc
>> (XEN) Xen version 4.17-rc (user@hostname) (arm-poky-linux-gnueabi-gcc (GCC) 
>> 11.3.0) debug=y Tue Oct 25 10:51:06 UTC 2022
>> (XEN) Latest ChangeSet:
>> (XEN) build-id: ab143b13f4394ced5331d6ff1cedebdb2ffadc07
>> (XEN) Processor: 412fc0f1: "ARM Limited", variant: 0x2, part 0xc0f,rev 0x1
>> (XEN) 32-bit Execution:
>> (XEN)   Processor Features: 00001131:00011001
>> (XEN)     Instruction Sets: AArch32 A32 Thumb Thumb-2 ThumbEE Jazelle
>> (XEN)     Extensions: GenericTimer
>> (XEN)   Debug Features: 02010555
>> (XEN)   Auxiliary Features: 00000000
>> (XEN)   Memory Model Features: 10201105 20000000
>> (XEN)                          01240000 02102211
>> (XEN)   ISA Features: 02101110 13112111 21232041
>> (XEN)                 11112131 10011142 00000000
>> (XEN) Using SMC Calling Convention v1.0
>> (XEN) Using PSCI v0.2
>> (XEN) SMP: Allowing 4 CPUs
>> (XEN) Generic Timer IRQ: phys=30 hyp=26 virt=27 Freq: 62500 KHz
>> (XEN) GICv2m extension register frame:
>> (XEN)         gic_v2m_addr=0000000008020000
>> (XEN)         gic_v2m_size=0000000000001000
>> (XEN)         gic_v2m_spi_base=80
>> (XEN)         gic_v2m_num_spis=64
>> (XEN) GICv2 initialization:
>> (XEN)         gic_dist_addr=0000000008000000
>> (XEN)         gic_cpu_addr=0000000008010000
>> (XEN)         gic_hyp_addr=0000000008030000
>> (XEN)         gic_vcpu_addr=0000000008040000
>> (XEN)         gic_maintenance_irq=25
>> (XEN) GICv2: 288 lines, 4 cpus (IID 00000000).
>> (XEN) XSM Framework v1.0.1 initialized
>> (XEN) Initialising XSM SILO mode
>> (XEN) Using scheduler: SMP Credit Scheduler rev2 (credit2)
>> (XEN) Initializing Credit2 scheduler
>> (XEN)  load_precision_shift: 18
>> (XEN)  load_window_shift: 30
>> (XEN)  underload_balance_tolerance: 0
>> (XEN)  overload_balance_tolerance: -3
>> (XEN)  runqueues arrangement: socket
>> (XEN)  cap enforcement granularity: 10ms
>> (XEN) load tracking window length 1073741824 ns
>> (XEN) Allocated console ring of 32 KiB.
>> (XEN) VFP implementer 0x41 architecture 4 part 0x30 variant 0xf rev 0x0
>> (XEN) CPU0: Guest atomics will try 1 times before pausing the domain
>> (XEN) Bringing up CPU1
>> (XEN) Assertion '!lpae_is_valid(*entry)' failed at arch/arm/domain_page.c:69
> 
> So this is asserting because, so far, for secondary CPUs, we are copying the 
> content of the CPU0 root table to the secondary CPU root table and then 
> update the entry.
> 
> So the entry would logical be valid. This is fine to be valid because the 
> root able is not yet live.
> 
> I have follow-up patches (not yet sent) where the root table for secondary 
> CPUs would also be live. I probably mistakenly tested with those patches.
> 
> Anyway, the ASSERT() here doesn't make sense in the context of this patch 
> because we are still switching the CPU0 root table. So I will drop the 
> ASSERT() for now.
> 
> I will re-introduce it in a follow-up series.
> 
> Before I send a new version, do you have any comments for the rest of the 
> patches?

Hi Julien,

Yes as you pointed out, the assert was not right in that context and it can be 
removed without issues, I’ve had a look on the serie and the changes looks ok 
to me, I’ve also tested
that it works on arm64 and arm32 using FVP.

Cheers,
Luca

> 
> Cheers,
> 
> -- 
> Julien Grall


 


Rackspace

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