Skip to contentSkip to conversation

Vairous fixes for qemu support

PATCH In review Bertrand Marquis 3 participants 11 messages May 10, 2022 – May 19, 2022

lore
Share & tools
lore
#0 lore raw

v2 cover Vairous fixes for qemu support

This serie is a rework of the patch named "[PATCH] xen: enable qemuboot for arm32" to fix some issues in the qemuboot support for arm and introduce arm32 support for it.

First 2 patches are small fixes/enhancements
Patch 3 is adding qemu arm32 support
Patch 4 needs to be discuss but is a workaround to let qemu-arm32 boot right now by disabling PCI as it cause dom0 to hang at the moment.

Bertrand Marquis (4):
xen: Fix class inherit in xen-image
qemuboot: Fix command line and enable other machines
xen: enable qemuboot for arm32
xen: Disable PCI on qemuarm with Xen

 classes/qemuboot-xen-defaults.bbclass        | 20 +++++++++----
 classes/qemuboot-xen-dtb.bbclass             | 31 +++++++++++++++++---
 recipes-extended/images/xen-image-minimal.bb |  2 +-
 3 files changed, 43 insertions(+), 10 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH v2 1/4 xen: Fix class inherit in xen-image

Remove inherit of qemuboot classes when not build for qemu in xen-image-minimal.
When reverted the handling for only adding inherited classes for qemu was kept but the line always inheriting them was kept to. This patch is fixing that so that qemuboot classes are now only added when the image is built for qemu.

This fixes commit 27e5ade0abc2660226389b8b62ef07d85f4b8758

---
 recipes-extended/images/xen-image-minimal.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-extended/images/xen-image-minimal.bb +1 -1
index 7f10b1d..9fd05d2 100644
@@ -36,7 +36,7 @@ LICENSE = "MIT"
 
 QB_NETWORK_XEN_BRIDGE = "1"
 
-inherit core-image qemuboot-xen-defaults qemuboot-xen-dtb qemuboot-testimage-network
+inherit core-image
 # Only inherit the qemuboot classes when building for a qemu machine
 QB_QEMU_CLASSES = ""
 QB_QEMU_CLASSES:qemuall = "qemuboot-xen-defaults qemuboot-xen-dtb qemuboot-testimage-network"
Signature · 1 line
2.25.1
Reviewed-by on v2 1/4
#2 lore raw

Re: [meta-virtualization] [PATCH v2 1/4] xen: Fix class inherit in xen-image

Quoted 11 lines · Bertrand Marquis

Remove inherit of qemuboot classes when not build for qemu in xen-image-minimal.
When reverted the handling for only adding inherited classes for qemu was kept but the line always inheriting them was kept to. This patch is fixing that so that qemuboot classes are now only added when the image is built for qemu.

This fixes commit 27e5ade0abc2660226389b8b62ef07d85f4b8758

thanks,

Christopher

Quoted 29 lines
---
 recipes-extended/images/xen-image-minimal.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-extended/images/xen-image-minimal.bb +1 -2
index 7f10b1d..9fd05d2 100644
@@ -36,7 +36,7 @@ LICENSE = "MIT"
 
 QB_NETWORK_XEN_BRIDGE = "1"
 
-inherit core-image qemuboot-xen-defaults qemuboot-xen-dtb qemuboot-testimage-network
+inherit core-image
 # Only inherit the qemuboot classes when building for a qemu machine
 QB_QEMU_CLASSES = ""
 QB_QEMU_CLASSES:qemuall = "qemuboot-xen-defaults qemuboot-xen-dtb qemuboot-testimage-network"
--

2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#7271): https://lists.yoctoproject.org/g/meta-virtualization/message/7271
Mute This Topic: https://lists.yoctoproject.org/mt/91015798/3619036
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#3 lore raw

PATCH v2 2/4 qemuboot: Fix command line and enable other machines

In reply to Bertrand Marquis

