meta-virtualization.lists.yoctoproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] Vairous fixes for qemu support
@ 2022-05-10 15:35 Bertrand Marquis
  2022-05-10 15:35 ` [PATCH v2 1/4] xen: Fix class inherit in xen-image Bertrand Marquis
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Bertrand Marquis @ 2022-05-10 15:35 UTC (permalink / raw)
  To: meta-virtualization; +Cc: nd

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(-)

-- 
2.25.1



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v2 1/4] xen: Fix class inherit in xen-image
  2022-05-10 15:35 [PATCH v2 0/4] Vairous fixes for qemu support Bertrand Marquis
@ 2022-05-10 15:35 ` Bertrand Marquis
  2022-05-18  0:06   ` [meta-virtualization] " Christopher Clark
  2022-05-10 15:35 ` [PATCH v2 2/4] qemuboot: Fix command line and enable other machines Bertrand Marquis
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Bertrand Marquis @ 2022-05-10 15:35 UTC (permalink / raw)
  To: meta-virtualization; +Cc: nd

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

Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 recipes-extended/images/xen-image-minimal.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/recipes-extended/images/xen-image-minimal.bb b/recipes-extended/images/xen-image-minimal.bb
index 7f10b1d..9fd05d2 100644
--- a/recipes-extended/images/xen-image-minimal.bb
+++ b/recipes-extended/images/xen-image-minimal.bb
@@ -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



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v2 2/4] qemuboot: Fix command line and enable other machines
  2022-05-10 15:35 [PATCH v2 0/4] Vairous fixes for qemu support Bertrand Marquis
  2022-05-10 15:35 ` [PATCH v2 1/4] xen: Fix class inherit in xen-image Bertrand Marquis
@ 2022-05-10 15:35 ` Bertrand Marquis
  2022-05-10 15:35 ` [PATCH v2 3/4] xen: enable qemuboot for arm32 Bertrand Marquis
  2022-05-10 15:35 ` [PATCH v2 4/4] xen: Disable PCI on qemuarm with Xen Bertrand Marquis
  3 siblings, 0 replies; 11+ messages in thread
From: Bertrand Marquis @ 2022-05-10 15:35 UTC (permalink / raw)
  To: meta-virtualization; +Cc: nd

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.

Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 classes/qemuboot-xen-dtb.bbclass | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/classes/qemuboot-xen-dtb.bbclass b/classes/qemuboot-xen-dtb.bbclass
index 6fe3164..d43d23a 100644
--- a/classes/qemuboot-xen-dtb.bbclass
+++ b/classes/qemuboot-xen-dtb.bbclass
@@ -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}"
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v2 3/4] xen: enable qemuboot for arm32
  2022-05-10 15:35 [PATCH v2 0/4] Vairous fixes for qemu support Bertrand Marquis
  2022-05-10 15:35 ` [PATCH v2 1/4] xen: Fix class inherit in xen-image Bertrand Marquis
  2022-05-10 15:35 ` [PATCH v2 2/4] qemuboot: Fix command line and enable other machines Bertrand Marquis
