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

There are some enhancement 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.
---
v3 ... v4:
  1. Use vaddr type in get_physical_address() and its calling functions
     in separate patch.
  2. Use MMUAccessType type in function loongarch_map_tlb_entry().
  3. Rename structure name mmy_context with MMUContext.
  4. Use macro sextract64() to signed-extension 48 bit virtual address
  5. Add missing variable assignment in old patch 07.
  6. Fix skipping TLB flush logic in old patch 15, it depends on both
     pte lo0 and lo1 can be skipped.

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 (19):
  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 entry with STLB
  target/loongarch: Add header file cpu-mmu.h
  target/loongarch: Add enum type TLBRet definition
  target/loongarch: Use vaddr in get_physical_address()
  target/loongarch: Use MMUAccessType in loongarch_map_tlb_entry()
  target/loongarch: Add common function loongarch_check_pte()
  target/loongarch: Use loongarch_check_pte in
    loongarch_page_table_walker
  target/loongarch: Use MMUConext in loongarch_map_tlb_entry()
  target/loongarch: Use MMUContext in loongarch_get_addr_from_tlb
  target/loongarch: Use MMUContext in loongarch_map_address()
  target/loongarch: Use MMUContext in get_physical_address()
  target/loongarch: Track user space 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           |  42 +++++
 target/loongarch/cpu.c               | 181 +++++++++---------
 target/loongarch/cpu.h               |  25 +--
 target/loongarch/cpu_helper.c        | 145 +++++++++-----
 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 |   7 +-
 target/loongarch/tcg/tlb_helper.c    | 272 +++++++++++++++------------
 10 files changed, 399 insertions(+), 299 deletions(-)
 create mode 100644 target/loongarch/cpu-mmu.h


base-commit: c017386f28c03a03b8f14444f8671d3d8f7180fe
-- 
2.39.3



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

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

Thread overview: 36+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-30  3:01 [PATCH v4 00/19] target/loongarch: Enhancement about tcg mmu Bibo Mao
2025-07-30  3:01 ` [PATCH v4 01/19] target/loongarch: Move some function definition to kvm directory Bibo Mao
2025-09-01  6:50   ` Philippe Mathieu-Daudé
2025-07-30  3:01 ` [PATCH v4 02/19] target/loongarch: Define function loongarch_cpu_post_init as static Bibo Mao
2025-07-30  3:01 ` [PATCH v4 03/19] target/loongarch: Set page size in TLB entry with STLB Bibo Mao
2025-08-28  2:38   ` Bibo Mao
2025-08-29  1:27   ` gaosong
2025-07-30  3:01 ` [PATCH v4 04/19] target/loongarch: Add header file cpu-mmu.h Bibo Mao
2025-09-01  6:47   ` Philippe Mathieu-Daudé
2025-07-30  3:01 ` [PATCH v4 05/19] target/loongarch: Add enum type TLBRet definition Bibo Mao
2025-07-30  5:53   ` Richard Henderson
2025-09-01  6:47   ` Philippe Mathieu-Daudé
2025-07-30  3:01 ` [PATCH v4 06/19] target/loongarch: Use vaddr in get_physical_address() Bibo Mao
2025-07-30  5:54   ` Richard Henderson
2025-09-01  6:46   ` Philippe Mathieu-Daudé
2025-07-30  3:01 ` [PATCH v4 07/19] target/loongarch: Use MMUAccessType in loongarch_map_tlb_entry() Bibo Mao
2025-07-30  5:54   ` Richard Henderson
2025-09-01  6:50   ` Philippe Mathieu-Daudé
2025-07-30  3:01 ` [PATCH v4 08/19] target/loongarch: Add common function loongarch_check_pte() Bibo Mao
2025-07-30  5:55   ` Richard Henderson
2025-07-30  3:01 ` [PATCH v4 09/19] target/loongarch: Use loongarch_check_pte in loongarch_page_table_walker Bibo Mao
2025-07-30  3:01 ` [PATCH v4 10/19] target/loongarch: Use MMUConext in loongarch_map_tlb_entry() Bibo Mao
2025-07-30  5:57   ` Richard Henderson
2025-07-30  3:01 ` [PATCH v4 11/19] target/loongarch: Use MMUContext in loongarch_get_addr_from_tlb Bibo Mao
2025-07-30  5:58   ` Richard Henderson
2025-07-30  3:01 ` [PATCH v4 12/19] target/loongarch: Use MMUContext in loongarch_map_address() Bibo Mao
2025-07-30  6:06   ` Richard Henderson
2025-07-30  3:08 ` [PATCH v4 13/19] target/loongarch: Use MMUContext in get_physical_address() Bibo Mao
2025-07-30  6:09   ` Richard Henderson
2025-07-30  3:10 ` [PATCH v4 14/19] target/loongarch: Track user space address accessed in kernel mode Bibo Mao
2025-07-30  3:10 ` [PATCH v4 15/19] target/loongarch: Use correct address when flush tlb Bibo Mao
2025-07-30  6:12   ` Richard Henderson
2025-07-30  3:11 ` [PATCH v4 16/19] target/loongarch: Use mmu idx bitmap method " Bibo Mao
2025-07-30  3:11 ` [PATCH v4 17/19] target/loongarch: Add parameter tlb pointer with fill_tlb_entry Bibo Mao
2025-07-30  3:12 ` [PATCH v4 18/19] target/loongarch: Reduce TLB flush with helper_tlbwr Bibo Mao
2025-07-30  3:13 ` [PATCH v4 19/19] 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).