qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 00/17] target/loongarch: Enhancement about tcg mmu
@ 2025-07-25  1:37 Bibo Mao
  2025-07-25  1:37 ` [PATCH v3 01/17] target/loongarch: Move some function definition to kvm directory Bibo Mao
                   ` (16 more replies)
  0 siblings, 17 replies; 34+ messages in thread
From: Bibo Mao @ 2025-07-25  1:37 UTC (permalink / raw)
  To: Song Gao; +Cc: Jiaxun Yang, qemu-devel

There is some enhance about LoongArch mmu tcg emulation, add new
header file cpu-mmu.h and function loongarch_check_pte(). Function
loongarch_check_pte() can work on both TLB entry and pte entry.

This patchset mainly is code cleanup and enhancement, its main
purpose is to work for hardware page table walk emluation in future.
---
v2 ... v3:
  1. Track user space page accessed in kernel mode, since mmu idx usage
     is different between QEMU TLB and LoongArch TLB emulation.
  2. Add 48 bit to 64 bit signed extension conversion with virtual address,
     since QEMU TLB use 64 bit address, LoongArch TLB is 48 bit.
  3. Optimization with LoongArch TLB update, do not flush QEMU TLB if
     updated TLB entry is the same or invalid.
  4. Optimization with new LoongArch TLB entry selection, invalid entry
     or different ASID with higher priority than the random method.
v1 ... v2:
  1. Rename structure name pte_context with mmu_context, since it
     can be extended to get DMW or DA mmu idx and window size
  2. Add fine-grained tlb flush method
  3. Fix some issues in function invalidate_tlb_entry() to flush tlb,
     such as bitmap method with mmu idx, page size and address
     calculation
---
Bibo Mao (17):
  target/loongarch: Move some function definition to kvm directory
  target/loongarch: Define function loongarch_cpu_post_init as static
  target/loongarch: Set page size in TLB misc with STLB
  target/loongarch: Add header file cpu-mmu.h
  target/loongarch: Add common function loongarch_check_pte()
  target/loongarch: Use loongarch_check_pte() with page table walking
  target/loongarch: Add parameter mmu_context with
    loongarch_page_table_walker
  target/loongarch: Add parameter mmu_context with
    loongarch_map_tlb_entry
  target/loongarch: Add parameter mmu_context with
    loongarch_get_addr_from_tlb
  target/loongarch: Add parameter mmu_context with loongarch_map_address
  target/loongarch: Add parameter mmu_context with get_physical_address
  target/loongarch: Track user mode address accessed in kernel mode
  target/loongarch: Use correct address when flush tlb
  target/loongarch: Use mmu idx bitmap method when flush tlb
  target/loongarch: Add parameter tlb pointer with fill_tlb_entry
  target/loongarch: Reduce TLB flush with helper_tlbwr
  target/loongarch: Update TLB index selection method

 hw/loongarch/virt.c                  |   1 +
 target/loongarch/cpu-mmu.h           |  41 ++++
 target/loongarch/cpu.c               | 181 +++++++++---------
 target/loongarch/cpu.h               |  22 +--
 target/loongarch/cpu_helper.c        | 131 ++++++++-----
 target/loongarch/internals.h         |  20 --
 target/loongarch/kvm/kvm_loongarch.h |   4 +-
 target/loongarch/tcg/csr_helper.c    |   1 +
 target/loongarch/tcg/tcg_loongarch.h |   4 +-
 target/loongarch/tcg/tlb_helper.c    | 272 ++++++++++++++++-----------
 10 files changed, 395 insertions(+), 282 deletions(-)
 create mode 100644 target/loongarch/cpu-mmu.h


base-commit: 9e601684dc24a521bb1d23215a63e5c6e79ea0bb
-- 
2.39.3



^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2025-07-28  6:09 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-25  1:37 [PATCH v3 00/17] target/loongarch: Enhancement about tcg mmu Bibo Mao
2025-07-25  1:37 ` [PATCH v3 01/17] target/loongarch: Move some function definition to kvm directory Bibo Mao
2025-07-25 23:37   ` Richard Henderson
2025-07-25  1:37 ` [PATCH v3 02/17] target/loongarch: Define function loongarch_cpu_post_init as static Bibo Mao
2025-07-25 23:38   ` Richard Henderson
2025-07-25  1:37 ` [PATCH v3 03/17] target/loongarch: Set page size in TLB misc with STLB Bibo Mao
2025-07-25  1:37 ` [PATCH v3 04/17] target/loongarch: Add header file cpu-mmu.h Bibo Mao
2025-07-26  1:10   ` Richard Henderson
2025-07-26  1:16   ` Richard Henderson
2025-07-28  3:08     ` Bibo Mao
2025-07-25  1:37 ` [PATCH v3 05/17] target/loongarch: Add common function loongarch_check_pte() Bibo Mao
2025-07-26  1:19   ` Richard Henderson
2025-07-28  3:15     ` Bibo Mao
2025-07-28  5:07       ` Richard Henderson
2025-07-25  1:37 ` [PATCH v3 06/17] target/loongarch: Use loongarch_check_pte() with page table walking Bibo Mao
2025-07-26  1:20   ` Richard Henderson
2025-07-25  1:37 ` [PATCH v3 07/17] target/loongarch: Add parameter mmu_context with loongarch_page_table_walker Bibo Mao
2025-07-26  1:31   ` Richard Henderson
2025-07-28  3:16     ` Bibo Mao
2025-07-25  1:37 ` [PATCH v3 08/17] target/loongarch: Add parameter mmu_context with loongarch_map_tlb_entry Bibo Mao
2025-07-25  1:37 ` [PATCH v3 09/17] target/loongarch: Add parameter mmu_context with loongarch_get_addr_from_tlb Bibo Mao
2025-07-25  1:37 ` [PATCH v3 10/17] target/loongarch: Add parameter mmu_context with loongarch_map_address Bibo Mao
2025-07-25  1:37 ` [PATCH v3 11/17] target/loongarch: Add parameter mmu_context with get_physical_address Bibo Mao
2025-07-25  1:37 ` [PATCH v3 12/17] target/loongarch: Track user mode address accessed in kernel mode Bibo Mao
2025-07-25  1:37 ` [PATCH v3 13/17] target/loongarch: Use correct address when flush tlb Bibo Mao
2025-07-26  1:45   ` Richard Henderson
2025-07-28  3:22     ` Bibo Mao
2025-07-28  5:09       ` Richard Henderson
2025-07-28  6:05         ` Bibo Mao
2025-07-25  1:37 ` [PATCH v3 14/17] target/loongarch: Use mmu idx bitmap method " Bibo Mao
2025-07-25  1:47 ` [PATCH v3 15/17] target/loongarch: Add parameter tlb pointer with fill_tlb_entry Bibo Mao
2025-07-26  1:47   ` Richard Henderson
2025-07-25  1:47 ` [PATCH v3 16/17] target/loongarch: Reduce TLB flush with helper_tlbwr Bibo Mao
2025-07-25  1:48 ` [PATCH v3 17/17] target/loongarch: Update TLB index selection method Bibo Mao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).