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

Re: [PATCH v6 07/13] xen/arm: Split MMU system SMP MM bringup code to mmu/smpboot.c


  • To: Julien Grall <julien@xxxxxxx>
  • From: Henry Wang <Henry.Wang@xxxxxxx>
  • Date: Tue, 26 Sep 2023 01:31:48 +0000
  • Accept-language: zh-CN, 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=3tyNgwotyVLlhIeqL0M5LjYaHhurcldkdof83+3NtfA=; b=Ymlsc3FWpFoBJaa0ugjHplo/hrYPmvmoK4DeEQpgYammiKkv1fR6weIfjTizSJq0pBo6v/DstkKUTxTZmI73V9FDnCkNHbICinC7uy5TFOuA1zwfj417pdrruPKuJvdyPxva1Y53QxQSYPlnapKnDj/cNCANq/Co96FYYoCCJODEk+/4zQFfmJQBa5EuH9NZHp0mlyMPkCpb0d9aD9WrKNrJxiCjFrn2VoShFfkiPbZhFwazOVAMROL/vxm9RDCoi5f5XvQpYVaf58nW5CxhqtzeRixIhpBpEn3WzbZOyNjgwA4KB1KDktrh8ped8yeadi5huZQzpPNgIw1c1h94ag==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aXgxv1UQ8XHP0pYvvvEmWbMxmpUfxpkwIQb6aqzATciVVU1iIp+XxS9gCzrLV+Otix/2untvw+/1fFnssr3KpL1Te4NaX2kN/vmG5d3vu+PlxtYn6/ThAo1YyBV1ovOUYKsDzz7IWIP91BmuyOLnI27gYQDpWwaFutOxaAsTutYaucmiCFZBON5NDW9z6nhJcqmhd/OWbz5Vzms9xYZm7fKf194hvbVfqSA8Y3SBERlCFcDYbnR2edxEwdkJUSTJe08FOto+xdjqaqXoK2t2iFCPoNNKjfRZHQerVvH4hZ2QTQLBEB5LJ7pIxLZKLpquZ8zOXveeoLU/nBBHG8Ul3w==
  • 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>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>
  • Delivery-date: Tue, 26 Sep 2023 01:32:13 +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: AQHZ2U+b9I6Z5CIUPUulwo5PHkCPq7AsFjSAgABpjwA=
  • Thread-topic: [PATCH v6 07/13] xen/arm: Split MMU system SMP MM bringup code to mmu/smpboot.c

Hi Julien,

> On Sep 26, 2023, at 03:13, Julien Grall <julien@xxxxxxx> wrote:
> 
> Hi Henry,
> 
> On 28/08/2023 02:32, Henry Wang wrote:
>> Move the code related to secondary page table initialization, clear
>> boot page tables and the global variable definitions of these boot
>> page tables from arch/arm/mm.c to arch/arm/mmu/smpboot.c
>> Drop the "static" attribute of arm32 global variable cpu0_pgtable,
>> and declare it in the arm32 mm.h header, because this variable
>> will be used by both arch/arm/mm.c and arch/arm/mmu/smpboot.c.
> 
> I don't think you need to export cpu0_pgtable. You can instead replace use 
> with per_cpu(xen_pgtable, 0).

You mean using
```
memcpy(first, per_cpu(xen_pgtable, 0), PAGE_SIZE);
```
in the arm32 implementation of prepare_secondary_mm() in mmu/smpboot.c?

That sounds good to me and I will fix in v7.

> 
>> + */
>> +DEFINE_BOOT_PAGE_TABLE(boot_pgtable);
>> +#ifdef CONFIG_ARM_64
>> +DEFINE_BOOT_PAGE_TABLE(boot_first);
>> +DEFINE_BOOT_PAGE_TABLE(boot_first_id);
>> +#endif
>> +DEFINE_BOOT_PAGE_TABLE(boot_second_id);
>> +DEFINE_BOOT_PAGE_TABLE(boot_third_id);
>> +DEFINE_BOOT_PAGE_TABLE(boot_second);
>> +DEFINE_BOOT_PAGE_TABLES(boot_third, XEN_NR_ENTRIES(2));
> 
> Strictly speaking, boot_* are also used for CPU0 but not in C code. That 
> said, I am ok if there are moved here.
> 
> In the longer term, I would actually like to remove boot_*. This should 
> already be possible for arm64 (in fact they are not used for secondary CPU 
> bring-up). For arm32, it requires a bit more work.
> 
> Anyway, that's not a request for your series. :)

Let’s see if we can do that in 4.19 dev cycle then :)

> 
>> +    /* Set init_ttbr for this CPU coming up */
>> +    init_ttbr = __pa(first);
> 
> init_ttbr will only be used by smpboot.c and assembly code. So I think the 
> declaration needs to also be moved and the prototype moved to mmu/mm.h.

Ok, will do in v7.

Kind regards,
Henry

> 
> Cheers,
> 
> -- 
> Julien Grall


 


Rackspace

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