@ 2022-05-10 15:35 ` Bertrand Marquis
  2022-05-18  0:11   ` [meta-virtualization] " Christopher Clark
  2022-05-10 15:35 ` [PATCH v2 4/4] xen: Disable PCI on qemuarm with Xen Bertrand Marquis
  3 siblings, 1 reply; 11+ messages in thread
From: Bertrand Marquis @ 2022-05-10 15:35 UTC (permalink / raw)
  To: meta-virtualization; +Cc: nd

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).

Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 classes/qemuboot-xen-defaults.bbclass | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/classes/qemuboot-xen-defaults.bbclass b/classes/qemuboot-xen-defaults.bbclass
index c7e74c3..f1550cc 100644
--- a/classes/qemuboot-xen-defaults.bbclass
+++ b/classes/qemuboot-xen-defaults.bbclass
@@ -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



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v2 4/4] xen: Disable PCI on qemuarm with Xen
  2022-05-10 15:35 [PATCH v2 0/4] Vairous fixes for qemu support Bertrand Marquis
                   ` (2 preceding siblings ...)
  2022-05-10 15:35 ` [PATCH v2 3/4] xen: enable qemuboot for arm32 Bertrand Marquis
@ 2022-05-10 15:35 ` Bertrand Marquis
  2022-05-18  0:14   ` [meta-virtualization] " Christopher Clark
  3 siblings, 1 reply; 11+ messages in thread
From: Bertrand Marquis @ 2022-05-10 15:35 UTC (permalink / raw)
  To: meta-virtualization; +Cc: nd

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.

Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 classes/qemuboot-xen-dtb.bbclass | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/classes/qemuboot-xen-dtb.bbclass b/classes/qemuboot-xen-dtb.bbclass
index d43d23a..1f17a86 100644
--- a/classes/qemuboot-xen-dtb.bbclass
+++ b/classes/qemuboot-xen-dtb.bbclass
@@ -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



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [meta-virtualization] [PATCH v2 1/4] xen: Fix class inherit in xen-image
  2022-05-10 15:35 ` [PATCH v2 1/4] xen: Fix class inherit in xen-image Bertrand Marquis
@ 2022-05-18  0:06   ` Christopher Clark
  0 siblings, 0 replies; 11+ messages in thread
From: Christopher Clark @ 2022-05-18  0:06 UTC (permalink / raw)
  To: Bertrand Marquis; +Cc: meta-virtualization, nd

On Tue, May 10, 2022 at 8:35 AM Bertrand Marquis
<bertrand.marquis@arm.com> wrote:
>
> 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
>
> Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>

Reviewed-by: Christopher Clark <christopher.w.clark@gmail.com>

thanks,

Christopher

> ---
>  recipes-extended/images/xen-image-minimal.bb | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/recipes-extended/images/xen-image-minimal.bb b/recipes-extended/images/xen-image-minimal.bb
> index 7f10b1d..9fd05d2 100644
> --- a/recipes-extended/images/xen-image-minimal.bb
> +++ b/recipes-extended/images/xen-image-minimal.bb
> @@ -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: meta-virtualization+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [christopher.w.clark+meta-virt@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [meta-virtualization] [PATCH v2 3/4] xen: enable qemuboot for arm32
  2022-05-10 15:35 ` [PATCH v2 3/4] xen: enable qemuboot for arm32 Bertrand Marquis
@ 2022-05-18  0:11   ` Christopher Clark
  0 siblings, 0 replies; 11+ messages in thread
From: Christopher Clark @ 2022-05-18  0:11 UTC (permalink / raw)
  To: Bertrand Marquis; +Cc: meta-virtualization, nd

On Tue, May 10, 2022 at 8:35 AM Bertrand Marquis
<bertrand.marquis@arm.com> wrote:
>
> 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).
>
> Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>

Reviewed-by: Christopher Clark <christopher.w.clark@gmail.com>

Christopher

> ---
>  classes/qemuboot-xen-defaults.bbclass | 20 +++++++++++++++-----
>  1 file changed, 15 insertions(+), 5 deletions(-)
>
> diff --git a/classes/qemuboot-xen-defaults.bbclass b/classes/qemuboot-xen-defaults.bbclass
> index c7e74c3..f1550cc 100644
> --- a/classes/qemuboot-xen-defaults.bbclass
> +++ b/classes/qemuboot-xen-defaults.bbclass
> @@ -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: meta-virtualization+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [christopher.w.clark@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [meta-virtualization] [PATCH v2 4/4] xen: Disable PCI on qemuarm with Xen
  2022-05-10 15:35 ` [PATCH v2 4/4] xen: Disable PCI on qemuarm with Xen Bertrand Marquis
