From: Marc Zyngier <maz@kernel.org>
To: Dongjiu Geng <gengdongjiu@huawei.com>
Cc: Jason Cooper <jason@lakedaemon.net>,
Thomas Gleixner <tglx@linutronix.de>,
linux-kernel@vger.kernel.org
Subject: Re: Using fixed LPI number for some Device ID
Date: Tue, 03 Nov 2020 08:53:55 +0000 [thread overview]
Message-ID: <0882fef907e3b7bf9f23f941474c109f@kernel.org> (raw)
In-Reply-To: <8ff6a30a-b51f-f9f0-4a18-307948f3519b@huawei.com>
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...
prev parent reply other threads:[~2020-11-03 8:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0882fef907e3b7bf9f23f941474c109f@kernel.org \
--to=maz@kernel.org \
--cc=gengdongjiu@huawei.com \
--cc=jason@lakedaemon.net \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox