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

Re: [PATCH v6 08/13] xen/arm: Fold mmu_init_secondary_cpu() to head.S


  • To: Ayan Kumar Halder <ayankuma@xxxxxxx>
  • From: Henry Wang <Henry.Wang@xxxxxxx>
  • Date: Thu, 31 Aug 2023 09:16:10 +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=2gV6o0mJXmYYenb52GGDLmMRJ9Hnzl1dtlqzeXo3x60=; b=kThBQnesmnX9byV0nSljq/qbIWYQS5OdzhVfVEqYnV7KRSaXWAFA6dE43UiWx0IPv7JWGhMyvM/KmNTdHNvd71+mYel58k+xya26WmEh2lhM9LCFZSQNE4ygy1GXq1AjcW1ripoamLYFv7Qw4daYxE0HdwrmMZEcqCUlqjLL1yy23/huA/NwsvNufmAcU5ZB8D8SjkCs3XizmzgGwaf89apP1VRX88KfCVhLYOW1jJHMkKs6njLNf8AACKsgggI7myTo0WKaBkNhzHZihuuKC0nmH9SqhlKWVbOX+DJxP5mloV/VhTIj3JdeJTTcR5deekraldSAmjYnvS7TYaINZA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hl/yNSPLOK+84dItMX+TXLNksSK0he8uBTqTAJ2L8qalQVnXbDGa2jw7YHDpWpiP+ZAcJFMCMY8DH0HdX4t78M2pcq92kADA+lCICElTd1BtmoNW8xTxVBOd2k4uX7ZebR7cU/AR1hkgnxSHeAag/cPKdyV3SvoeIjLBLTj4Fn7UIsq9TlzIyEaEX9StkAD/WNJpOcbA0brkolD8hRsbEJGZ7ZUYSREIjDDYKBWUl9ssFFzNuLgrrf3tnbTRo8wAW4sgpNdacmaIdCdtfxQ4bN5tX32eKIerSWU4KYTAr4Du5GTOGKe/ei580IkMYnq6Wq1k6ObY+UvrZYgN3XKVeg==
  • 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>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Thu, 31 Aug 2023 09:16:29 +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+hoB0xrFr/oU+WCBP7wHF2i7AEJAQAgAAA3gA=
  • Thread-topic: [PATCH v6 08/13] xen/arm: Fold mmu_init_secondary_cpu() to head.S

Hi Ayan,

> On Aug 31, 2023, at 17:12, Ayan Kumar Halder <ayankuma@xxxxxxx> wrote:
> 
> Hi Henry,
> 
> On 28/08/2023 02:32, Henry Wang wrote:
>> 
>> diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
>> index 33b038e7e0..39218cf15f 100644
>> --- a/xen/arch/arm/arm32/head.S
>> +++ b/xen/arch/arm/arm32/head.S
>> @@ -83,6 +83,25 @@
>>          isb
>>  .endm
>> 
>> +/*
>> + * Enforce Xen page-tables do not contain mapping that are both
>> + * Writable and eXecutables.
>> + *
>> + * This should be called on each secondary CPU.
>> + */
>> +.macro pt_enforce_wxn tmp
>> +        mrc   CP32(\tmp, HSCTLR)
>> +        orr   \tmp, \tmp, #SCTLR_Axx_ELx_WXN
>> +        dsb
>> +        mcr   CP32(\tmp, HSCTLR)
>> +        /*
>> +         * The TLBs may cache SCTLR_EL2.WXN. So ensure it is synchronized
>> +         * before flushing the TLBs.
>> +         */
>> +        isb
>> +        flush_xen_tlb_local \tmp
>> +.endm
>> +
>>  /*
>>   * Common register usage in this file:
>>   *   r0  -
>> @@ -254,6 +273,7 @@ secondary_switched:
>>          /* Use a virtual address to access the UART. */
>>          mov_w r11, EARLY_UART_VIRTUAL_ADDRESS
>>  #endif
>> +        pt_enforce_wxn
>>  
> 
> Can you move ^^^ to before "#ifdef CONFIG_EARLY_PRINTK" so that the MMU 
> related functionality are bundled together?
> 
> Also AFAIU, mov_w has not effect on pt_enforce_wxn().
> 
> So that I can create a function "enable_secondary_cpu_mm()" - similar to one 
> you introduced for arm64

Sure, I am good with this if other maintainers do not have any objections.

Kind regards,
Henry

> 
> /* This will contain all the MMU related function for secondary cpu */
> 
> enable_secondary_cpu_mm:
> 
> bl    create_page_tables
> 
> mov_w lr, secondary_switched
> 
> ....
> 
> flush_xen_tlb_local r0
> 
> pt_enforce_wxn r0
> 
> ENDPROC(enable_secondary_cpu_mm)
> 
> 
> - Ayan




 


Rackspace

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