linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Using fixed LPI number for some Device ID
@ 2020-10-30 11:38 Dongjiu Geng
  2020-10-31  2:19 ` Dongjiu Geng
  0 siblings, 1 reply; 9+ messages in thread
From: Dongjiu Geng @ 2020-10-30 11:38 UTC (permalink / raw)
  To: Marc Zyngier; +Cc: Jason Cooper, Thomas Gleixner, linux-kernel

Hi Marc,
   Sorry to disturb you, Currently the LPI number is not fixed for the device. The LPI number is dynamically allocated start from 8092.
For two OS which shares the ITS, One OS needs to configure the device interrupt required by another OS, and the other OS uses a fixed interrupt
ID to respond the interrupt. Therefore, the LPI IRQ number of the device needed be fixed. I want to upstream this feature that allocate fixed
LPI number for the device that is specified through the DTS. do you agree?  Thanks!

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Using fixed LPI number for some Device ID
  2020-10-30 11:38 Using fixed LPI number for some Device ID Dongjiu Geng
@ 2020-10-31  2:19 ` Dongjiu Geng
  2020-10-31  2:59   ` Thomas Gleixner
  2020-10-31  9:55   ` Marc Zyngier
  0 siblings, 2 replies; 9+ messages in thread
From: Dongjiu Geng @ 2020-10-31  2:19 UTC (permalink / raw)
  To: Marc Zyngier; +Cc: Jason Cooper, Thomas Gleixner, linux-kernel

 Hi Marc,
    Sorry to disturb you, Currently the LPI number is not fixed for the device. The LPI number is dynamically allocated start from 8092.
 For two OS which shares the ITS, One OS needs to configure the device interrupt required by another OS, and the other OS uses a fixed interrupt
 ID to respond the interrupt. Therefore, the LPI IRQ number of the device needed be fixed. I want to upstream this feature that allocate fixed
 LPI number for the device that is specified through the DTS. What is your meaning?  Thanks

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Using fixed LPI number for some Device ID
  2020-10-31  2:19 ` Dongjiu Geng
@ 2020-10-31  2:59   ` Thomas Gleixner
  2020-10-31  3:10     ` Dongjiu Geng
  2020-10-31  9:55   ` Marc Zyngier
  1 sibling, 1 reply; 9+ messages in thread
From: Thomas Gleixner @ 2020-10-31  2:59 UTC (permalink / raw)
  To: Dongjiu Geng, Marc Zyngier; +Cc: Jason Cooper, linux-kernel

On Sat, Oct 31 2020 at 10:19, Dongjiu Geng wrote:
>  Hi Marc,
>     Sorry to disturb you, Currently the LPI number is not fixed for
>  the device. The LPI number is dynamically allocated start from 8092.
>  For two OS which shares the ITS, One OS needs to configure the device
>  interrupt required by another OS, and the other OS uses a fixed
>  interrupt ID to respond the interrupt. Therefore, the LPI IRQ number
>  of the device needed be fixed. I want to upstream this feature that
>  allocate fixed LPI number for the device that is specified through
>  the DTS. What is your meaning?  Thanks

What's the purpose of resending the same thing within less than 24
hours? Do you really expect maintainers to be available 24/7 and being
able to respond within less than a day?



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Using fixed LPI number for some Device ID
  2020-10-31  2:59   ` Thomas Gleixner
@ 2020-10-31  3:10     ` Dongjiu Geng
  2020-10-31  9:58       ` Marc Zyngier
  0 siblings, 1 reply; 9+ messages in thread
From: Dongjiu Geng @ 2020-10-31  3:10 UTC (permalink / raw)
  To: Thomas Gleixner, Marc Zyngier; +Cc: Jason Cooper, linux-kernel

On 2020/10/31 10:59, Thomas Gleixner wrote:
> On Sat, Oct 31 2020 at 10:19, Dongjiu Geng wrote:
>>  Hi Marc,
>>     Sorry to disturb you, Currently the LPI number is not fixed for
>>  the device. The LPI number is dynamically allocated start from 8092.
>>  For two OS which shares the ITS, One OS needs to configure the device
>>  interrupt required by another OS, and the other OS uses a fixed
>>  interrupt ID to respond the interrupt. Therefore, the LPI IRQ number
>>  of the device needed be fixed. I want to upstream this feature that
>>  allocate fixed LPI number for the device that is specified through
>>  the DTS. What is your meaning?  Thanks
> 
> What's the purpose of resending the same thing within less than 24
> hours? Do you really expect maintainers to be available 24/7 and being
  Sorry for the noise, Because Marc rarely uses the ARM email address,
  so I replace to use Marc's kernel.org address instead of ARM email address.



> able to respond within less than a day?
> 
> 
> .
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Using fixed LPI number for some Device ID
  2020-10-31  2:19 ` Dongjiu Geng
  2020-10-31  2:59   ` Thomas Gleixner
@ 2020-10-31  9:55   ` Marc Zyngier
  2020-11-03  5:22     ` Dongjiu Geng
  1 sibling, 1 reply; 9+ messages in thread
From: Marc Zyngier @ 2020-10-31  9:55 UTC (permalink / raw)
  To: Dongjiu Geng; +Cc: Jason Cooper, Thomas Gleixner, linux-kernel

Dongjiu,

On Sat, 31 Oct 2020 02:19:19 +0000,
Dongjiu Geng <gengdongjiu@huawei.com> wrote:
> 
> Hi Marc,
> Sorry to disturb you, Currently the LPI number is not fixed for the
> device. The LPI number is dynamically allocated start from 8092.
> For two OS which shares the ITS, One OS needs to configure the
> device interrupt required by another OS, and the other OS uses a
> fixed interrupt ID to respond the interrupt. Therefore, the LPI IRQ
> number of the device needed be fixed. I want to upstream this
> feature that allocate fixed LPI number for the device that is
> specified through the DTS. What is your meaning?  Thanks

I think you are starting from the wrong premises.

You can't "share" an ITS directly between two operating systems. The
ITS can only be controlled by a single operating system, because its
function goes way beyond allocating an LPI. How would you deal with
simple things such as masking an interrupt, which requires:

- Access to memory (configuration table)
- Access to the command queue (to insert an invalidation command)
- Access to MMIO registers (to kick the command queue into action)

all of which needs to be exclusive of concurrent modifications. How do
you propose this is implemented in a safe manner by two operating
systems which, by nature, distrust each other? Allocating LPIs is the
least of your problems, really.

If you need two concurrent OSs taking interrupts, use virtualisation.
That is its purpose. On your HW, you'll even get direct injection.

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Using fixed LPI number for some Device ID
  2020-10-31  3:10     ` Dongjiu Geng