@ 2022-05-18  0:14   ` Christopher Clark
  2022-05-18  7:36     ` Bertrand Marquis
  2022-05-18 17:59     ` Bruce Ashfield
  0 siblings, 2 replies; 11+ messages in thread
From: Christopher Clark @ 2022-05-18  0:14 UTC (permalink / raw)
  To: Bertrand Marquis; +Cc: meta-virtualization, nd

On Tue, May 10, 2022 at 8:35 AM Bertrand Marquis
<bertrand.marquis@arm.com> wrote:
>
> 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.
>
> Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>

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.

Reviewed-by: Christopher Clark <christopher.w.clark@gmail.com>

thanks,

Christopher

> ---
>  classes/qemuboot-xen-dtb.bbclass | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
>
> diff --git a/classes/qemuboot-xen-dtb.bbclass b/classes/qemuboot-xen-dtb.bbclass
> index d43d23a..1f17a86 100644
> --- a/classes/qemuboot-xen-dtb.bbclass
> +++ b/classes/qemuboot-xen-dtb.bbclass
> @@ -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: meta-virtualization+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [christopher.w.clark@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [meta-virtualization] [PATCH v2 4/4] xen: Disable PCI on qemuarm with Xen
  2022-05-18  0:14   ` [meta-virtualization] " Christopher Clark
@ 2022-05-18  7:36     ` Bertrand Marquis
  2022-05-18 17:59     ` Bruce Ashfield
  1 sibling, 0 replies; 11+ messages in thread
From: Bertrand Marquis @ 2022-05-18  7:36 UTC (permalink / raw)
  To: Christopher Clark; +Cc: meta-virtualization, nd

Hi Christopher,

> On 18 May 2022, at 01:14, Christopher Clark <christopher.w.clark@gmail.com> wrote:
> 
> On Tue, May 10, 2022 at 8:35 AM Bertrand Marquis
> <bertrand.marquis@arm.com> wrote:
>> 
>> 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.
>> 
>> Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
> 
> 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.
> 
> Reviewed-by: Christopher Clark <christopher.w.clark@gmail.com>
> 

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


