mbox series

[0/5] target/loongarch: Code cleanup with function loongarch_map_address

Message ID 20250414012528.4075447-1-maobibo@loongson.cn (mailing list archive)
Headers show
Series target/loongarch: Code cleanup with function loongarch_map_address | expand

Message

Bibo Mao April 14, 2025, 1:25 a.m. UTC
Get physical address from virtual address is important for qmp command to
dump memory content. In TCG mode, it searches TLB tables firstly and
then do page table walker. In KVM mode, there is no TLB tables and page
table walker is used directly.

Here TLB tables searching is moved to directory tcg, and code about page
table walker is put in common part so that it can be used in KVM mode
also.

Bibo Mao (5):
  target/loongarch: Move header file helper.h to directory tcg
  target/loongarch: Add function loongarch_get_addr_from_tlb
  target/loongarch: Move function get_dir_base_width to common directory
  target/loongarch: Set function loongarch_map_address() with common
    code
  target/loongarch: Move function loongarch_tlb_search to directory tcg

 target/loongarch/cpu_helper.c     | 173 ++-----
 target/loongarch/helper.h         | 720 +----------------------------
 target/loongarch/internals.h      |  14 +-
 target/loongarch/tcg/helper.h     | 722 ++++++++++++++++++++++++++++++
 target/loongarch/tcg/tlb_helper.c | 172 +++++--
 5 files changed, 913 insertions(+), 888 deletions(-)
 create mode 100644 target/loongarch/tcg/helper.h


base-commit: 56c6e249b6988c1b6edc2dd34ebb0f1e570a1365

Comments

Philippe Mathieu-Daudé April 14, 2025, 10:52 a.m. UTC | #1
Hi Bibo,

On 14/4/25 03:25, Bibo Mao wrote:
> Get physical address from virtual address is important for qmp command to
> dump memory content. In TCG mode, it searches TLB tables firstly and
> then do page table walker. In KVM mode, there is no TLB tables and page
> table walker is used directly.
> 
> Here TLB tables searching is moved to directory tcg, and code about page
> table walker is put in common part so that it can be used in KVM mode
> also.
> 
> Bibo Mao (5):
>    target/loongarch: Move header file helper.h to directory tcg
>    target/loongarch: Add function loongarch_get_addr_from_tlb
>    target/loongarch: Move function get_dir_base_width to common directory
>    target/loongarch: Set function loongarch_map_address() with common
>      code
>    target/loongarch: Move function loongarch_tlb_search to directory tcg

Please check if changes in patches 4 & 5 need adjustment.
Otherwise for the series:
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>