@ 2020-10-31  9:58       ` Marc Zyngier
  2020-11-03  3:24         ` Dongjiu Geng
  0 siblings, 1 reply; 9+ messages in thread
From: Marc Zyngier @ 2020-10-31  9:58 UTC (permalink / raw)
  To: Dongjiu Geng; +Cc: Thomas Gleixner, Jason Cooper, linux-kernel

On Sat, 31 Oct 2020 03:10:24 +0000,
Dongjiu Geng <gengdongjiu@huawei.com> wrote:

[...]

>   Sorry for the noise, Because Marc rarely uses the ARM email address,
>   so I replace to use Marc's kernel.org address instead of ARM email address.

Rarely is quite the understatement. I left ARM over a year ago, so the
likelihood of me answering at this address in vanishingly small.

Maybe in a parallel universe? ;-)

	M.

-- 
Without deviation from the norm, progress is not possible.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Using fixed LPI number for some Device ID
  2020-10-31  9:58       ` Marc Zyngier
@ 2020-11-03  3:24         ` Dongjiu Geng
  0 siblings, 0 replies; 9+ messages in thread
From: Dongjiu Geng @ 2020-11-03  3:24 UTC (permalink / raw)
  To: Marc Zyngier; +Cc: Thomas Gleixner, Jason Cooper, linux-kernel

On 2020/10/31 17:58, Marc Zyngier wrote:
> On Sat, 31 Oct 2020 03:10:24 +0000,
> Dongjiu Geng <gengdongjiu@huawei.com> wrote:
> 
> [...]
> 
>>   Sorry for the noise, Because Marc rarely uses the ARM email address,
>>   so I replace to use Marc's kernel.org address instead of ARM email address.
> Rarely is quite the understatement. I left ARM over a year ago, so the
> likelihood of me answering at this address in vanishingly small.

 Thanks for the clarification.

