Re: [PATCH v3 34/43] hw/intc: Add LoongArch extioi interrupt controller(EIOINTC)

2022-05-13 Thread yangxiaojuan
On 2022/5/12 上午9:58, maobibo wrote: 在 2022/5/11 22:14, Richard Henderson 写道: On 5/11/22 02:54, yangxiaojuan wrote: On 2022/5/10 上午1:56, Richard Henderson wrote: +    case EXTIOI_IPMAP_START ... EXTIOI_IPMAP_END - 1: +    index = (offset - EXTIOI_IPMAP_START) >> 2; +   

Re: [PATCH v3 34/43] hw/intc: Add LoongArch extioi interrupt controller(EIOINTC)

2022-05-13 Thread yangxiaojuan
On 2022/5/10 上午1:56, Richard Henderson wrote: On 5/9/22 04:38, yangxiaojuan wrote: You are not considering CSR[0x420][49], which changes the format of this mapping. Thanks very much, I will consider the mapping format by read iocsr[0x420][49] like this: static uint64_t map_format(void) {   

Re: [PATCH v3 34/43] hw/intc: Add LoongArch extioi interrupt controller(EIOINTC)

2022-05-11 Thread maobibo
在 2022/5/11 22:14, Richard Henderson 写道: > On 5/11/22 02:54, yangxiaojuan wrote: >> >> On 2022/5/10 上午1:56, Richard Henderson wrote: >>> >> +    case EXTIOI_IPMAP_START ... EXTIOI_IPMAP_END - 1: >> +    index = (offset - EXTIOI_IPMAP_START) >> 2; >> +    s->ipmap[index] =

Re: [PATCH v3 34/43] hw/intc: Add LoongArch extioi interrupt controller(EIOINTC)

2022-05-11 Thread Richard Henderson
On 5/11/22 02:54, yangxiaojuan wrote: On 2022/5/10 上午1:56, Richard Henderson wrote: +    case EXTIOI_IPMAP_START ... EXTIOI_IPMAP_END - 1: +    index = (offset - EXTIOI_IPMAP_START) >> 2; +    s->ipmap[index] = val; +    break; Do you need to recompute the entire interrupt map

Re: [PATCH v3 34/43] hw/intc: Add LoongArch extioi interrupt controller(EIOINTC)

2022-05-11 Thread yangxiaojuan
On 2022/5/10 上午1:56, Richard Henderson wrote: +    case EXTIOI_IPMAP_START ... EXTIOI_IPMAP_END - 1: +    index = (offset - EXTIOI_IPMAP_START) >> 2; +    s->ipmap[index] = val; +    break; Do you need to recompute the entire interrupt map when ipmap changes? Sorry, could you

Re: [PATCH v3 34/43] hw/intc: Add LoongArch extioi interrupt controller(EIOINTC)

2022-05-10 Thread maobibo
在 2022/5/10 11:56, Richard Henderson 写道: > On 5/9/22 19:54, maobibo wrote: >> how about put address_space_iocsr as board rather than percpu since there is >> no concept >> of "cpu package". > > "cpu package" works ok as a device on the board. > > I don't know if it's possible to have the

Re: [PATCH v3 34/43] hw/intc: Add LoongArch extioi interrupt controller(EIOINTC)

2022-05-09 Thread Richard Henderson
On 5/9/22 19:54, maobibo wrote: how about put address_space_iocsr as board rather than percpu since there is no concept of "cpu package". "cpu package" works ok as a device on the board. I don't know if it's possible to have the iocsr address space controlled by the device, especially since

Re: [PATCH v3 34/43] hw/intc: Add LoongArch extioi interrupt controller(EIOINTC)

2022-05-09 Thread maobibo
在 2022/5/10 10:54, maobibo 写道: > > > 在 2022/5/10 02:25, Richard Henderson 写道: >> On 5/9/22 13:04, Peter Maydell wrote: >>> On Mon, 9 May 2022 at 18:56, Richard Henderson >>> wrote: I'm not 100% sure how this "Other configuration control register" should be handled, but

Re: [PATCH v3 34/43] hw/intc: Add LoongArch extioi interrupt controller(EIOINTC)

2022-05-09 Thread maobibo
在 2022/5/10 02:25, Richard Henderson 写道: > On 5/9/22 13:04, Peter Maydell wrote: >> On Mon, 9 May 2022 at 18:56, Richard Henderson >> wrote: >>> I'm not 100% sure how this "Other configuration control register" should be >>> handled, but >>> definitely not like this. >>> >>> I see you're

Re: [PATCH v3 34/43] hw/intc: Add LoongArch extioi interrupt controller(EIOINTC)

2022-05-09 Thread Richard Henderson
On 5/9/22 13:04, Peter Maydell wrote: On Mon, 9 May 2022 at 18:56, Richard Henderson wrote: I'm not 100% sure how this "Other configuration control register" should be handled, but definitely not like this. I see you're putting control of this register into loongarch_qemu_read in

Re: [PATCH v3 34/43] hw/intc: Add LoongArch extioi interrupt controller(EIOINTC)

2022-05-09 Thread Peter Maydell
On Mon, 9 May 2022 at 18:56, Richard Henderson wrote: > I'm not 100% sure how this "Other configuration control register" should be > handled, but > definitely not like this. > > I see you're putting control of this register into loongarch_qemu_read in > target/loongarch/cpu.c. Which, I suppose

Re: [PATCH v3 34/43] hw/intc: Add LoongArch extioi interrupt controller(EIOINTC)

2022-05-09 Thread Richard Henderson
On 5/9/22 04:38, yangxiaojuan wrote: You are not considering CSR[0x420][49], which changes the format of this mapping. Thanks very much, I will consider the mapping format by read iocsr[0x420][49] like this: static uint64_t map_format(void) {     LoongArchCPU *cpu;     CPULoongArchState

Re: [PATCH v3 34/43] hw/intc: Add LoongArch extioi interrupt controller(EIOINTC)

2022-05-09 Thread yangxiaojuan
On 2022/5/7 下午11:31, Richard Henderson wrote: +    if (level) { +    /* if not enable return false */ +    if (((s->enable[enable_index]) & (1 << enable_mask)) == 0) { +    return; +    } +    s->coreisr[cpu][coreisr_index] |= (1 << coreisr_mask); +   

Re: [PATCH v3 34/43] hw/intc: Add LoongArch extioi interrupt controller(EIOINTC)

2022-05-09 Thread yangxiaojuan
Hi Richard, On 2022/5/7 下午11:31, Richard Henderson wrote: On 4/29/22 05:07, Xiaojuan Yang wrote: +    int ipmap_mask = 0xff << ipmap_offset; ... +    int cpu_mask = 0xff << ipmap_offset; These two masks are redundant with +    ipnum = ((s->ipmap[ipmap_index] & ipmap_mask) >> ipmap_offset)

Re: [PATCH v3 34/43] hw/intc: Add LoongArch extioi interrupt controller(EIOINTC)

2022-05-07 Thread Richard Henderson
On 4/29/22 05:07, Xiaojuan Yang wrote: +int ipmap_mask = 0xff << ipmap_offset; ... +int cpu_mask = 0xff << ipmap_offset; These two masks are redundant with +ipnum = ((s->ipmap[ipmap_index] & ipmap_mask) >> ipmap_offset) & 0xf; ... +cpu = ((s->coremap[cpu_index] &

[PATCH v3 34/43] hw/intc: Add LoongArch extioi interrupt controller(EIOINTC)

2022-04-29 Thread Xiaojuan Yang
This patch realize the EIOINTC interrupt controller. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/intc/Kconfig| 3 + hw/intc/loongarch_extioi.c | 248 + hw/intc/meson.build| 1 + hw/intc/trace-events