[PATCH v8 0/2] Fix LoongArch extioi coreisr accessing

Xiaojuan Yang posted 2 patches 1 year, 6 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20221021015307.2570844-1-yangxiaojuan@loongson.cn
Maintainers: Xiaojuan Yang <yangxiaojuan@loongson.cn>, Song Gao <gaosong@loongson.cn>
hw/intc/loongarch_extioi.c      | 41 ++++++++++++++++++---------------
hw/intc/trace-events            |  3 +--
target/loongarch/iocsr_helper.c | 19 ++++++++-------
3 files changed, 35 insertions(+), 28 deletions(-)
[PATCH v8 0/2] Fix LoongArch extioi coreisr accessing
Posted by Xiaojuan Yang 1 year, 6 months ago
When cpu read or write extioi COREISR reg, it should access
the reg belonged to itself, so the cpu index of 's->coreisr'
is current cpu number. Using MemTxAttrs' requester_id to get 
the cpu index.

Changes for v8:
1. Move the iocsr_helper changes to the second patch.
2. Change the argument of GET_MEMTXATTRS() macro to env.

Changes for v7: 
Split v6 patch to two patches:
1. Converting the MemoryRegionOps read/write handlers
   to _with_attrs in LoongArch extioi emulation.
2. Fetching the CPU id from attrs.requester_id.

Changes for v6: 
Only using MemTxAttrs' requester_id to get the cpu index
in LoongArch extioi access function. we do not based on  
the 'MemTxAttrs requester_type patch' so far, and when that
patch merged we will apply it quickly.

Changes for v5: 
These changes are following Philippe Mathieu-Daude's advice.
1. Add trace_bad_read/write function when MemTxAttrs type is
   not MTRT_CPU in extioi_read/write().
2. Separate 'remove unused extioi system memory region' to a
   single patch.

Changes for v4: 
Add 'reviewed-by' tag in fixing ipi patch, and other changes
are the same as v3. 
1. Remove the memmap table patch in this series, it
   will apply until we have more than one machinestate.
2. Using MemTxAttrs' requester_type and requester_id
   to get current cpu index in loongarch extioi regs
   emulation.
   This patch based on: 
   20220927141504.3886314-1-alex.bennee@linaro.org
3. Rewrite the commit message of fixing ipi patch, and 
   add reviewed by tag in the patch.

Changes for v3: 
1. Remove the memmap table patch in this series, it
   will apply until we have more than one machinestate.
2. Using MemTxAttrs' requester_type and requester_id
   to get current cpu index in loongarch extioi regs
   emulation.
   This patch based on: 
   20220927141504.3886314-1-alex.bennee@linaro.org
3. Rewrite the commit message of fixing ipi patch, and 
   this patch has been reviewed.

Changes for v2: 
1. Adjust the position of 'PLATFORM' element in memmap table

Changes for v1: 
1. Add memmap table for LoongArch virt machine
2. Fix LoongArch extioi function
3. Fix LoongArch ipi device emulation

Xiaojuan Yang (2):
  hw/intc: Convert the memops to with_attrs in LoongArch extioi
  hw/intc: Fix LoongArch extioi coreisr accessing

 hw/intc/loongarch_extioi.c      | 41 ++++++++++++++++++---------------
 hw/intc/trace-events            |  3 +--
 target/loongarch/iocsr_helper.c | 19 ++++++++-------
 3 files changed, 35 insertions(+), 28 deletions(-)

-- 
2.31.1
Re: [PATCH v8 0/2] Fix LoongArch extioi coreisr accessing
Posted by Richard Henderson 1 year, 6 months ago
On 10/21/22 11:53, Xiaojuan Yang wrote:
> When cpu read or write extioi COREISR reg, it should access
> the reg belonged to itself, so the cpu index of 's->coreisr'
> is current cpu number. Using MemTxAttrs' requester_id to get
> the cpu index.
> 
> Changes for v8:
> 1. Move the iocsr_helper changes to the second patch.
> 2. Change the argument of GET_MEMTXATTRS() macro to env.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~