> 
> Maybe in a parallel universe? ;-)
> 
> 	M.
> 
> -- Without deviation from the norm, progress is not possible. .

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Using fixed LPI number for some Device ID
  2020-10-31  9:55   ` Marc Zyngier
@ 2020-11-03  5:22     ` Dongjiu Geng
  2020-11-03  8:53       ` Marc Zyngier
  0 siblings, 1 reply; 9+ messages in thread
From: Dongjiu Geng @ 2020-11-03  5:22 UTC (permalink / raw)
  To: Marc Zyngier; +Cc: Jason Cooper, Thomas Gleixner, linux-kernel

On 2020/10/31 17:55, Marc Zyngier wrote:
> Dongjiu,
> 
> On Sat, 31 Oct 2020 02:19:19 +0000,
> Dongjiu Geng <gengdongjiu@huawei.com> wrote:
>>
>> Hi Marc,
>> Sorry to disturb you, Currently the LPI number is not fixed for the
>> device. The LPI number is dynamically allocated start from 8092.
>> For two OS which shares the ITS, One OS needs to configure the
>> device interrupt required by another OS, and the other OS uses a
>> fixed interrupt ID to respond the interrupt. Therefore, the LPI IRQ
>> number of the device needed be fixed. I want to upstream this
>> feature that allocate fixed LPI number for the device that is
>> specified through the DTS. What is your meaning?  Thanks
> 
> I think you are starting from the wrong premises.
> 
> You can't "share" an ITS directly between two operating systems. The
> ITS can only be controlled by a single operating system, because its
> function goes way beyond allocating an LPI. How would you deal with
> simple things such as masking an interrupt, which requires:
> 
> - Access to memory (configuration table)
> - Access to the command queue (to insert an invalidation command)
> - Access to MMIO registers (to kick the command queue into action)
> 
> all of which needs to be exclusive of concurrent modifications. How do
> you propose this is implemented in a safe manner by two operating
> systems which, by nature, distrust each other? Allocating LPIs is the
> least of your problems, really.
Yes, I agree with you it . But in my HW platform, using virtualization, the performance
deteriorates greatly.  So I distributed the I/O devices to different operation systems. During the startup of one OS,
interrupts are bound to different OS in one OS, which can be exclusive of concurrent modifications.

In fact it has some limitations as you said, such mask/enable/route Interrupts, If want to
mask interrupts, need to mask interrupts on the source device.

If you think it is not a common feature, I will used it as a local customization function and not upstream.

> 
> If you need two concurrent OSs taking interrupts, use virtualization.
> That is its purpose. On your HW, you'll even get direct injection.
> 
> Thanks,
> 
> 	M.
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Using fixed LPI number for some Device ID
  2020-11-03  5:22     ` Dongjiu Geng
@ 2020-11-03  8:53       ` Marc Zyngier
  0 siblings, 0 replies; 9+ messages in thread
From: Marc Zyngier @ 2020-11-03  8:53 UTC (permalink / raw)
  To: Dongjiu Geng; +Cc: Jason Cooper, Thomas Gleixner, linux-kernel

On 2020-11-03 05:22, Dongjiu Geng wrote:
> On 2020/10/31 17:55, Marc Zyngier wrote:
>> Dongjiu,
>> 
>> On Sat, 31 Oct 2020 02:19:19 +0000,
>> Dongjiu Geng <gengdongjiu@huawei.com> wrote:
>>> 
>>> Hi Marc,
>>> Sorry to disturb you, Currently the LPI number is not fixed for the
>>> device. The LPI number is dynamically allocated start from 8092.
>>> For two OS which shares the ITS, One OS needs to configure the
>>> device interrupt required by another OS, and the other OS uses a
>>> fixed interrupt ID to respond the interrupt. Therefore, the LPI IRQ
>>> number of the device needed be fixed. I want to upstream this
>>> feature that allocate fixed LPI number for the device that is
>>> specified through the DTS. What is your meaning?  Thanks
>> 
>> I think you are starting from the wrong premises.
>> 
>> You can't "share" an ITS directly between two operating systems. The
>> ITS can only be controlled by a single operating system, because its
>> function goes way beyond allocating an LPI. How would you deal with
>> simple things such as masking an interrupt, which requires:
>> 
>> - Access to memory (configuration table)
>> - Access to the command queue (to insert an invalidation command)
>> - Access to MMIO registers (to kick the command queue into action)
>> 
>> all of which needs to be exclusive of concurrent modifications. How do
>> you propose this is implemented in a safe manner by two operating
>> systems which, by nature, distrust each other? Allocating LPIs is the
>> least of your problems, really.
> Yes, I agree with you it . But in my HW platform, using
> virtualization, the performance
> deteriorates greatly.  So I distributed the I/O devices to different
> operation systems. During the startup of one OS,
> interrupts are bound to different OS in one OS, which can be exclusive
> of concurrent modifications.
> 
> In fact it has some limitations as you said, such mask/enable/route
> Interrupts, If want to
> mask interrupts, need to mask interrupts on the source device.
> 
> If you think it is not a common feature, I will used it as a local
> customization function and not upstream.

I don't think this makes sense for Linux, at least not in a way
that limits the way the kernel deals with simple things such as
LPI allocation.

We have systems in the tree where Linux route interrupts on behalf
of other agents in the system (see what the TI PRUSS subsystem does,
for example), and even direct interrupt injection is, to an extent,
doing that. This requires a standardised way for describing the routing,
the allocation, and potentially the life cycle of the interrupt.

But hardcoding the allocation based on some non-standard scheme
is not something I'm considering.

Thanks,

         M.
-- 
Jazz is not dead. It just smells funny...

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-11-03  8:54 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-30 11:38 Using fixed LPI number for some Device ID Dongjiu Geng
2020-10-31  2:19 ` Dongjiu Geng
2020-10-31  2:59   ` Thomas Gleixner
2020-10-31  3:10     ` Dongjiu Geng
2020-10-31  9:58       ` Marc Zyngier
2020-11-03  3:24         ` Dongjiu Geng
2020-10-31  9:55   ` Marc Zyngier
2020-11-03  5:22     ` Dongjiu Geng
2020-11-03  8:53       ` Marc Zyngier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).