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

Re: [PATCH v7 0/2] xen/riscv: introduce identity mapping


  • To: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 19 Oct 2023 12:32:20 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=AtDp2LM+nS3gcYzkfoE3b59zdiir11Lx+bhpl0XuDdo=; b=JD4pLjkKP4bpPXrY1S1NHC9zYbW7gLeVwcrWFuRoqiOWVDm8ReaHuiwattvRjgGgsbZxlbWQ59eAE8ejvgKSB8xspDhE4fFbpKTdSAAY4BIWS4ZmhC7tFmkh+FBlkAUZZiycTDpAy7Ordsv4+xT9Uge7z6V/T7XydDmi6IwrZDgKEkYVFSXRNeZKLkd+d5eYzSIVUgY79PBAACiq59be6f5tE1n5vMPxGT4B4Q8NWesROsqYK78NV8XRSyveVClKqlIEXFMVAvBTYMfu0tCPw/d2yAzeNj13CJLs/mVHoHixb3hfpZPQxYB3rWhWsVA8yFC3VBYkh5wwK6e+0Z+3HQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DuGEonfQstDt3fjPUf6DB9dZQ536Qq52wx/1iIVZjxlaKCom4TOgc8rsCUfWoaV0rGxTkNnQzHwGqFoLG6FVfkfJAOVRbHM6+zUpF4wiMOXwbf6at3BI8piJW3u+gc9MBUqFoJ7lq1FdAaZon3ydcLondTrnV9H6qkwId4TZ96iqyXB2FVnA3TAL0lTObX1Sm2L2hTTj/Kb76+YFVzWNMiy4drzJaUQSpyf4kddcEJpCnjrj3AbdB/YgJO5a7wfg242pFWYh6g6Qf3iu2afPJnqqq3NrRFn/2VyclnRKzCLSU9QdLdaVravnz8I7+f4RO+MFhedSsgYno9QP5CoVyg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Bob Eshleman <bobbyeshleman@xxxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 19 Oct 2023 10:32:29 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 08.08.2023 17:14, Oleksii Kurochko wrote:
> The patch series introduces things necessary to implement identity mapping:
>   1. Make identity mapping for the entire Xen.
>   2. Enable MMU.
>   3. Jump to the virtual address world
>   4. Remove identity mapping.
> 
> Also current patch series introduces the calculation of physical offset before
> MMU is enabled as access to physical offset will be calculated wrong after
> MMU will be enabled because access to phys_off variable is PC-relative and
> in the case when linker address != load address, it will cause MMU fault.
> 
> The reason for this patch series can be found here:
> https://lore.kernel.org/xen-devel/4e336121-fc0c-b007-bf7b-430352563d55@xxxxxxxxxx/
> 
> ---
> Changes in V7:
>  - use srli instruction to be consistent with slli instruction in 
> turn_on_mmu()
> ---
> Changes in V6:
>   - Update calc_phys_offset() after rebase.
>   - Refactor turn_on_mmu() and a way how an argument of turn_on_mmu() is
>     calculated.
> ---
> Changes in V5:
>       - update the algo of identity mapping removing.
>       - introduce IDENT_AREA_SIZE.
>       - introduce turn_on_mmu() function to enable and switch from 1:1 
> mapping.
>       - fix typo in PGTBL_INITIAL_COUNT define.
>       - update the comment above PGTBL_INITIAL_COUNT.
>       - update prototype of calc_phys_offset(). now it returns phys_offset.
>       - declare phys_offset as static.
>       - save returned value of calc_phys_offset to register s2.
> ---
> Changes in V4:
>   - drop patch        [PATCH v3 1/3] xen/riscv: add SPDX tag to config.h as 
> it was
>     merged to staging
>   - remove definition of ARRAY_SIZE and ROUNDUP as <xen/macors.h> was 
> introduced where these macros are located now.
>       - update definition of PGTBL_INITIAL_COUNT
>       - update the commit message for patch 'xen/riscv: introduce identity 
> mapping'
>       - update the comments in head.S
>   - update the algo of identity mapping removing 
> ---
> Changes in V3:
>  - Update the patch series message.
>  - The following patches were merged to staging so droped from the patch 
> series:
>    * xen/riscv: add .sbss section to .bss
>    * xen/riscv: introduce reset_stack() function
>    * xen/riscv: move extern of cpu0_boot_stack to header
>    * xen/riscv: add SPDX tags
>  - move save/restore of a0/a1 registers from patch 4 to patch 2 ( numbers are
>    from the previous patch series version )
>  - add SPDX tag in config.h
>  - update definition of PGTBL_INITIAL_COUNT taking into account identity 
> mapping.
>  - refactor remove_identity_mapping() function.
>  - add explanatory comments in xen.lds.S and mm.c.
> ---
> Changes in V2:
>  - update the patch series message.
>  - drop patches from the previous version of the patch series:
>    * xen/riscv: add __ASSEMBLY__ guards". ( merged )
>    * xen/riscv: make sure that identity mapping isn't bigger then page size
>      ( entire Xen is 1:1 mapped so there is no need for the checks from the 
> patch )
>  - add .sbss.* and put it befor .bss* .
>  - move out reset_stack() to .text section.
>  - add '__ro_after_init' for phys_offset variable.
>  - add '__init' for calc_phys_offset().
>  - declaring variable phys_off as non static as it will be used in head.S.
>  - update definition of PGTBL_INITIAL_COUNT and the comment above.
>  - code style fixes.
>  - remove id_addrs array becase entire Xen is mapped.
>  - reverse condition for cycle inside remove_identity_mapping().
>  - fix page table walk in remove_identity_mapping().
>  - save hart_id and dtb_addr before call MMU related C functions
>  - use phys_offset variable instead of doing calcultations to get phys offset
>    in head.S file. ( it can be easily done as entire Xen is 1:1 mapped now )
>  - declare enable_muu() as __init.
>  - Update SPDX tags.
>  - Add Review-By/Suggested-By for some patches.
>  - code style fixes.
> 
> Oleksii Kurochko (2):
>   xen/riscv: introduce function for physical offset calculation
>   xen/riscv: introduce identity mapping

Acked-by: Jan Beulich <jbeulich@xxxxxxxx>





 


Rackspace

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