[PATCH v2 0/6] target/loongarch: Code cleanup with function loongarch_map_address

Bibo Mao posted 6 patches 7 months ago
Failed in applying to current master (apply log)
There is a newer version of this series
target/loongarch/cpu_helper.c     | 176 ++------
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, 915 insertions(+), 889 deletions(-)
create mode 100644 target/loongarch/tcg/helper.h
[PATCH v2 0/6] target/loongarch: Code cleanup with function loongarch_map_address
Posted by Bibo Mao 7 months ago
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 are 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 the common part so that it can be used in KVM mode
also.

---
v1 ... v2:
  1. Remove CONFIG_TCG macro with file helper.h in patch 1
  2. Refresh spelling issues in patch 5
  3. Split original patch 4 into existing patch 4 and patch 5
  4. Add !kvm_enabled() in function loongarch_map_address(), tlb entries
     will not be searched in kvm mode
---
Bibo Mao (6):
  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: Add stub function loongarch_get_addr_from_tlb
  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     | 176 ++------
 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, 915 insertions(+), 889 deletions(-)
 create mode 100644 target/loongarch/tcg/helper.h


base-commit: 56c6e249b6988c1b6edc2dd34ebb0f1e570a1365
-- 
2.39.3
Re: [PATCH v2 0/6] target/loongarch: Code cleanup with function loongarch_map_address
Posted by Philippe Mathieu-Daudé 7 months ago
Hi Bibo,

On 17/4/25 05:51, 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 are 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 the common part so that it can be used in KVM mode
> also.

Can you add a cross-loongarch64-kvm-only job in
.gitlab-ci.d/crossbuilds.yml to ensure we cover
this configuration on our CI?

Thanks,

Phil.
Re: [PATCH v2 0/6] target/loongarch: Code cleanup with function loongarch_map_address
Posted by bibo mao 7 months ago

On 2025/4/17 下午6:03, Philippe Mathieu-Daudé wrote:
> Hi Bibo,
> 
> On 17/4/25 05:51, 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 are 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 the common part so that it can be used in KVM mode
>> also.
> 
> Can you add a cross-loongarch64-kvm-only job in
> .gitlab-ci.d/crossbuilds.yml to ensure we cover
> this configuration on our CI?
We want to do, the problem is that there is no popular OS (such as 
debian/fedora) supporting LoongArch now :(, so there is no CI for 
avocado or crossbuilds.yml still.

Regards
Bibo Mao
> 
> Thanks,
> 
> Phil.