On 2017-08-29 20:05, Lokesh Vutla wrote:
> 
> 
> On 8/29/2017 5:46 PM, Devshatwar, Nikhil wrote:
>>>
>>> On Tuesday 29 August 2017 03:03 PM, Jan Kiszka wrote:
>>>> On 2017-08-29 11:06, Lokesh Vutla wrote:
>>>>> Right now gicv3 driver assumes there is only one cluster and handles
>>>>> sgis based on this assumptions. This will fail for systems with more
>>>>> than 1 cluster. So add support for affinity based routing.
>>>>>
>>>>> Signed-off-by: Lokesh Vutla <[email protected]>
>>>>> ---
>>>>>  hypervisor/arch/arm-common/gic-v3.c | 66
>>>>> ++++++++++++++++++++++++++++++-------
>>>>>  1 file changed, 54 insertions(+), 12 deletions(-)
>>>>>
>>>>> diff --git a/hypervisor/arch/arm-common/gic-v3.c
>>>>> b/hypervisor/arch/arm-common/gic-v3.c
>>>>> index 7e03b64..cb8166c 100644
>>>>> --- a/hypervisor/arch/arm-common/gic-v3.c
>>>>> +++ b/hypervisor/arch/arm-common/gic-v3.c
>>>>> @@ -274,18 +274,36 @@ static int gic_cell_init(struct cell *cell)
>>>>>
>>>>>  static int gic_send_sgi(struct sgi *sgi)  {
>>>>> - u64 val;
>>>>> - u16 targets = sgi->targets;
>>>>> + u64 val, cpu;
>>>>> + unsigned long targets = 0, tar;
>>>>> + u64 mpidr, aff1 = 0, aff2 = 0, aff3 = 0;
>>>>> + struct cell *cell;
>>>>>
>>>>>   if (!is_sgi(sgi->id))
>>>>>           return -EINVAL;
>>>>>
>>>>> - if (sgi->routing_mode == 2)
>>>>> -         targets = 1 << phys_processor_id();
>>>>> + tar = sgi->targets;
>>>>> +
>>>>> + for_each_cell(cell) {
>>>>> +         for_each_cpu(cpu, cell->cpu_set) {
>>>>> +                 if (test_bit(cpu, &tar)) {
>>>>> +                         mpidr = per_cpu(cpu)->mpidr;
>>>>> +                         targets |= (1 << MPIDR_AFFINITY_LEVEL(mpidr,
>>> 0));
>>>>> +                         aff1 = MPIDR_AFFINITY_LEVEL(mpidr, 1);
>>>>> +                         aff2 = MPIDR_AFFINITY_LEVEL(mpidr, 2);
>>>>> +                         aff3 = MPIDR_AFFINITY_LEVEL(mpidr, 3);
>>>>> +                 }
>>>>> +         }
>>>>> + }
>>>>> +
>>
>> According to me, gic_send_sgi should be as dumb as simply writing the
>> Register with specified affinities and targets.
>>
>> Functions calling it should populate the correct values of affX and targets.
> 
> hmm..initially I did not want to touch irqchip.c as it might effect
> gicv2. After digging a bit more, I do agree that affinity based routing
> can be moved common place without effecting gicv2.
> 
> Jan,
>       Do you see any issue with this approach? If no, I will rework to handle
> affinity based routing in gic_handle_sgir_write() and arm_cpu_kick().

I still need to wrap my head around this completely, but I'm generally
all for (more) generic solutions.

Jan

-- 
Siemens AG, Corporate Technology, CT RDA ITP SES-DE
Corporate Competence Center Embedded Linux

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to