]> www.infradead.org Git - linux.git/commit
xen/privcmd: Add new syscall to get gsi from dev
authorJiqian Chen <Jiqian.Chen@amd.com>
Tue, 24 Sep 2024 06:14:37 +0000 (14:14 +0800)
committerJuergen Gross <jgross@suse.com>
Wed, 25 Sep 2024 07:54:55 +0000 (09:54 +0200)
commit2fae6bb7be320270801b3c3b040189bd7daa8056
tree764fe8161bd288ffe4855e98e878f78944e0a4cc
parentb166b8ab4189743a717cb93f50d6fcca3a46770d
xen/privcmd: Add new syscall to get gsi from dev

On PVH dom0, when passthrough a device to domU, QEMU and xl tools
want to use gsi number to do pirq mapping, see QEMU code
xen_pt_realize->xc_physdev_map_pirq, and xl code
pci_add_dm_done->xc_physdev_map_pirq, but in current codes, the gsi
number is got from file /sys/bus/pci/devices/<sbdf>/irq, that is
wrong, because irq is not equal with gsi, they are in different
spaces, so pirq mapping fails.
And in current linux codes, there is no method to get gsi
for userspace.

For above purpose, record gsi of pcistub devices when init
pcistub and add a new syscall into privcmd to let userspace
can get gsi when they have a need.

Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Message-ID: <20240924061437.2636766-4-Jiqian.Chen@amd.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
drivers/xen/Kconfig
drivers/xen/privcmd.c
drivers/xen/xen-pciback/pci_stub.c
include/uapi/xen/privcmd.h
include/xen/acpi.h