[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAF2vKzP0C1nEYTWRdWeAFKVUcuu3BkPD0FVA7yAS1rc-c=gs5A@mail.gmail.com>
Date: Wed, 12 Jun 2024 15:45:48 +0100
From: Frederic Griffoul <griffoul@...il.com>
To: Michal Koutný <mkoutny@...e.com>
Cc: Fred Griffoul <fgriffo@...zon.co.uk>, Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>, Alex Williamson <alex.williamson@...hat.com>,
Waiman Long <longman@...hat.com>, Zefan Li <lizefan.x@...edance.com>, Tejun Heo <tj@...nel.org>,
Johannes Weiner <hannes@...xchg.org>, Mark Rutland <mark.rutland@....com>, Marc Zyngier <maz@...nel.org>,
Oliver Upton <oliver.upton@...ux.dev>, Mark Brown <broonie@...nel.org>,
Ard Biesheuvel <ardb@...nel.org>, Joey Gouly <joey.gouly@....com>,
Ryan Roberts <ryan.roberts@....com>, Jeremy Linton <jeremy.linton@....com>,
Jason Gunthorpe <jgg@...pe.ca>, Yi Liu <yi.l.liu@...el.com>, Kevin Tian <kevin.tian@...el.com>,
Eric Auger <eric.auger@...hat.com>, Stefan Hajnoczi <stefanha@...hat.com>,
Christian Brauner <brauner@...nel.org>, Ankit Agrawal <ankita@...dia.com>,
Reinette Chatre <reinette.chatre@...el.com>, Ye Bin <yebin10@...wei.com>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
kvm@...r.kernel.org, cgroups@...r.kernel.org
Subject: Re: [PATCH v5 0/2] vfio/pci: add msi interrupt affinity support
MIchal
To be honest my initial idea was to store an affinity mask per vfio group, which
can be done in the privileged process setting the vfio group/device owner, and
later apply the mask to each interrupt of each device in the group.
It would still require to fix the affinity of all the interrupts if
the vfio group affinity is
changed (or deliberately ignore this case). And it did not match
exactly my use case
where I need the process handling the interrupts to sometimes be able
to change them
but always within the cpuset. So I would still need the current patch,
in addition to
a new ioctl() to set the affinity mask of a vfio group.
Br,
Fred
On Mon, Jun 10, 2024 at 5:31 PM Michal Koutný <mkoutny@...e.com> wrote:
>
> Hello Fred.
>
> On Mon, Jun 10, 2024 at 12:57:06PM GMT, Fred Griffoul <fgriffo@...zon.co.uk> wrote:
> > The usual way to configure a device interrupt from userland is to write
> > the /proc/irq/<irq>/smp_affinity or smp_affinity_list files. When using
> > vfio to implement a device driver or a virtual machine monitor, this may
> > not be ideal: the process managing the vfio device interrupts may not be
> > granted root privilege, for security reasons. Thus it cannot directly
> > control the interrupt affinity and has to rely on an external command.
>
> External commands something privileged? (I'm curious of an example how
> this is setup.)
>
> > The affinity argument must be a subset of the process cpuset, otherwise
> > an error -EPERM is returned.
>
> I'm not sure you want to look at task's cpuset mask for this purposes.
>
> Consider setups without cpuset or a change of (cpuset) mask anytime
> during lifetime of the task...
>
> Michal
Powered by blists - more mailing lists