Update patch and changelog with openeuler !231
Signed-off-by: imxcc <xingchaochao@huawei.com>
This commit is contained in:
parent
f0de605f36
commit
baab1dcfbb
@ -34,6 +34,9 @@ Patch0021: Revert-cpu-add-Cortex-A72-processor-kvm-target-suppo.patch
|
|||||||
Patch0022: 0003-cpu-add-Cortex-A72-processor-kvm-target-support.patch
|
Patch0022: 0003-cpu-add-Cortex-A72-processor-kvm-target-support.patch
|
||||||
Patch0023: hugepages-hugepages-files-maybe-leftover.patch
|
Patch0023: hugepages-hugepages-files-maybe-leftover.patch
|
||||||
Patch0024: target-i386-Modify-the-VM-s-physical-bits-value-set-.patch
|
Patch0024: target-i386-Modify-the-VM-s-physical-bits-value-set-.patch
|
||||||
|
Patch0025: vfio-pci-Ascend310-need-4Bytes-quirk-in-bar4.patch
|
||||||
|
Patch0026: vfio-pci-Ascend710-need-4Bytes-quirk-in-bar0.patch
|
||||||
|
Patch0027: vfio-pci-Ascend910-need-4Bytes-quirk-in-bar0.patch
|
||||||
|
|
||||||
BuildRequires: flex
|
BuildRequires: flex
|
||||||
BuildRequires: gcc
|
BuildRequires: gcc
|
||||||
@ -478,6 +481,11 @@ getent passwd qemu >/dev/null || \
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Feb 11 2022 imxcc <xingchaochao@huawei.com>
|
||||||
|
- vfio/pci: Ascend310 need 4Bytes quirk in bar4
|
||||||
|
- vfio/pci: Ascend710 need 4Bytes quirk in bar0
|
||||||
|
- vfio/pci: Ascend910 need 4Bytes quirk in bar0
|
||||||
|
|
||||||
* Fri Feb 11 2022 imxcc <xingchaochao@huawei.com>
|
* Fri Feb 11 2022 imxcc <xingchaochao@huawei.com>
|
||||||
- hugepages: hugepages files maybe leftover
|
- hugepages: hugepages files maybe leftover
|
||||||
- Patch0024: target-i386: Modify the VM's physical bits value set
|
- Patch0024: target-i386: Modify the VM's physical bits value set
|
||||||
|
|||||||
105
vfio-pci-Ascend310-need-4Bytes-quirk-in-bar4.patch
Normal file
105
vfio-pci-Ascend310-need-4Bytes-quirk-in-bar4.patch
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
From eee7ff398496524881225d503309a9853972c5df Mon Sep 17 00:00:00 2001
|
||||||
|
From: Binfeng Wu <wubinfeng@huawei.com>
|
||||||
|
Date: Tue, 8 Feb 2022 17:00:39 +0800
|
||||||
|
Subject: [PATCH 3/5] vfio/pci: Ascend310 need 4Bytes quirk in bar4
|
||||||
|
|
||||||
|
---
|
||||||
|
hw/vfio/pci-quirks.c | 75 ++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
1 file changed, 75 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c
|
||||||
|
index 0cf69a8c6d..d86bcaf309 100644
|
||||||
|
--- a/hw/vfio/pci-quirks.c
|
||||||
|
+++ b/hw/vfio/pci-quirks.c
|
||||||
|
@@ -1209,6 +1209,80 @@ int vfio_pci_igd_opregion_init(VFIOPCIDevice *vdev,
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
+#define PCI_VENDOR_ID_HUAWEI 0x19e5
|
||||||
|
+#define PCI_DEVICE_ID_ASCEND310 0xd100
|
||||||
|
+#define ASCEND310_XLOADER_SIZE 4
|
||||||
|
+#define ASCEND310_XLOADER_OFFSET 0x400
|
||||||
|
+
|
||||||
|
+typedef struct VFIOAscendBarQuirk {
|
||||||
|
+ struct VFIOPCIDevice *vdev;
|
||||||
|
+ pcibus_t offset;
|
||||||
|
+ uint8_t bar;
|
||||||
|
+ MemoryRegion *mem;
|
||||||
|
+} VFIOAscendBarQuirk;
|
||||||
|
+
|
||||||
|
+static uint64_t vfio_ascend_quirk_read(void *opaque,
|
||||||
|
+ hwaddr addr, unsigned size)
|
||||||
|
+{
|
||||||
|
+ VFIOAscendBarQuirk *quirk = opaque;
|
||||||
|
+ VFIOPCIDevice *vdev = quirk->vdev;
|
||||||
|
+
|
||||||
|
+ qemu_log("read RO region! addr=0x%" HWADDR_PRIx ", size=%d\n",
|
||||||
|
+ addr + quirk->offset, size);
|
||||||
|
+
|
||||||
|
+ return vfio_region_read(&vdev->bars[quirk->bar].region,
|
||||||
|
+ addr + quirk->offset, size);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static void vfio_ascend_quirk_write(void *opaque, hwaddr addr,
|
||||||
|
+ uint64_t data, unsigned size)
|
||||||
|
+{
|
||||||
|
+ VFIOAscendBarQuirk *quirk = opaque;
|
||||||
|
+
|
||||||
|
+ qemu_log("modifying RO region is not allowed! addr=0x%"
|
||||||
|
+ HWADDR_PRIx ", data=0x%" PRIx64 ", size=%d\n",
|
||||||
|
+ addr + quirk->offset, data, size);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static const MemoryRegionOps vfio_ascend_intercept_regs_quirk = {
|
||||||
|
+ .read = vfio_ascend_quirk_read,
|
||||||
|
+ .write = vfio_ascend_quirk_write,
|
||||||
|
+ .endianness = DEVICE_LITTLE_ENDIAN,
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+static void vfio_probe_ascend310_bar4_quirk(VFIOPCIDevice *vdev, int nr)
|
||||||
|
+{
|
||||||
|
+ VFIOQuirk *quirk;
|
||||||
|
+ VFIOAscendBarQuirk *bar4_quirk;
|
||||||
|
+
|
||||||
|
+ if (vdev->vendor_id != PCI_VENDOR_ID_HUAWEI || nr != 4 ||
|
||||||
|
+ vdev->device_id != PCI_DEVICE_ID_ASCEND310) {
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ quirk = g_malloc0(sizeof(*quirk));
|
||||||
|
+ quirk->nr_mem = 1;
|
||||||
|
+ quirk->mem = g_new0(MemoryRegion, quirk->nr_mem);
|
||||||
|
+ bar4_quirk = quirk->data = g_new0(typeof(*bar4_quirk), quirk->nr_mem);
|
||||||
|
+ bar4_quirk[0].vdev = vdev;
|
||||||
|
+ bar4_quirk[0].offset = ASCEND310_XLOADER_OFFSET;
|
||||||
|
+ bar4_quirk[0].bar = nr;
|
||||||
|
+
|
||||||
|
+ /*
|
||||||
|
+ * intercept w/r to the xloader-updating register,
|
||||||
|
+ * so the vm can't enable xloader-updating
|
||||||
|
+ */
|
||||||
|
+ memory_region_init_io(&quirk->mem[0], OBJECT(vdev),
|
||||||
|
+ &vfio_ascend_intercept_regs_quirk,
|
||||||
|
+ &bar4_quirk[0],
|
||||||
|
+ "vfio-ascend310-bar4-intercept-regs-quirk",
|
||||||
|
+ ASCEND310_XLOADER_SIZE);
|
||||||
|
+ memory_region_add_subregion_overlap(vdev->bars[nr].region.mem,
|
||||||
|
+ bar4_quirk[0].offset,
|
||||||
|
+ &quirk->mem[0], 1);
|
||||||
|
+ QLIST_INSERT_HEAD(&vdev->bars[nr].quirks, quirk, next);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
/*
|
||||||
|
* Common quirk probe entry points.
|
||||||
|
*/
|
||||||
|
@@ -1261,6 +1335,7 @@ void vfio_bar_quirk_setup(VFIOPCIDevice *vdev, int nr)
|
||||||
|
#ifdef CONFIG_VFIO_IGD
|
||||||
|
vfio_probe_igd_bar4_quirk(vdev, nr);
|
||||||
|
#endif
|
||||||
|
+ vfio_probe_ascend310_bar4_quirk(vdev, nr);
|
||||||
|
}
|
||||||
|
|
||||||
|
void vfio_bar_quirk_exit(VFIOPCIDevice *vdev, int nr)
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
75
vfio-pci-Ascend710-need-4Bytes-quirk-in-bar0.patch
Normal file
75
vfio-pci-Ascend710-need-4Bytes-quirk-in-bar0.patch
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
From bcc63ff3975cca783308fac7517a7911c29bd7c1 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Binfeng Wu <wubinfeng@huawei.com>
|
||||||
|
Date: Tue, 8 Feb 2022 17:16:04 +0800
|
||||||
|
Subject: [PATCH 4/5] vfio/pci: Ascend710 need 4Bytes quirk in bar0
|
||||||
|
|
||||||
|
---
|
||||||
|
hw/vfio/pci-quirks.c | 37 +++++++++++++++++++++++++++++++++++++
|
||||||
|
1 file changed, 37 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c
|
||||||
|
index d86bcaf309..6a9fc0afc5 100644
|
||||||
|
--- a/hw/vfio/pci-quirks.c
|
||||||
|
+++ b/hw/vfio/pci-quirks.c
|
||||||
|
@@ -1210,7 +1210,10 @@ int vfio_pci_igd_opregion_init(VFIOPCIDevice *vdev,
|
||||||
|
}
|
||||||
|
|
||||||
|
#define PCI_VENDOR_ID_HUAWEI 0x19e5
|
||||||
|
+#define PCI_DEVICE_ID_ASCEND710 0xd500
|
||||||
|
#define PCI_DEVICE_ID_ASCEND310 0xd100
|
||||||
|
+#define ASCEND710_XLOADER_SIZE 4
|
||||||
|
+#define ASCEND710_XLOADER_OFFSET 0x20430
|
||||||
|
#define ASCEND310_XLOADER_SIZE 4
|
||||||
|
#define ASCEND310_XLOADER_OFFSET 0x400
|
||||||
|
|
||||||
|
@@ -1250,6 +1253,39 @@ static const MemoryRegionOps vfio_ascend_intercept_regs_quirk = {
|
||||||
|
.endianness = DEVICE_LITTLE_ENDIAN,
|
||||||
|
};
|
||||||
|
|
||||||
|
+static void vfio_probe_ascend710_bar0_quirk(VFIOPCIDevice *vdev, int nr)
|
||||||
|
+{
|
||||||
|
+ VFIOQuirk *quirk;
|
||||||
|
+ VFIOAscendBarQuirk *bar0_quirk;
|
||||||
|
+
|
||||||
|
+ if (vdev->vendor_id != PCI_VENDOR_ID_HUAWEI || nr != 0 ||
|
||||||
|
+ vdev->device_id != PCI_DEVICE_ID_ASCEND710) {
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ quirk = g_malloc0(sizeof(*quirk));
|
||||||
|
+ quirk->nr_mem = 1;
|
||||||
|
+ quirk->mem = g_new0(MemoryRegion, quirk->nr_mem);
|
||||||
|
+ bar0_quirk = quirk->data = g_new0(typeof(*bar0_quirk), quirk->nr_mem);
|
||||||
|
+ bar0_quirk[0].vdev = vdev;
|
||||||
|
+ bar0_quirk[0].offset = ASCEND710_XLOADER_OFFSET;
|
||||||
|
+ bar0_quirk[0].bar = nr;
|
||||||
|
+
|
||||||
|
+ /*
|
||||||
|
+ * intercept w/r to the xloader-updating register,
|
||||||
|
+ * so the vm can't enable xloader-updating
|
||||||
|
+ */
|
||||||
|
+ memory_region_init_io(&quirk->mem[0], OBJECT(vdev),
|
||||||
|
+ &vfio_ascend_intercept_regs_quirk,
|
||||||
|
+ &bar0_quirk[0],
|
||||||
|
+ "vfio-ascend710-bar0-intercept-regs-quirk",
|
||||||
|
+ ASCEND710_XLOADER_SIZE);
|
||||||
|
+ memory_region_add_subregion_overlap(vdev->bars[nr].region.mem,
|
||||||
|
+ bar0_quirk[0].offset,
|
||||||
|
+ &quirk->mem[0], 1);
|
||||||
|
+ QLIST_INSERT_HEAD(&vdev->bars[nr].quirks, quirk, next);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static void vfio_probe_ascend310_bar4_quirk(VFIOPCIDevice *vdev, int nr)
|
||||||
|
{
|
||||||
|
VFIOQuirk *quirk;
|
||||||
|
@@ -1335,6 +1371,7 @@ void vfio_bar_quirk_setup(VFIOPCIDevice *vdev, int nr)
|
||||||
|
#ifdef CONFIG_VFIO_IGD
|
||||||
|
vfio_probe_igd_bar4_quirk(vdev, nr);
|
||||||
|
#endif
|
||||||
|
+ vfio_probe_ascend710_bar0_quirk(vdev, nr);
|
||||||
|
vfio_probe_ascend310_bar4_quirk(vdev, nr);
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
76
vfio-pci-Ascend910-need-4Bytes-quirk-in-bar0.patch
Normal file
76
vfio-pci-Ascend910-need-4Bytes-quirk-in-bar0.patch
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
From 4cf7d00e43c4e90327e13afa3cbc9c7ca3657c9f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Binfeng Wu <wubinfeng@huawei.com>
|
||||||
|
Date: Tue, 8 Feb 2022 19:20:36 +0800
|
||||||
|
Subject: [PATCH 5/5] vfio/pci: Ascend910 need 4Bytes quirk in bar0
|
||||||
|
|
||||||
|
---
|
||||||
|
hw/vfio/pci-quirks.c | 37 +++++++++++++++++++++++++++++++++++++
|
||||||
|
1 file changed, 37 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c
|
||||||
|
index 6a9fc0afc5..2457a61196 100644
|
||||||
|
--- a/hw/vfio/pci-quirks.c
|
||||||
|
+++ b/hw/vfio/pci-quirks.c
|
||||||
|
@@ -1210,8 +1210,11 @@ int vfio_pci_igd_opregion_init(VFIOPCIDevice *vdev,
|
||||||
|
}
|
||||||
|
|
||||||
|
#define PCI_VENDOR_ID_HUAWEI 0x19e5
|
||||||
|
+#define PCI_DEVICE_ID_ASCEND910 0xd801
|
||||||
|
#define PCI_DEVICE_ID_ASCEND710 0xd500
|
||||||
|
#define PCI_DEVICE_ID_ASCEND310 0xd100
|
||||||
|
+#define ASCEND910_XLOADER_SIZE 4
|
||||||
|
+#define ASCEND910_XLOADER_OFFSET 0x80400
|
||||||
|
#define ASCEND710_XLOADER_SIZE 4
|
||||||
|
#define ASCEND710_XLOADER_OFFSET 0x20430
|
||||||
|
#define ASCEND310_XLOADER_SIZE 4
|
||||||
|
@@ -1253,6 +1256,39 @@ static const MemoryRegionOps vfio_ascend_intercept_regs_quirk = {
|
||||||
|
.endianness = DEVICE_LITTLE_ENDIAN,
|
||||||
|
};
|
||||||
|
|
||||||
|
+static void vfio_probe_ascend910_bar0_quirk(VFIOPCIDevice *vdev, int nr)
|
||||||
|
+{
|
||||||
|
+ VFIOQuirk *quirk;
|
||||||
|
+ VFIOAscendBarQuirk *bar0_quirk;
|
||||||
|
+
|
||||||
|
+ if (vdev->vendor_id != PCI_VENDOR_ID_HUAWEI || nr != 0 ||
|
||||||
|
+ vdev->device_id != PCI_DEVICE_ID_ASCEND910) {
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ quirk = g_malloc0(sizeof(*quirk));
|
||||||
|
+ quirk->nr_mem = 1;
|
||||||
|
+ quirk->mem = g_new0(MemoryRegion, quirk->nr_mem);
|
||||||
|
+ bar0_quirk = quirk->data = g_new0(typeof(*bar0_quirk), quirk->nr_mem);
|
||||||
|
+ bar0_quirk[0].vdev = vdev;
|
||||||
|
+ bar0_quirk[0].offset = ASCEND910_XLOADER_OFFSET;
|
||||||
|
+ bar0_quirk[0].bar = nr;
|
||||||
|
+
|
||||||
|
+ /*
|
||||||
|
+ * intercept w/r to the xloader-updating register,
|
||||||
|
+ * so the vm can't enable xloader-updating
|
||||||
|
+ */
|
||||||
|
+ memory_region_init_io(&quirk->mem[0], OBJECT(vdev),
|
||||||
|
+ &vfio_ascend_intercept_regs_quirk,
|
||||||
|
+ &bar0_quirk[0],
|
||||||
|
+ "vfio-ascend910-bar0-intercept-regs-quirk",
|
||||||
|
+ ASCEND910_XLOADER_SIZE);
|
||||||
|
+ memory_region_add_subregion_overlap(vdev->bars[nr].region.mem,
|
||||||
|
+ bar0_quirk[0].offset,
|
||||||
|
+ &quirk->mem[0], 1);
|
||||||
|
+ QLIST_INSERT_HEAD(&vdev->bars[nr].quirks, quirk, next);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static void vfio_probe_ascend710_bar0_quirk(VFIOPCIDevice *vdev, int nr)
|
||||||
|
{
|
||||||
|
VFIOQuirk *quirk;
|
||||||
|
@@ -1371,6 +1407,7 @@ void vfio_bar_quirk_setup(VFIOPCIDevice *vdev, int nr)
|
||||||
|
#ifdef CONFIG_VFIO_IGD
|
||||||
|
vfio_probe_igd_bar4_quirk(vdev, nr);
|
||||||
|
#endif
|
||||||
|
+ vfio_probe_ascend910_bar0_quirk(vdev, nr);
|
||||||
|
vfio_probe_ascend710_bar0_quirk(vdev, nr);
|
||||||
|
vfio_probe_ascend310_bar4_quirk(vdev, nr);
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user