Fix qemuboot-xen-dtb to properly add dom0 bootargs by using a parameter instead of directly using the QB_XEN_DOM0_BOOTARGS inside the function. When not done, the variable is empty and dom0 bootargs are wrong in the device tree.

Use QB_MACHINE to generate a device tree with qemu instead of always using the armv8 machine. This will allow this class to be used for other machines later.

---
 classes/qemuboot-xen-dtb.bbclass | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
classes/qemuboot-xen-dtb.bbclass +5 -4
index 6fe3164..d43d23a 100644
@@ -29,6 +29,7 @@
 # See also: Other QB_ variables as defined by the qemuboot.bbclass.
 
 write_lops_xen_section() {
+    DOM0_BOOTARGS="$2"
     cat <<EOF >"$1"
 /dts-v1/;
 / {
@@ -47,7 +48,7 @@ write_lops_xen_section() {
         };
         lop_2 {
             compatible = "system-device-tree-v1,lop,modify";
-            modify = "/chosen:xen,dom0-bootargs:${QB_XEN_DOM0_BOOTARGS}";
+            modify = "/chosen:xen,dom0-bootargs:${DOM0_BOOTARGS}";
         };
         lop_3 {
             compatible = "system-device-tree-v1,lop,modify";
@@ -118,8 +119,7 @@ generate_xen_qemuboot_dtb() {
         -device qemu-xhci \
         -device usb-tablet \
         -device usb-kbd \
-        -machine virt,gic-version=3 \
-        -machine virtualization=true \
+        ${QB_MACHINE} \
         ${QB_CPU} \
         ${QB_SMP} \
         ${QB_MEM} \
@@ -129,7 +129,8 @@ generate_xen_qemuboot_dtb() {
 
     # Lopper generates temporary files in cwd, so run it within ${B}
     cd "${B}"
-    write_lops_xen_section "${B}/lop-insert-xen-section.dts"
+    write_lops_xen_section "${B}/lop-insert-xen-section.dts" \
+        "${QB_XEN_DOM0_BOOTARGS}"
 
     write_lop_add_to_xen_cmdline "${B}/lop-xen-cmdline.dts" \
         "${QB_XEN_CMDLINE_EXTRA}"
Signature · 1 line
2.25.1
#4 lore raw

PATCH v2 3/4 xen: enable qemuboot for arm32

In reply to Bertrand Marquis

Add required variables to generate a qemuboot devicetree for qemuarm. With this change, Xen and dom0 can be started using runqemu.

Xen is started using qemu kernel argument and the devicetree is modified to properly boot dom0 (which is loaded in memory).
This is using the same system as qemuarm64.

At this stage dom0 is hanging on PCI device scanning.

This patch is also using qemuarm64 as machine for arm64 bit instead of aarch64 to allow adding support for other machine (an example a Xilinx board that can be emulated with using an other xen machine).

---
 classes/qemuboot-xen-defaults.bbclass | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)
classes/qemuboot-xen-defaults.bbclass +15 -5
index c7e74c3..f1550cc 100644
@@ -10,15 +10,21 @@ DOM0_KERNEL ??= "${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}"
 DOM0_KERNEL_LOAD_ADDR ??= "0x45000000"
 QB_XEN_DOMAIN_MODULES ??= "${DOM0_KERNEL}:${DOM0_KERNEL_LOAD_ADDR}:multiboot,kernel"
 
-# Qemuboot for 64-bit Arm uses the QB_DEFAULT_KERNEL method to load Xen
+# Qemuboot for Arm uses the QB_DEFAULT_KERNEL method to load Xen
 # and the device loader option for the dom0 kernel:
 QB_OPT_APPEND:append:aarch64 = " \
     -device loader,file=${DOM0_KERNEL},addr=${DOM0_KERNEL_LOAD_ADDR} \
     "
-QB_DEFAULT_KERNEL:aarch64 = "xen-${MACHINE}"
+QB_OPT_APPEND:append:qemuarm = " \
+    -device loader,file=${DOM0_KERNEL},addr=${DOM0_KERNEL_LOAD_ADDR} \
+    "
+QB_DEFAULT_KERNEL:qemuarm64 = "xen-${MACHINE}"
+QB_DEFAULT_KERNEL:qemuarm = "xen-${MACHINE}"
 
 # 64-bit Arm: gic version 3
-QB_MACHINE:aarch64 = "-machine virt,gic-version=3 -machine virtualization=true"
+QB_MACHINE:qemuarm64 = "-machine virt,gic-version=3 -machine virtualization=true"
+# 32-bit Arm
+QB_MACHINE:qemuarm = "-machine virt -machine virtualization=true"
 
 # Increase the default qemu memory allocation to allow for the hypervisor.
 # Use a weak assignment to allow for change of default and override elsewhere.
@@ -26,5 +32,9 @@ QB_MEM_VALUE ??= "512"
 QB_MEM = "-m ${QB_MEM_VALUE}"
 
 # 64-bit Arm: qemuboot with a device tree binary
-QB_DTB:aarch64 = "${IMAGE_NAME}.qemuboot.dtb"
-QB_DTB_LINK:aarch64 = "${IMAGE_LINK_NAME}.qemuboot.dtb"
+QB_DTB:qemuarm64 = "${IMAGE_NAME}.qemuboot.dtb"
+QB_DTB_LINK:qemuarm64 = "${IMAGE_LINK_NAME}.qemuboot.dtb"
+
+# 32-bit Arm: qemuboot with a device tree binary
+QB_DTB:qemuarm = "${IMAGE_NAME}.qemuboot.dtb"
+QB_DTB_LINK:qemuarm = "${IMAGE_LINK_NAME}.qemuboot.dtb"
Signature · 1 line
2.25.1
Reviewed-by on v2 3/4
#5 lore raw

Re: [meta-virtualization] [PATCH v2 3/4] xen: enable qemuboot for arm32

Quoted 8 lines · Bertrand Marquis

Add required variables to generate a qemuboot devicetree for qemuarm. With this change, Xen and dom0 can be started using runqemu.

Xen is started using qemu kernel argument and the devicetree is modified to properly boot dom0 (which is loaded in memory).
This is using the same system as qemuarm64.

Quoted 7 lines

At this stage dom0 is hanging on PCI device scanning.

This patch is also using qemuarm64 as machine for arm64 bit instead of aarch64 to allow adding support for other machine (an example a Xilinx board that can be emulated with using an other xen machine).

Christopher

Quoted 57 lines
---
 classes/qemuboot-xen-defaults.bbclass | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)
classes/qemuboot-xen-defaults.bbclass +15 -6
index c7e74c3..f1550cc 100644
@@ -10,15 +10,21 @@ DOM0_KERNEL ??= "${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}"
 DOM0_KERNEL_LOAD_ADDR ??= "0x45000000"
 QB_XEN_DOMAIN_MODULES ??= "${DOM0_KERNEL}:${DOM0_KERNEL_LOAD_ADDR}:multiboot,kernel"
 
-# Qemuboot for 64-bit Arm uses the QB_DEFAULT_KERNEL method to load Xen
+# Qemuboot for Arm uses the QB_DEFAULT_KERNEL method to load Xen
 # and the device loader option for the dom0 kernel:
 QB_OPT_APPEND:append:aarch64 = " \
     -device loader,file=${DOM0_KERNEL},addr=${DOM0_KERNEL_LOAD_ADDR} \
     "
-QB_DEFAULT_KERNEL:aarch64 = "xen-${MACHINE}"
+QB_OPT_APPEND:append:qemuarm = " \
+    -device loader,file=${DOM0_KERNEL},addr=${DOM0_KERNEL_LOAD_ADDR} \
+    "
+QB_DEFAULT_KERNEL:qemuarm64 = "xen-${MACHINE}"
+QB_DEFAULT_KERNEL:qemuarm = "xen-${MACHINE}"
 
 # 64-bit Arm: gic version 3
-QB_MACHINE:aarch64 = "-machine virt,gic-version=3 -machine virtualization=true"
+QB_MACHINE:qemuarm64 = "-machine virt,gic-version=3 -machine virtualization=true"
+# 32-bit Arm
+QB_MACHINE:qemuarm = "-machine virt -machine virtualization=true"
 
 # Increase the default qemu memory allocation to allow for the hypervisor.
 # Use a weak assignment to allow for change of default and override elsewhere.
@@ -26,5 +32,9 @@ QB_MEM_VALUE ??= "512"
 QB_MEM = "-m ${QB_MEM_VALUE}"
 
 # 64-bit Arm: qemuboot with a device tree binary
-QB_DTB:aarch64 = "${IMAGE_NAME}.qemuboot.dtb"
-QB_DTB_LINK:aarch64 = "${IMAGE_LINK_NAME}.qemuboot.dtb"
+QB_DTB:qemuarm64 = "${IMAGE_NAME}.qemuboot.dtb"
+QB_DTB_LINK:qemuarm64 = "${IMAGE_LINK_NAME}.qemuboot.dtb"
+
+# 32-bit Arm: qemuboot with a device tree binary
+QB_DTB:qemuarm = "${IMAGE_NAME}.qemuboot.dtb"
+QB_DTB_LINK:qemuarm = "${IMAGE_LINK_NAME}.qemuboot.dtb"
--

2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#7274): https://lists.yoctoproject.org/g/meta-virtualization/message/7274
Mute This Topic: https://lists.yoctoproject.org/mt/91015802/3619037
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#6 lore raw

PATCH v2 4/4 xen: Disable PCI on qemuarm with Xen

In reply to Bertrand Marquis

Remove the pci node from the qemu device tree when runqemu is used with xen-qemuboot.

Linux is ending up in an infinite loop when trying to access PCI configuration space when running on top of Xen on arm32.
As we do not need or support any of the devices on PCI on arm32 at the moment, just remove the node from the device tree generated by qemu.

The problem does not appear at the moment without Xen and it is unclear why it is with Xen.
This will be investigated but in the meantime provide a working configuration for users.

---
 classes/qemuboot-xen-dtb.bbclass | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
classes/qemuboot-xen-dtb.bbclass +22 -0
index d43d23a..1f17a86 100644
@@ -63,6 +63,21 @@ write_lops_xen_section() {
 EOF
 }
 
+write_lop_rm_pci() {
+    cat <<EOF >"$1"
+/dts-v1/;
+/ {
+    compatible = "system-device-tree-v1";
+    lops {
+        lop_1 {
+            compatible = "system-device-tree-v1,lop,modify";
+            modify = "/pcie@10000000::";
+        };
+     };
+};
+EOF
+}
+
 write_lop_add_to_xen_cmdline() {
     EXTRA_XEN_BOOTARGS="$2"
     cat <<EOF >"$1"
@@ -135,6 +150,13 @@ generate_xen_qemuboot_dtb() {
     write_lop_add_to_xen_cmdline "${B}/lop-xen-cmdline.dts" \
         "${QB_XEN_CMDLINE_EXTRA}"
 
+    # On Qemu Arm32, Dom0 accessing PCI config space ends up in an
+    # infinite loop. Remove pci node from the device tree
+    if [ "${MACHINE}" = "qemuarm" ]; then
+        write_lop_rm_pci "${B}/lop-rm-pci.dts"
+        LOP_MODULE_ARGS="${LOP_MODULE_ARGS} -i ${B}/lop-rm-pci.dts"
+    fi
+
     if [ -z "${QB_XEN_DOMAIN_MODULES}" ]; then
         bbwarn "No domain modules: please set QB_XEN_DOMAIN_MODULES"
     fi
Signature · 1 line
2.25.1
Reviewed-by on v2 4/4
#7 lore raw

Re: [meta-virtualization] [PATCH v2 4/4] xen: Disable PCI on qemuarm with Xen

Quoted 9 lines · Bertrand Marquis

Remove the pci node from the qemu device tree when runqemu is used with xen-qemuboot.

Linux is ending up in an infinite loop when trying to access PCI configuration space when running on top of Xen on arm32.
As we do not need or support any of the devices on PCI on arm32 at the moment, just remove the node from the device tree generated by qemu.

Quoted 6 lines

The problem does not appear at the moment without Xen and it is unclear why it is with Xen.
This will be investigated but in the meantime provide a working configuration for users.

Thanks for this - my review is from inspecting the patch applied; I have yet to test it but there's no need to hold this back with positive reports now from Bruce and Bertrand.

thanks,

Christopher

Quoted 56 lines
---
 classes/qemuboot-xen-dtb.bbclass | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
classes/qemuboot-xen-dtb.bbclass +22 -1
index d43d23a..1f17a86 100644
@@ -63,6 +63,21 @@ write_lops_xen_section() {
 EOF
 }
 
+write_lop_rm_pci() {
+    cat <<EOF >"$1"
+/dts-v1/;
+/ {
+    compatible = "system-device-tree-v1";
+    lops {
+        lop_1 {
+            compatible = "system-device-tree-v1,lop,modify";
+            modify = "/pcie@10000000::";
+        };
+     };
+};
+EOF
+}
+
 write_lop_add_to_xen_cmdline() {
     EXTRA_XEN_BOOTARGS="$2"
     cat <<EOF >"$1"
@@ -135,6 +150,13 @@ generate_xen_qemuboot_dtb() {
     write_lop_add_to_xen_cmdline "${B}/lop-xen-cmdline.dts" \
         "${QB_XEN_CMDLINE_EXTRA}"
 
+    # On Qemu Arm32, Dom0 accessing PCI config space ends up in an
+    # infinite loop. Remove pci node from the device tree
+    if [ "${MACHINE}" = "qemuarm" ]; then
+        write_lop_rm_pci "${B}/lop-rm-pci.dts"
+        LOP_MODULE_ARGS="${LOP_MODULE_ARGS} -i ${B}/lop-rm-pci.dts"
+    fi
+
     if [ -z "${QB_XEN_DOMAIN_MODULES}" ]; then
         bbwarn "No domain modules: please set QB_XEN_DOMAIN_MODULES"
     fi
--

2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#7273): https://lists.yoctoproject.org/g/meta-virtualization/message/7273
Mute This Topic: https://lists.yoctoproject.org/mt/91015801/3619037
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#8 lore raw

Re: [meta-virtualization] [PATCH v2 4/4] xen: Disable PCI on qemuarm with Xen

Hi Christopher,

Quoted 18 lines · Christopher Clark
Quoted 14 lines · Bertrand Marquis

Remove the pci node from the qemu device tree when runqemu is used with xen-qemuboot.

Linux is ending up in an infinite loop when trying to access PCI configuration space when running on top of Xen on arm32.
As we do not need or support any of the devices on PCI on arm32 at the moment, just remove the node from the device tree generated by qemu.

The problem does not appear at the moment without Xen and it is unclear why it is with Xen.
This will be investigated but in the meantime provide a working configuration for users.

Quoted 8 lines
Quoted 1 line

Thanks for this - my review is from inspecting the patch applied; I have yet to test it but there's no need to hold this back with positive reports now from Bruce and Bertrand.

Thanks and I agree.

This is an hack but I think it is better at the moment to have something running and I will create a task on my side to investigate this in the future.

Cheers
Bertrand

Quoted 60 lines

thanks,

Christopher

Quoted 56 lines

---
classes/qemuboot-xen-dtb.bbclass | 22 ++++++++++++++++++++++

1 file changed, 22 insertions(+)
classes/qemuboot-xen-dtb.bbclass +0 -0
index d43d23a..1f17a86 100644
@@ -63,6 +63,21 @@ write_lops_xen_section() {

EOF
}

classes/qemuboot-xen-dtb.bbclass +15 -0
+write_lop_rm_pci() {
+    cat <<EOF >"$1"
+/dts-v1/;
+/ {
+    compatible = "system-device-tree-v1";
+    lops {
+        lop_1 {
+            compatible = "system-device-tree-v1,lop,modify";
+            modify = "/pcie@10000000::";
+        };
+     };
+};
+EOF
+}
+
write_lop_add_to_xen_cmdline() {
    EXTRA_XEN_BOOTARGS="$2"
    cat <<EOF >"$1"
classes/qemuboot-xen-dtb.bbclass +7 -1
@@ -135,6 +150,13 @@ generate_xen_qemuboot_dtb() {
    write_lop_add_to_xen_cmdline "${B}/lop-xen-cmdline.dts" \
        "${QB_XEN_CMDLINE_EXTRA}"
 
+    # On Qemu Arm32, Dom0 accessing PCI config space ends up in an
+    # infinite loop. Remove pci node from the device tree
+    if [ "${MACHINE}" = "qemuarm" ]; then
+        write_lop_rm_pci "${B}/lop-rm-pci.dts"
+        LOP_MODULE_ARGS="${LOP_MODULE_ARGS} -i ${B}/lop-rm-pci.dts"
+    fi
+
    if [ -z "${QB_XEN_DOMAIN_MODULES}" ]; then
        bbwarn "No domain modules: please set QB_XEN_DOMAIN_MODULES"
    fi
--

2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#7273): https://lists.yoctoproject.org/g/meta-virtualization/message/7273
Mute This Topic: https://lists.yoctoproject.org/mt/91015801/3619037
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#9 lore raw

Re: [meta-virtualization] [PATCH v2 4/4] xen: Disable PCI on qemuarm with Xen

In reply to Christopher Clark
Quoted 19 lines · Christopher Clark
Quoted 9 lines · Bertrand Marquis

Remove the pci node from the qemu device tree when runqemu is used with xen-qemuboot.

Linux is ending up in an infinite loop when trying to access PCI configuration space when running on top of Xen on arm32.
As we do not need or support any of the devices on PCI on arm32 at the moment, just remove the node from the device tree generated by qemu.

Quoted 6 lines

The problem does not appear at the moment without Xen and it is unclear why it is with Xen.
This will be investigated but in the meantime provide a working configuration for users.

Quoted 8 lines

Thanks for this - my review is from inspecting the patch applied; I have yet to test it but there's no need to hold this back with positive reports now from Bruce and Bertrand.

thanks,

Everything is merged to master and kirkstone.

Bruce

Quoted 61 lines

Christopher

Quoted 45 lines
---
 classes/qemuboot-xen-dtb.bbclass | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
classes/qemuboot-xen-dtb.bbclass +22 -1
index d43d23a..1f17a86 100644
@@ -63,6 +63,21 @@ write_lops_xen_section() {
 EOF
 }
 
+write_lop_rm_pci() {
+    cat <<EOF >"$1"
+/dts-v1/;
+/ {
+    compatible = "system-device-tree-v1";
+    lops {
+        lop_1 {
+            compatible = "system-device-tree-v1,lop,modify";
+            modify = "/pcie@10000000::";
+        };
+     };
+};
+EOF
+}
+
 write_lop_add_to_xen_cmdline() {
     EXTRA_XEN_BOOTARGS="$2"
     cat <<EOF >"$1"
@@ -135,6 +150,13 @@ generate_xen_qemuboot_dtb() {
     write_lop_add_to_xen_cmdline "${B}/lop-xen-cmdline.dts" \
         "${QB_XEN_CMDLINE_EXTRA}"
 
+    # On Qemu Arm32, Dom0 accessing PCI config space ends up in an
+    # infinite loop. Remove pci node from the device tree
+    if [ "${MACHINE}" = "qemuarm" ]; then
+        write_lop_rm_pci "${B}/lop-rm-pci.dts"
+        LOP_MODULE_ARGS="${LOP_MODULE_ARGS} -i ${B}/lop-rm-pci.dts"
+    fi
+
     if [ -z "${QB_XEN_DOMAIN_MODULES}" ]; then
         bbwarn "No domain modules: please set QB_XEN_DOMAIN_MODULES"
     fi
--
Quoted 5 lines

2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#7285): https://lists.yoctoproject.org/g/meta-virtualization/message/7285
Mute This Topic: https://lists.yoctoproject.org/mt/91015801/1050810
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
#10 lore raw

Re: [meta-virtualization] [PATCH v2 4/4] xen: Disable PCI on qemuarm with Xen

Hi Bruce,

Quoted 27 lines · Bruce Ashfield
Quoted 23 lines · Christopher Clark
Quoted 9 lines · Bertrand Marquis

Remove the pci node from the qemu device tree when runqemu is used with xen-qemuboot.

Linux is ending up in an infinite loop when trying to access PCI configuration space when running on top of Xen on arm32.
As we do not need or support any of the devices on PCI on arm32 at the moment, just remove the node from the device tree generated by qemu.

Quoted 6 lines

The problem does not appear at the moment without Xen and it is unclear why it is with Xen.
This will be investigated but in the meantime provide a working configuration for users.

Thanks for this - my review is from inspecting the patch applied; I have yet to test it but there's no need to hold this back with positive reports now from Bruce and Bertrand.

Quoted 6 lines
Quoted 4 lines

thanks,

Everything is merged to master and kirkstone.

Great, thanks a lot :-)

Cheers
Bertrand

Quoted 70 lines

Bruce

Quoted 61 lines

Christopher

Quoted 34 lines

---
classes/qemuboot-xen-dtb.bbclass | 22 ++++++++++++++++++++++

1 file changed, 22 insertions(+)
classes/qemuboot-xen-dtb.bbclass +0 -0
index d43d23a..1f17a86 100644
@@ -63,6 +63,21 @@ write_lops_xen_section() {

EOF
}

classes/qemuboot-xen-dtb.bbclass +15 -0
+write_lop_rm_pci() {
+ cat <<EOF >"$1"
+/dts-v1/;
+/ {
+ compatible = "system-device-tree-v1";
+ lops {
+ lop_1 {
+ compatible = "system-device-tree-v1,lop,modify";
+ modify = "/pcie@10000000::";
+ };
+ };
+};
+EOF
+}
+

write_lop_add_to_xen_cmdline() {
EXTRA_XEN_BOOTARGS="$2"
cat <<EOF >"$1"

classes/qemuboot-xen-dtb.bbclass +0 -0
@@ -135,6 +150,13 @@ generate_xen_qemuboot_dtb() {
 write_lop_add_to_xen_cmdline "${B}/lop-xen-cmdline.dts" \

"${QB_XEN_CMDLINE_EXTRA}"

Quoted 16 lines

+ # On Qemu Arm32, Dom0 accessing PCI config space ends up in an
+ # infinite loop. Remove pci node from the device tree
+ if [ "${MACHINE}" = "qemuarm" ]; then
+ write_lop_rm_pci "${B}/lop-rm-pci.dts"
+ LOP_MODULE_ARGS="${LOP_MODULE_ARGS} -i ${B}/lop-rm-pci.dts"
+ fi
+
if [ -z "${QB_XEN_DOMAIN_MODULES}" ]; then
bbwarn "No domain modules: please set QB_XEN_DOMAIN_MODULES" fi
--
2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#7285): https://lists.yoctoproject.org/g/meta-virtualization/message/7285
Mute This Topic: https://lists.yoctoproject.org/mt/91015801/1050810
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II