All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@arm.com>
To: Julien Grall <julien.grall@arm.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Cc: xen-devel@lists.xenproject.org, Vijay Kilari <vijay.kilari@gmail.com>
Subject: Re: [RFC PATCH v2 03/26] ARM: GICv3 ITS: allocate device and collection table
Date: Fri, 20 Jan 2017 16:05:38 +0000	[thread overview]
Message-ID: <14ae9fa9-fa3d-18ef-86ba-48fd133c95b1@arm.com> (raw)
In-Reply-To: <77fdaa4f-70b4-40ea-abfa-39b261f209bf@arm.com>

Hi,

On 20/01/17 12:18, Julien Grall wrote:
> Hi Andre,
> 
> On 20/01/2017 12:27, Andre Przywara wrote:
>> On 20/01/17 11:12, Julien Grall wrote:
>>> Hello,
>>>
>>> On 04/01/2017 22:47, Stefano Stabellini wrote:
>>>> On Thu, 22 Dec 2016, Andre Przywara wrote:
>>>>> Each ITS maps a pair of a DeviceID (usually the PCI b/d/f triplet) and
>>>>> an EventID (the MSI payload or interrupt ID) to a pair of LPI number
>>>>> and collection ID, which points to the target CPU.
>>>>> This mapping is stored in the device and collection tables, which
>>>>> software
>>>>> has to provide for the ITS to use.
>>>>> Allocate the required memory and hand it the ITS.
>>>>> The maximum number of devices is limited to a compile-time constant
>>>>> exposed in Kconfig.
>>>>>
>>>>> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
>>>>> ---
>>>>>  xen/arch/arm/Kconfig          |   6 +++
>>>>>  xen/arch/arm/gic-its.c        | 114
>>>>> ++++++++++++++++++++++++++++++++++++++++++
>>>>>  xen/arch/arm/gic-v3.c         |   5 ++
>>>>>  xen/include/asm-arm/bitops.h  |   1 +
>>>>>  xen/include/asm-arm/gic-its.h |  51 ++++++++++++++++++-
>>>>>  5 files changed, 176 insertions(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
>>>>> index a7d941c..a369305 100644
>>>>> --- a/xen/arch/arm/Kconfig
>>>>> +++ b/xen/arch/arm/Kconfig
>>>>> @@ -59,6 +59,12 @@ config MAX_HOST_LPI_BITS
>>>>>            This can be overriden on the command line with the
>>>>> max_lpi_bits
>>>>>            parameter.
>>>>>
>>>>> +config MAX_ITS_PCI_BUSSES
>>>>> +        depends on HAS_ITS
>>>>> +        int "Number of PCI busses the ITS supports (4)"
>>>>> +        range 1 1024
>>>>> +        default "4"
>>>>
>>>> Given that any kind of devices can be behind an ITS, including non-PCI
>>>> devices, I think it is best to call this MAX_PHYS_ITS_DEVICES.
>>>
>>> I don't think we should limit the number of devices supported at
>>> compilation time. We aim to have a single Xen binary running on any
>>> board. The best would be to guess the number at runtime, but I would be
>>> fine with a command line options.
>>
>> Yes, so I changed this already to specify the number of devices and will
>> now also add a command line option.
>> So do you want to get rid of the Kconfig entirely to just go with
>> #define-ing the default value in the code?
>> Or do we still want to have this easily accessible way of changing the
>> default, at least for the first time to simplify experimentation?
> 
> Before answering to your questions, I'd like to understand why you need
> to have this value hardcoded or coming from the command line? Can't this
> be figured out at runtime?
> 
> Also what is this issue to use the number of ID bits presented in TYPER?
> Is it because your series is only handling flat table, so a large amount
> of memory would be used?

My understanding is that is the TYPER value just specifies the number of
device ID bits the ITS supports, without necessarily requiring software
to allocate tables to cover all theoretically possible devices. Instead
the expectation is that an ITS driver has some clue about how many
devices the system has or will need - which is not true in the (current)
Xen case, I am afraid.
A good ITS implementation might just implement all architected 32 bits,
which would require 32GB of a flat device table :-(
Also the indirect table feature is optional - and it happens to be that
it is _not_ available on the Cavium ThunderX, IIRC, despite it having
sparse device IDs.
And Linux limits all BASER tables to be at most 16MB.

So I think having some kind of upper limit would be good to have in any
case, whether this has to be a compile time option or not is another
question.

Cheers,
Andre.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-01-20 16:04 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-22 18:24 [RFC PATCH v2 00/26] arm64: Dom0 ITS emulation Andre Przywara
2016-12-22 18:24 ` [RFC PATCH v2 01/26] ARM: GICv3 ITS: parse and store ITS subnodes from hardware DT Andre Przywara
2016-12-22 18:24 ` [RFC PATCH v2 02/26] ARM: GICv3: allocate LPI pending and property table Andre Przywara
2017-01-04 21:09   ` Stefano Stabellini
2017-01-05 17:13     ` Andre Przywara
2017-01-05 17:52       ` Stefano Stabellini
2016-12-22 18:24 ` [RFC PATCH v2 03/26] ARM: GICv3 ITS: allocate device and collection table Andre Przywara
2017-01-04 21:47   ` Stefano Stabellini
2017-01-05 17:56     ` Andre Przywara
2017-01-20 11:12     ` Julien Grall
2017-01-20 11:27       ` Andre Przywara
2017-01-20 12:18         ` Julien Grall
2017-01-20 16:05           ` Andre Przywara [this message]
2017-01-20 18:14             ` Julien Grall
2016-12-22 18:24 ` [RFC PATCH v2 04/26] ARM: GICv3 ITS: map ITS command buffer Andre Przywara
2017-01-04 21:53   ` Stefano Stabellini
2016-12-22 18:24 ` [RFC PATCH v2 05/26] ARM: GICv3 ITS: introduce ITS command handling Andre Przywara
2017-01-04 22:08   ` Stefano Stabellini
2016-12-22 18:24 ` [RFC PATCH v2 06/26] ARM: GICv3 ITS: introduce device mapping Andre Przywara
2017-01-05  0:13   ` Stefano Stabellini
2017-01-13 12:31     ` Andre Przywara
2017-01-13 19:22       ` Stefano Stabellini
2017-01-13 12:31     ` Andre Przywara
2016-12-22 18:24 ` [RFC PATCH v2 07/26] ARM: GICv3 ITS: introduce host LPI array Andre Przywara
2017-01-05 18:56   ` Stefano Stabellini
2017-01-06 17:59     ` Andre Przywara
2017-01-06 20:20       ` Stefano Stabellini
2017-01-20 12:00         ` Julien Grall
2017-01-20 22:58           ` Stefano Stabellini
2016-12-22 18:24 ` [RFC PATCH v2 08/26] ARM: GICv3 ITS: map device and LPIs to the ITS on physdev_op hypercall Andre Przywara
2017-01-05 21:23   ` Stefano Stabellini
2016-12-22 18:24 ` [RFC PATCH v2 09/26] ARM: GICv3: introduce separate pending_irq structs for LPIs Andre Przywara
2017-01-05 21:36   ` Stefano Stabellini
2017-01-12 18:24     ` Andre Przywara
2017-01-12 19:15       ` Stefano Stabellini
2017-01-12 19:28         ` Andre Przywara
2016-12-22 18:24 ` [RFC PATCH v2 10/26] ARM: GICv3: forward pending LPIs to guests Andre Przywara
2017-01-05 22:10   ` Stefano Stabellini
2017-01-12 12:16     ` Andre Przywara
2017-01-12 18:57       ` Stefano Stabellini
2016-12-22 18:24 ` [RFC PATCH v2 11/26] ARM: GICv3: enable ITS and LPIs on the host Andre Przywara
2016-12-22 18:24 ` [RFC PATCH v2 12/26] ARM: vGICv3: handle virtual LPI pending and property tables Andre Przywara
2017-01-05 22:17   ` Stefano Stabellini
2016-12-22 18:24 ` [RFC PATCH v2 13/26] ARM: vGICv3: Handle disabled LPIs Andre Przywara
2017-01-05 22:28   ` [RFC PATCH v2 13/26] ARM: vGICv3: Handle disabled LPIso Stefano Stabellini
2016-12-22 18:24 ` [RFC PATCH v2 14/26] ARM: vGICv3: introduce basic ITS emulation bits Andre Przywara
2017-02-15  0:02   ` Stefano Stabellini
2016-12-22 18:24 ` [RFC PATCH v2 15/26] ARM: vITS: handle CLEAR command Andre Przywara
2016-12-22 18:24 ` [RFC PATCH v2 16/26] ARM: vITS: handle INT command Andre Przywara
2016-12-22 18:24 ` [RFC PATCH v2 17/26] ARM: vITS: handle MAPC command Andre Przywara
2016-12-22 18:24 ` [RFC PATCH v2 18/26] ARM: vITS: handle MAPD command Andre Przywara
2016-12-22 18:24 ` [RFC PATCH v2 19/26] ARM: vITS: handle MAPTI command Andre Przywara
2016-12-22 18:24 ` [RFC PATCH v2 20/26] ARM: vITS: handle MOVI command Andre Przywara
2016-12-22 18:24 ` [RFC PATCH v2 21/26] ARM: vITS: handle DISCARD command Andre Przywara
2016-12-22 18:24 ` [RFC PATCH v2 22/26] ARM: vITS: handle INV command Andre Przywara
2016-12-22 18:24 ` [RFC PATCH v2 23/26] ARM: vITS: handle INVALL command Andre Przywara
2017-01-05 22:50   ` Stefano Stabellini
2016-12-22 18:24 ` [RFC PATCH v2 24/26] ARM: vITS: create and initialize virtual ITSes for Dom0 Andre Przywara
2016-12-22 18:24 ` [RFC PATCH v2 25/26] ARM: vITS: create ITS subnodes for Dom0 DT Andre Przywara
2016-12-22 18:24 ` [RFC PATCH v2 26/26] ARM: vGIC: advertising LPI support Andre Przywara
2017-01-18  8:13 ` [RFC PATCH v2 00/26] arm64: Dom0 ITS emulation Vijay Kilari
2017-01-18  9:55   ` Julien Grall
2017-01-19 12:26 ` Vijay Kilari
2017-01-19 13:50   ` Andre Przywara
2017-01-19 14:32     ` Julien Grall
2017-01-19 14:45       ` Andre Przywara

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=14ae9fa9-fa3d-18ef-86ba-48fd133c95b1@arm.com \
    --to=andre.przywara@arm.com \
    --cc=julien.grall@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=vijay.kilari@gmail.com \
    --cc=xen-devel@lists.xenproject.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.