> thanks,
> 
> Christopher
> 
>> ---
>> classes/qemuboot-xen-dtb.bbclass | 22 ++++++++++++++++++++++
>> 1 file changed, 22 insertions(+)
>> 
>> diff --git a/classes/qemuboot-xen-dtb.bbclass b/classes/qemuboot-xen-dtb.bbclass
>> index d43d23a..1f17a86 100644
>> --- a/classes/qemuboot-xen-dtb.bbclass
>> +++ b/classes/qemuboot-xen-dtb.bbclass
>> @@ -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: meta-virtualization+owner@lists.yoctoproject.org
>> Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [christopher.w.clark@gmail.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>> 



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [meta-virtualization] [PATCH v2 4/4] xen: Disable PCI on qemuarm with Xen
  2022-05-18  0:14   ` [meta-virtualization] " Christopher Clark
  2022-05-18  7:36     ` Bertrand Marquis
@ 2022-05-18 17:59     ` Bruce Ashfield
  2022-05-19  7:21       ` Bertrand Marquis
  1 sibling, 1 reply; 11+ messages in thread
From: Bruce Ashfield @ 2022-05-18 17:59 UTC (permalink / raw)
  To: Christopher Clark; +Cc: Bertrand Marquis, meta-virtualization, nd

On Tue, May 17, 2022 at 8:14 PM Christopher Clark
<christopher.w.clark@gmail.com> wrote:
>
> On Tue, May 10, 2022 at 8:35 AM Bertrand Marquis
> <bertrand.marquis@arm.com> wrote:
> >
> > 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.
> >
> > Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
>
> 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.
>
> Reviewed-by: Christopher Clark <christopher.w.clark@gmail.com>
>
> thanks,
>

Everything is merged to master and kirkstone.

Bruce

> Christopher
>
> > ---
> >  classes/qemuboot-xen-dtb.bbclass | 22 ++++++++++++++++++++++
> >  1 file changed, 22 insertions(+)
> >
> > diff --git a/classes/qemuboot-xen-dtb.bbclass b/classes/qemuboot-xen-dtb.bbclass
> > index d43d23a..1f17a86 100644
> > --- a/classes/qemuboot-xen-dtb.bbclass
> > +++ b/classes/qemuboot-xen-dtb.bbclass
> > @@ -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 (#7285): https://lists.yoctoproject.org/g/meta-virtualization/message/7285
> Mute This Topic: https://lists.yoctoproject.org/mt/91015801/1050810
> Group Owner: meta-virtualization+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [bruce.ashfield@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [meta-virtualization] [PATCH v2 4/4] xen: Disable PCI on qemuarm with Xen
  2022-05-18 17:59     ` Bruce Ashfield
@ 2022-05-19  7:21       ` Bertrand Marquis
  0 siblings, 0 replies; 11+ messages in thread
From: Bertrand Marquis @ 2022-05-19  7:21 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: Christopher Clark, meta-virtualization, nd

Hi Bruce,

> On 18 May 2022, at 18:59, Bruce Ashfield <bruce.ashfield@gmail.com> wrote:
> 
> On Tue, May 17, 2022 at 8:14 PM Christopher Clark
> <christopher.w.clark@gmail.com> wrote:
>> 
>> On Tue, May 10, 2022 at 8:35 AM Bertrand Marquis
>> <bertrand.marquis@arm.com> wrote:
>>> 
>>> 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.
>>> 
>>> Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
>> 
>> 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.
>> 
>> Reviewed-by: Christopher Clark <christopher.w.clark@gmail.com>
>> 
>> thanks,
>> 
> 
> Everything is merged to master and kirkstone.

Great, thanks a lot :-)

Cheers
Bertrand

> 
> Bruce
> 
>> Christopher
>> 
>>> ---
>>> classes/qemuboot-xen-dtb.bbclass | 22 ++++++++++++++++++++++
>>> 1 file changed, 22 insertions(+)
>>> 
>>> diff --git a/classes/qemuboot-xen-dtb.bbclass b/classes/qemuboot-xen-dtb.bbclass
>>> index d43d23a..1f17a86 100644
>>> --- a/classes/qemuboot-xen-dtb.bbclass
>>> +++ b/classes/qemuboot-xen-dtb.bbclass
>>> @@ -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 (#7285): https://lists.yoctoproject.org/g/meta-virtualization/message/7285
>> Mute This Topic: https://lists.yoctoproject.org/mt/91015801/1050810
>> Group Owner: meta-virtualization+owner@lists.yoctoproject.org
>> Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [bruce.ashfield@gmail.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>> 
> 
> 
> -- 
> - Thou shalt not follow the NULL pointer, for chaos and madness await
> thee at its end
> - "Use the force Harry" - Gandalf, Star Trek II



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-05-19  7:21 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-10 15:35 [PATCH v2 0/4] Vairous fixes for qemu support Bertrand Marquis
2022-05-10 15:35 ` [PATCH v2 1/4] xen: Fix class inherit in xen-image Bertrand Marquis
2022-05-18  0:06   ` [meta-virtualization] " Christopher Clark
2022-05-10 15:35 ` [PATCH v2 2/4] qemuboot: Fix command line and enable other machines Bertrand Marquis
2022-05-10 15:35 ` [PATCH v2 3/4] xen: enable qemuboot for arm32 Bertrand Marquis
2022-05-18  0:11   ` [meta-virtualization] " Christopher Clark
2022-05-10 15:35 ` [PATCH v2 4/4] xen: Disable PCI on qemuarm with Xen Bertrand Marquis
2022-05-18  0:14   ` [meta-virtualization] " Christopher Clark
2022-05-18  7:36     ` Bertrand Marquis
2022-05-18 17:59     ` Bruce Ashfield
2022-05-19  7:21       ` Bertrand Marquis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).