, add
handlers for them to support resizing the size of BARs.
Signed-off-by: Jiqian Chen
---
Hi all,
v6->v7 changes:
* Deleted codes that add register for PCI_REBAR_CAP, and added comments to
explain why.
* Added comments to explain why use "continue" when fail to add register f
, add
handlers for them to support resizing the size of BARs.
Signed-off-by: Jiqian Chen
---
Hi all,
v5->v6 changes:
* Changed "1UL" to "1ULL" in PCI_REBAR_CTRL_SIZE idefinition for 32 bit
architecture.
* In rebar_ctrl_write used "bar - pdev->vpci->header.bars&q
, add
handlers for them to support resizing the size of BARs.
Signed-off-by: Jiqian Chen
---
Hi all,
v4->v5 changes:
* Called pci_size_mem_bar in rebar_ctrl_write to get addr and size of BAR
instead of setting
their values directly after writing new size to hardware.
* Changed from &qu
, add
handlers for them to support resizing the size of BARs.
Signed-off-by: Jiqian Chen
---
Hi all,
v3->v4 changes:
* Removed PCI_REBAR_CAP_SIZES since it was not needed, and added
PCI_REBAR_CAP_SHIFT and PCI_REBAR_CTRL_SIZES.
* Added parameter resizable_sizes to struct vpci_bar to cache the
, add
handlers for them to support resizing the size of BARs.
Signed-off-by: Jiqian Chen
---
Hi all,
v2->v3 changes:
* Used "bar->enabled" to replace "pci_conf_read16(pdev->sbdf, PCI_COMMAND) &
PCI_COMMAND_MEMORY",
and added comments why it needs this check.
* A
, add
handlers for them to support resizing the size of BARs.
Signed-off-by: Jiqian Chen
---
Hi all,
v2->v1 changes:
*In rebar_ctrl_write, to check if memory decoding is enabled, and added
some checks for the type of Bar.
*Added vpci_hw_write32 to handle PCI_REBAR_CAP's write, since ther
o add these two registers and their
corresponding handler into vpci.
PCI_REBAR_CAP is RO, only provide reading.
PCI_REBAR_CTRL only has bar size is RW, so add write function to support
setting the new size.
Signed-off-by: Jiqian Chen
---
xen/drivers/vpci/Makefile | 2 +-
xen/drivers/vpci/re
To solve above problem, use new interface of Xen, xc_pcidev_get_gsi to get
gsi and use xc_physdev_map_pirq_gsi to map pirq when dom0 is PVH.
Signed-off-by: Jiqian Chen
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
---
Hi All,
This is v10 to support passthrough on Xen when dom0 is PVH.
To solve above problem, use new interface of Xen, xc_pcidev_get_gsi to get
gsi and use xc_physdev_map_pirq_gsi to map pirq when dom0 is PVH.
Signed-off-by: Jiqian Chen
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
---
Hi All,
This is v9 to support passthrough on Xen when dom0 is PVH.
v8-
To solve above problem, use new interface of Xen, xc_pcidev_get_gsi to get
gsi and use xc_physdev_map_pirq_gsi to map pirq when dom0 is PVH.
Signed-off-by: Jiqian Chen
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
---
Hi All,
This is v8 to support passthrough on Xen when dom0 is PVH.
v7-
scall to get gsi from dev")
Reported-by: Marek Marczykowski-Górecki
Signed-off-by: Jiqian Chen
---
v3->v4 changes:
Added stubs for xen_acpi_register_get_gsi_func and xen_acpi_get_gsi_from_sbdf
when "!CONFIG_XEN_DOM0" in acpi.h to fix 32-bit x86 build error.
v2->v3 changes:
Adde
scall to get gsi from dev")
Reported-by: Marek Marczykowski-Górecki
Signed-off-by: Jiqian Chen
---
v2->v3 changes:
Added rwlock get_gsi_from_sbdf_lock to avoid races.
Called xen_acpi_register_get_gsi_func to register function in xen_pcibk_init
and set NULL to hook in xen_pcibk_cleanup when unloa
to get gsi from dev")
Reported-by: Marek Marczykowski-Górecki
Signed-off-by: Jiqian Chen
---
v1->v2 changes:
Added hook xen_acpi_get_gsi_from_sbdf.
Changed pcistub_get_gsi_from_sbdf to static and pciback register it as the real
hook function.
---
drivers/xen/Kconfig
ve problem and cover original commit's requirement, just remove
that dependency, because the code "IS_REACHABLE(CONFIG_XEN_PCIDEV_BACKEND)"
of original commit is enough to meet the requirement.
Fixes: 2fae6bb7be32 ("xen/privcmd: Add new syscall to get gsi from dev")
Signed-
hat is
wrong, because irq is not equal with gsi, they are in different
spaces, so pirq mapping fails.
And in current codes, there is no method to get gsi for userspace.
For above purpose, add new function to get gsi, and the
corresponding ioctl is implemented on linux kernel side.
Signed-off-by:
rupts in terms of pIRQs, introduce a new
hypercall that allows setting interrupt permissions based on GSI value
rather than pIRQ.
Note the GSI hypercall parameters is translated to an IRQ value (in
case there are ACPI overrides) before doing the checks.
Signed-off-by: Jiqian Chen
Signed-off-by:
TL_irq_permission
requires passing in pirq, it is not suitable for PVH dom0 that
doesn't have PIRQs to grant irq permission.
To solve this issue, use the another hypercall
XEN_DOMCTL_gsi_permission to grant the permission of irq(
translate from gsi) to dumU when dom0 has no PIRQs.
Signed-off
Best regards,
Jiqian Chen
v14->v15 changes:
Due to the patch#1 of v14 had been merged, so the sequence number of following
patches are v14 decrese one.
* patch#1: Change to use the commit message wrote by Roger.
* patch#2: Change to use the commit message wrote by Roger.
Change the c
ction in pcistub_init_device. Because when
using "pci-assignable-add" to assign a passthrough device in
Xen, it will reset passthrough device and the vpci state will
out of date, and then device will fail to restore bar state.
Signed-off-by: Jiqian Chen
Signed-off-by: Huang Rui
Signed
In PVH dom0, the gsis don't get registered, but the gsi of
a passthrough device must be configured for it to be able to be
mapped into a domU.
When assigning a device to passthrough, proactively setup the gsi
of the device during that process.
Signed-off-by: Jiqian Chen
Signed-off-by: Huan
et gsi when they have a need.
Signed-off-by: Jiqian Chen
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
---
v9->v10 changes:
Changed the macro wrapping "pcistub_get_gsi_from_sbdf" from
"CONFIG_XEN_PCIDEV_BACKEND" to "CONFIG_XEN_ACPI".
Adde
ot; to "CONFIG_XEN_ACPI".
Added "imply CONFIG_XEN_PCIDEV_BACKEND" for CONFIG_XEN_PRIVCMD
Kconfig definition.
Added check "if (IS_REACHABLE(CONFIG_XEN_PCIDEV_BACKEND))" before
calling pcistub_get_gsi_from_sbdf.
Best regards,
Jiqian Chen
v8->
et gsi when they have a need.
Signed-off-by: Jiqian Chen
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
---
v8->v9 changes:
Changed the syscall name from "IOCTL_PRIVCMD_GSI_FROM_DEV" to
"IOCTL_PRIVCMD_PCIDEV_GET_GSI". Also changed the other functions nam
ed the other functions name.
Changed the macro wrapping "pcistub_get_gsi_from_sbdf" from
"CONFIG_XEN_ACPI" to "CONFIG_XEN_PCIDEV_BACKEND"
to fix compile errors reported by CI robot.
Changed the parameter gsi of struct privcmd_pcidev_get_gsi from int
to u32.
ction in pcistub_init_device. Because when
using "pci-assignable-add" to assign a passthrough device in
Xen, it will reset passthrough device and the vpci state will
out of date, and then device will fail to restore bar state.
Signed-off-by: Jiqian Chen
Signed-off-by: Huang Rui
Signed
In PVH dom0, the gsis don't get registered, but the gsi of
a passthrough device must be configured for it to be able to be
mapped into a domU.
When assigning a device to passthrough, proactively setup the gsi
of the device during that process.
Signed-off-by: Jiqian Chen
Signed-off-by: Huan
TL_irq_permission
requires passing in pirq, it is not suitable for PVH dom0 that
doesn't have PIRQs to grant irq permission.
To solve this issue, use the another hypercall
XEN_DOMCTL_gsi_permission to grant the permission of irq(
translate from gsi) to dumU when dom0 has no PIRQs.
Signed-off
hat is
wrong, because irq is not equal with gsi, they are in different
spaces, so pirq mapping fails.
And in current codes, there is no method to get gsi for userspace.
For above purpose, add new function to get gsi, and the
corresponding ioctl is implemented on linux kernel side.
Signed-off-by:
vious callers are
not hypercall but emulation based.
Signed-off-by: Jiqian Chen
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
---
v14->v15 changes:
Change to use the commit message wrote by Roger.
v13->v14 changes:
Modified the commit message.
v12->v13 changes:
Removed the PHYSDEVO
rupts in terms of pIRQs, introduce a new
hypercall that allows setting interrupt permissions based on GSI value
rather than pIRQ.
Note the GSI hypercall parameters is translated to an IRQ value (in
case there are ACPI overrides) before doing the checks.
Signed-off-by: Jiqian Chen
Signed-off-by:
c = libxl__arch_local_domain_has_pirq_notion(gc);
if (!rc) {}" to
"if (libxl__arch_local_domain_has_pirq_notion(gc) == false) {}"
Modified some log prints codes.
Best regards,
Jiqian Chen
v13->v14 changes:
* patch#1: Removed the check ( !is_pci_passthrough
ued by dom0.
So, allow PHYSDEVOP_map_pirq when dom0 is PVH and also allow
PHYSDEVOP_unmap_pirq for the removal device path to unmap pirq. Then the
interrupt of a passthrough device can be successfully mapped to pirq for domU.
Signed-off-by: Jiqian Chen
Signed-off-by: Huang Rui
Signed-off-by:
equal with gsi, they are in different spaces, so pirq
mapping fails.
And in current codes, there is no method to get gsi for userspace.
For above purpose, add new function to get gsi, and the
corresponding ioctl is implemented on linux kernel side.
Signed-off-by: Jiqian Chen
Signed-off-by: Hua
iqian Chen
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
---
v13->v14 changes:
Removed the check ( !is_pci_passthrough_enabled() ).
Added if ( dev_reset.flags & ~PCI_DEVICE_RESET_MASK ) to check if the other
bits are zero.
v12->v13 changes:
Deleted all "state" words in ne
_to_irq. And old hypercall XEN_DOMCTL_irq_permission
requires passing in pirq, it is not suitable for dom0 that
doesn't have PIRQs to grant irq permission.
To solve this issue, use the new hypercall
XEN_DOMCTL_gsi_permission to grant the permission of irq(
translate from gsi) to dumU when dom0 has no PIR
gsi) to dumU when dom0
has no PIRQs.
Regarding the translation from gsi to irq, it is that if there are
ACPI overrides entries then get translation from them, if not gsi
are identity mapped into irq.
Signed-off-by: Jiqian Chen
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
---
CC: Dani
ese one.
* patch#3~5: No changes.
Best regards,
Jiqian Chen
v12->v13 changes:
Due to major changes in the codes, all the Reviewed-by received before have
been removed.
Please review them again.
* patch#1: Delete all "state" words in new code, because it is not necessary.
_to_irq. And old hypercall XEN_DOMCTL_irq_permission
requires passing in pirq, it is not suitable for dom0 that
doesn't have PIRQs to grant irq permission.
To solve this issue, use the new hypercall
XEN_DOMCTL_gsi_permission to grant the permission of irq(
translate from gsi) to dumU when dom0 has no PIR
equal with gsi, they are in different spaces, so pirq
mapping fails.
And in current codes, there is no method to get gsi for userspace.
For above purpose, add new function to get gsi, and the
corresponding ioctl is implemented on linux kernel side.
Signed-off-by: Jiqian Chen
Signed-off-by: Hua
iqian Chen
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
---
v12->v13 changes:
Deleted all "state" words in new code, because it is not necessary.
Deleted unnecessary parameter reset_type of function vpci_reset_device, and
changed this function to inline function
Added description
gsi) to dumU when dom0
has no PIRQs.
Regarding the translation from gsi to irq, it is that if there are
ACPI overrides entries then get translation from them, if not gsi
are identity mapped into irq.
Signed-off-by: Jiqian Chen
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
---
CC: Dani
mp_register_gsi on Xen side is never called, then the gsi is not
registered.
Callstack is(on linux kernel side) pcistub_probe->pcistub_seize->
pcistub_init_device-> xen_pcibk_reset_device->
xen_pcibk_control_isr->isr_on==0.
Signed-off-by: Jiqian Chen
Signed-off-by: Huang Rui
Signed-of
ns.
Signed-off-by: Jiqian Chen
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
---
v12->v13 changes:
Removed the PHYSDEVOP_(un)map_pirq restriction check for pvh domU and added a
corresponding description in the commit message.
v11->v12 changes:
Avoid using return, set error code instea
g "ctx", use the macro "CTX".
Add the function libxl__arch_local_romain_ has_pirq_notion to
determine if there is a concept
of pirq in the domain where xl is located.
In the function libxl__arch_hvm_unmap_gsi, before unmap_pirq, use
map_pirq to
si) to dumU when dom0 has no PIRQs.
Signed-off-by: Jiqian Chen
Signed-off-by: Huang Rui
Signed-off-by: Chen Jiqian
---
RFC: it needs to wait for the corresponding third patch on linux kernel side to
be merged.
https://lore.kernel.org/xen-devel/20240607075109.126277-4-jiqian.c...@amd.com/
This
equal with gsi, they are in different spaces, so pirq
mapping fails.
And in current codes, there is no method to get gsi for userspace.
For above purpose, add new function to get gsi, and the
corresponding ioctl is implemented on linux kernel side.
Signed-off-by: Jiqian Chen
Signed-off-by: Hua
oesn't have a notion of PIRQ.
So that the interrupt of a passthrough device can be
successfully mapped to pirq for domU with a notion of PIRQ
when dom0 is PVH
Signed-off-by: Jiqian Chen
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
---
xen/arch/x86/hvm/hypercall.c | 6 ++
x
e the
state of device is reset on dom0 side, dom0 can call this
hypercall to notify hypervisor.
Signed-off-by: Jiqian Chen
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
Reviewed-by: Stewart Hildebrand
Reviewed-by: Stefano Stabellini
---
xen/arch/x86/hvm/hypercall.c | 1 +
xen/driver
r.
Fourth, xen_pt_realize->xc_physdev_map_pirq, it wants to allocate a
pirq for gsi, but it isn't necessary to get pirq whose value is equal
with the value of gsi. After this patch, it will get a free pirq, and
it also can work.
Signed-off-by: Jiqian Chen
Signed-off-by: Huang Rui
Signed-off-
mp_register_gsi on Xen side is never called, then the gsi is not
registered.
Callstack is(on linux kernel side) pcistub_probe->pcistub_seize->
pcistub_init_device-> xen_pcibk_reset_device->
xen_pcibk_control_isr->isr_on==0.
Signed-off-by: Jiqian Chen
Signed-off-by: Huang Rui
Signed-of
) to dumU when dom0
has no PIRQs.
Signed-off-by: Jiqian Chen
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
---
CC: Daniel P . Smith
Remaining comment @Daniel P . Smith:
+ret = -EPERM;
+if ( !irq_access_permitted(currd, irq) ||
+ xsm_irq_permission(XSM_HO
<=0, and remove
unnecessary space.
Add #define XEN_DOMCTL_GSI_PERMISSION_MASK 1 to get lowest bit.
* patch#5: Add explanation of whether the caller of xc_physdev_map_pirq is
affected.
Best regards,
Jiqian Chen
v10->v11 changes:
* patch#1: Move the curly braces of "case PHYSD
irq, so it fails. However, the logic before that
re-factoring is different, it should return the current_pirq that irq was
already
mapped to and make the call success.
Fixes: 0762e2502f1f ("x86/physdev: factor out the code to allocate and map a
pirq")
Signed-off-by: Jiqian Chen
Signed-off
irq, so it fails. However, the logic before that
re-factoring is different, it should return the current_pirq that irq was
already
mapped to and make the call success.
Fixes: 0762e2502f1f ("x86/physdev: factor out the code to allocate and map a
pirq")
Signed-off-by: Jiqian Chen
Signed-off-by
problems, one is caller can't
get a free pirq value, another is that once the pecific pirq was
already mapped to other gsi, then it will fail.
So, change xc_physdev_map_pirq to allow to pass negative parameter
in and then get a free pirq.
Signed-off-by: Jiqian Chen
Signed-off-by: Huang Rui
si) to dumU when dom0 has no PIRQs.
Signed-off-by: Jiqian Chen
Signed-off-by: Huang Rui
Signed-off-by: Chen Jiqian
---
RFC: it needs to wait for the corresponding third patch on linux kernel side to
be merged.
https://lore.kernel.org/xen-devel/20240607075109.126277-4-jiqian.c...@amd.com/
This
Change the hard-coded 0 to use LIBXL_TOOLSTACK_DOMID.
Add libxl__arch_hvm_map_gsi to distinguish x86 related
implementations.
Add a list pcidev_pirq_list to record the relationship between sbdf
and pirq, which can be
used to obtain the corresponding pirq when unmap PIRQ.
Bes
c_hwdom_map_gsi-> mp_register_gsi will be called only when
the gsi is unmasked, so that the gsi can't work for passthrough
device.
Signed-off-by: Jiqian Chen
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
---
xen/arch/x86/hvm/hypercall.c | 1 +
1 file changed, 1 insertion(+)
diff --g
has no X86_EMU_USE_PIRQ flag.
So that the interrupt of a passthrough device can be
successfully mapped to pirq for domU with X86_EMU_USE_PIRQ flag
when dom0 is PVH
Signed-off-by: Jiqian Chen
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
Reviewed-by: Stefano Stabellini
---
xen/arch/x
equal with gsi, they are in different spaces, so pirq
mapping fails.
And in current codes, there is no method to get gsi for userspace.
For above purpose, add new function to get gsi, and the
corresponding ioctl is implemented on linux kernel side.
Signed-off-by: Jiqian Chen
Signed-off-by: Hua
Signed-off-by: Jiqian Chen
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
---
xen/arch/x86/domctl.c | 33 ++
xen/arch/x86/include/asm/io_apic.h | 2 ++
xen/arch/x86/io_apic.c | 17 +++
xen/arch/x86/mpparse.c | 3
the allocation is successful. That can help caller to success when
caller just want to allocate a free pirq but doesn't know if the irq
already has a mapped pirq or not.
Signed-off-by: Jiqian Chen
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
---
xen/arch/x86/irq.c | 2 ++
1 file ch
dom0 can call this hypercall to notify vpci.
Signed-off-by: Jiqian Chen
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
Reviewed-by: Stewart Hildebrand
Reviewed-by: Stefano Stabellini
---
xen/arch/x86/hvm/hypercall.c | 1 +
xen/drivers/pci/physdev.c
hod to get gsi for
userspace.
For above purpose, add new function to get gsi. And call this
function before xc_physdev_(un)map_pirq
Signed-off-by: Jiqian Chen
Signed-off-by: Huang Rui
Signed-off-by: Chen Jiqian
---
RFC: it needs review and needs to wait for the corresponding third patch on
li
Signed-off-by: Jiqian Chen
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
---
RFC: it needs review and needs to wait for the corresponding third patch on
linux kernel side to be merged.
---
tools/include/xenctrl.h| 5 +++
tools/libs/ctrl/xc_domain.c| 15 +++
tools
e upper and lower lines of the struct
xen_domctl_gsi_permission
definition.
All patches have modified signatures as follows:
Signed-off-by: Jiqian Chen means I am the author.
Signed-off-by: Huang Rui means Rui sent them to upstream
firstly.
Signed-off-by: Jiqian Chen means I take con
g.
So that domU with PIRQ flag can success to map pirq for
passthrough devices even dom0 has no PIRQ flag.
Signed-off-by: Jiqian Chen
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
Reviewed-by: Stefano Stabellini
---
xen/arch/x86/hvm/hypercall.c | 6 ++
xen/arch/x86/physdev.c
evice, setting ioapic affinity and vector will fail.
To fix above problem, on Linux kernel side, a new code will
need to call PHYSDEVOP_setup_gsi for passthrough devices to
register gsi when dom0 is PVH.
So, add PHYSDEVOP_setup_gsi into hvm_physdev_op for above
purpose.
Signed-off-by: Jiqian
dom0 can call this hypercall to notify vpci.
Signed-off-by: Jiqian Chen
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
Reviewed-by: Stewart Hildebrand
Reviewed-by: Stefano Stabellini
---
xen/arch/x86/hvm/hypercall.c | 1 +
xen/drivers/pci/physdev.c
dd gsi_2_irq to transform gsi to irq, instead of
considering gsi == irq.
Add explicit padding to struct xen_domctl_gsi_permission.
Best regards,
Jiqian Chen
v7->v8 changes:
* patch#2: Add the domid check(domid == DOMID_SELF) to prevent self map when
guest doesn't use pirq.
Q flag.
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
Reviewed-by: Stefano Stabellini
---
xen/arch/x86/hvm/hypercall.c | 6 ++
xen/arch/x86/physdev.c | 24
2 files changed, 30 insertions(+)
diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hyper
In PVH dom0, it uses the linux local interrupt mechanism,
when it allocs irq for a gsi, it is dynamic, and follow
the principle of applying first, distributing first. And
irq number is alloced from small to large, but the applying
gsi number is not, may gsi 38 comes before gsi 28, that
causes the i
n dom0 is not PV or dom0
has not PIRQ flag.
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
---
RFC: it needs review and needs to wait for the corresponding third patch on
linux kernel side to be merged.
---
tools/include/xenctrl.h| 5 +++
tools/libs/ctrl/xc_domain.
above purpose.
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
---
The code link that will call this hypercall on linux kernel side is as follows
https://lore.kernel.org/lkml/20240607075109.126277-3-jiqian.c...@amd.com/T/#u
---
xen/arch/x86/hvm/hypercall.c | 1 +
1 file changed, 1 insertion(+)
dom0 can call this hypercall to notify vpci.
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
Reviewed-by: Stewart Hildebrand
Reviewed-by: Stefano Stabellini
---
xen/arch/x86/hvm/hypercall.c | 1 +
xen/drivers/pci/physdev.c| 43
xen/drivers/vpci/v
In PVH dom0, the gsis don't get registered, but the gsi of
a passthrough device must be configured for it to be able to be
mapped into a domU.
When assign a device to passthrough, proactively setup the gsi
of the device during that process.
Signed-off-by: Huang Rui
Signed-off-by: Jiqian
i
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: Huang Rui
Signed-off-by: Jiqian Chen
---
RFC: it need review and need to wait for previous patch of this series
h#2: is the patch#1 of v7. Use CONFIG_XEN_ACPI instead of CONFIG_ACPI to
wrap codes.
* patch#3: is the patch#2 of v7. In function privcmd_ioctl_gsi_from_dev, return
-EINVAL when not confige CONFIG_XEN_ACPI.
use PCI_BUS_NUM PCI_SLOT PCI_FUNC instead of open coding.
Best regards,
Jiq
ction in pcistub_init_device. Because when
using "pci-assignable-add" to assign a passthrough device in
Xen, it will reset passthrough device and the vpci state will
out of date, and then device will fail to restore bar state.
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
Revie
ion supported by Xen tools.
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
---
hw/xen/xen-host-pci-device.c | 19 +++
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/hw/xen/xen-host-pci-device.c b/hw/xen/xen-host-pci-device.c
index 8c6e9a1716a2..2fe6a60434ba 100644
--
Hi All,
This is v7 series to support passthrough on Xen when dom0 is PVH.
v6->v7 changes:
* Due to changes in the implementation of obtaining gsi in the kernel and Xen.
Change to use
xc_physdev_gsi_from_dev, that requires passing in sbdf instead of irq.
Best regards,
Jiqian Chen
v5-
gned-off-by: Huang Rui
Signed-off-by: Jiqian Chen
---
tools/include/xenctrl.h | 5 +++
tools/libs/ctrl/xc_domain.c | 15
tools/libs/light/libxl_pci.c | 72
xen/arch/x86/domctl.c| 31
xen/include/public/domctl.h | 9 ++
In PVH dom0, it uses the linux local interrupt mechanism,
when it allocs irq for a gsi, it is dynamic, and follow
the principle of applying first, distributing first. And
irq number is alloced from small to large, but the applying
gsi number is not, may gsi 38 comes before gsi 28, that
causes the i
dom0 can call this hypercall to notify vpci.
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
Reviewed-by: Stewart Hildebrand
Reviewed-by: Stefano Stabellini
---
xen/arch/x86/hvm/hypercall.c | 1 +
xen/drivers/pci/physdev.c| 36
xen/drivers/vpci/v
above purpose.
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
---
xen/arch/x86/hvm/hypercall.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hypercall.c
index d49fb8b548a3..98e3c6b176ff 100644
--- a/xen/arch/x86/hvm/hypercall.c
+++
ng Rui
Signed-off-by: Jiqian Chen
Reviewed-by: Stefano Stabellini
---
xen/arch/x86/hvm/hypercall.c | 2 ++
xen/arch/x86/physdev.c | 24
2 files changed, 26 insertions(+)
diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hypercall.c
index 56fbb69ab201..d49fb8
n. That gets
more intuitive code logic.
Best regards,
Jiqian Chen
v6->v7 changes:
* patch#4: Due to changes in the implementation of obtaining gsi in the kernel.
Change to add a new function
to get gsi from irq, instead of gsi sysfs.
* patch#5: Fix the issue with variable u
we can return that gsi.
Best regards,
Jiqian Chen
v5->v6 change:
* patch#3: change to add a new syscall to translate irq to gsi, instead adding
a new gsi sysfs.
v4->v5 changes:
* patch#1: Add Reviewed-by Stefano
* patch#2: Add Reviewed-by Stefano
* patch#3: No changes
v3->v4 chan
i
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.
Co-developed-by: Huang Rui
Signed-off-by: Jiqian Chen
---
drivers/xen/privcmd.c | 28 ++
dr
In PVH dom0, the gsis don't get registered, but the gsi of
a passthrough device must be configured for it to be able to be
mapped into a domU.
When assign a device to passthrough, proactively setup the gsi
of the device during that process.
Co-developed-by: Huang Rui
Signed-off-by: Jiqian
Hi All,
This is v6 series to support passthrough on Xen when dom0 is PVH.
v5->v6 changes:
* Due to changes in the implementation of obtaining gsi in the kernel and Xen.
Change to use xc_physdev_gsi_from_irq, instead of gsi sysfs.
Best regards,
Jiqian Chen
v4->v5 changes:
* Add rev
new function supported by
Xen tools.
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
---
hw/xen/xen-host-pci-device.c | 7 ++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/hw/xen/xen-host-pci-device.c b/hw/xen/xen-host-pci-device.c
index 8c6e9a1716a2..5e9aa9679e3e 100644
--- a
gned-off-by: Huang Rui
Signed-off-by: Jiqian Chen
---
tools/include/xenctrl.h | 5
tools/libs/ctrl/xc_domain.c | 15
tools/libs/light/libxl_pci.c | 46
xen/arch/x86/domctl.c| 31
xen/include/public/
above purpose.
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
---
xen/arch/x86/hvm/hypercall.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hypercall.c
index d49fb8b548a3..98e3c6b176ff 100644
--- a/xen/arch/x86/hvm/hypercall.c
+++
dom0 can call this hypercall to notify vpci.
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
Reviewed-by: Stewart Hildebrand
Reviewed-by: Stefano Stabellini
---
xen/arch/x86/hvm/hypercall.c | 1 +
xen/drivers/pci/physdev.c| 36
xen/drivers/vpci/v
In PVH dom0, it uses the linux local interrupt mechanism,
when it allocs irq for a gsi, it is dynamic, and follow
the principle of applying first, distributing first. And
irq number is alloced from small to large, but the applying
gsi number is not, may gsi 38 comes before gsi 28, that
causes the i
Best regards,
Jiqian Chen
v5->v6 changes:
* patch#1: Add Reviewed-by Stefano and Stewart. Rebase code and change old
function vpci_remove_device, vpci_add_handlers to vpci_deassign_device,
vpci_assign_device
* patch#2: Add Reviewed-by Stefano
* patch#3: Remove unnecessary "ASSERT(!
ng Rui
Signed-off-by: Jiqian Chen
Reviewed-by: Stefano Stabellini
---
xen/arch/x86/hvm/hypercall.c | 2 ++
xen/arch/x86/physdev.c | 24
2 files changed, 26 insertions(+)
diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hypercall.c
index 56fbb69ab201..d49fb8
Hi All,
This is v6 series to support passthrough on Xen when dom0 is PVH.
v5->v6 change:
* patch#3: change to add a new syscall to translate irq to gsi, instead adding
a new gsi sysfs.
Best regards,
Jiqian Chen
v4->v5 changes:
* patch#1: Add Reviewed-by Stefano
* patch#2: Add Revie
In PVH dom0, the gsis don't get registered, but the gsi of
a passthrough device must be configured for it to be able to be
mapped into a domU.
When assign a device to passthrough, proactively setup the gsi
of the device during that process.
Co-developed-by: Huang Rui
Signed-off-by: Jiqian
1 - 100 of 166 matches
Mail list logo