* [PATCH 1/2] virtio: ring: fix erroneous behavior on MIPS
2023-11-24 6:01 [PATCH 0/2] virtio: ring: fix erroneous behavior on MIPS Antony Pavlov
@ 2023-11-24 6:01 ` Antony Pavlov
2023-11-24 6:01 ` [PATCH 2/2] MIPS: qemu-malta*_defconfig: enable virtio network driver Antony Pavlov
2023-11-27 7:21 ` [PATCH 0/2] virtio: ring: fix erroneous behavior on MIPS Sascha Hauer
2 siblings, 0 replies; 4+ messages in thread
From: Antony Pavlov @ 2023-11-24 6:01 UTC (permalink / raw)
To: barebox; +Cc: Ahmad Fatoum
How to reproduce the crash on the 64-bit malta board:
export ARCH=mips
export CROSS_COMPILE=mips-linux-gnu-
make qemu-malta64el_defconfig
sed -i "s/# \(CONFIG_DRIVER_NET_VIRTIO\).*$/\1=y/" .config
make oldconfig
make
...
qemu-system-mips64el -m 256 -M malta -cpu MIPS64R2-generic \
-bios ./images/barebox-qemu-malta.img.swapped \
-nodefaults -nographic \
-serial mon:stdio \
-net nic,model=virtio-net-pci -net user
...
barebox@qemu malta:/ dhcp
WARNING: eth0: No MAC address set. Using random address 9e:85:56:74:55:bb
Ooops, TLB miss on load or ifetch!
$ 0 : 0000000000000000 0000000000000004 000000000000000c 0000000000000001
$ 4 : ffffffffafb7fee8 000000000fb7402c 000000000000024e 0000000000000020
$ 8 : 0000000000000001 0000000000000001 0000000000000110 ffffffffafba6df0
$12 : 0000000000000008 ffffffffaffc9584 0000000000000001 646e617220676e69
$16 : ffffffffafb7fee8 ffffffffafb6fee8 00000000b2d05e00 ffffffffaffeb090
$20 : ffffffffafb800c0 0000000000000100 0000000000000122 ffffffffafb800f0
$24 : 0000000000000006 ffffffffaff93974
$28 : 0000000000000000 ffffffffafb5f9f0 ffffffffafff0000 ffffffffaff7a6e4
Hi : 0000000000000000
Lo : 000235e8a8000000
epc : ffffffffaffb5db0
ra : ffffffffaff7a6e4
Status: 00000082
Cause : 00000408
Config: 80004482
BadVA : 000000000fb74039
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
drivers/virtio/virtio_ring.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index fd21d3adcdb..0efe1e00250 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -256,8 +256,8 @@ void *virtqueue_get_buf(struct virtqueue *vq, unsigned int *len)
virtio_store_mb(&vring_used_event(&vq->vring),
cpu_to_virtio16(vq->vdev, vq->last_used_idx));
- return (void *)(uintptr_t)virtio64_to_cpu(vq->vdev,
- vq->vring.desc[i].addr);
+ return IOMEM((uintptr_t)virtio64_to_cpu(vq->vdev,
+ vq->vring.desc[i].addr));
}
static struct virtqueue *__vring_new_virtqueue(unsigned int index,
--
2.39.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/2] MIPS: qemu-malta*_defconfig: enable virtio network driver
2023-11-24 6:01 [PATCH 0/2] virtio: ring: fix erroneous behavior on MIPS Antony Pavlov
2023-11-24 6:01 ` [PATCH 1/2] " Antony Pavlov
@ 2023-11-24 6:01 ` Antony Pavlov
2023-11-27 7:21 ` [PATCH 0/2] virtio: ring: fix erroneous behavior on MIPS Sascha Hauer
2 siblings, 0 replies; 4+ messages in thread
From: Antony Pavlov @ 2023-11-24 6:01 UTC (permalink / raw)
To: barebox; +Cc: Ahmad Fatoum
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
arch/mips/configs/qemu-malta64el_defconfig | 1 +
arch/mips/configs/qemu-malta_defconfig | 1 +
2 files changed, 2 insertions(+)
diff --git a/arch/mips/configs/qemu-malta64el_defconfig b/arch/mips/configs/qemu-malta64el_defconfig
index 6091e6d0301..da3396246d5 100644
--- a/arch/mips/configs/qemu-malta64el_defconfig
+++ b/arch/mips/configs/qemu-malta64el_defconfig
@@ -64,6 +64,7 @@ CONFIG_OFDEVICE=y
CONFIG_OF_BAREBOX_DRIVERS=y
CONFIG_VIRTIO_CONSOLE=y
CONFIG_DRIVER_NET_RTL8139=y
+CONFIG_DRIVER_NET_VIRTIO=y
# CONFIG_SPI is not set
CONFIG_I2C=y
CONFIG_I2C_GPIO=y
diff --git a/arch/mips/configs/qemu-malta_defconfig b/arch/mips/configs/qemu-malta_defconfig
index 6cbc4efa86f..4be05b7e5a3 100644
--- a/arch/mips/configs/qemu-malta_defconfig
+++ b/arch/mips/configs/qemu-malta_defconfig
@@ -61,6 +61,7 @@ CONFIG_OFDEVICE=y
CONFIG_OF_BAREBOX_DRIVERS=y
CONFIG_VIRTIO_CONSOLE=y
CONFIG_DRIVER_NET_RTL8139=y
+CONFIG_DRIVER_NET_VIRTIO=y
# CONFIG_SPI is not set
CONFIG_I2C=y
CONFIG_I2C_GPIO=y
--
2.39.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] virtio: ring: fix erroneous behavior on MIPS
2023-11-24 6:01 [PATCH 0/2] virtio: ring: fix erroneous behavior on MIPS Antony Pavlov
2023-11-24 6:01 ` [PATCH 1/2] " Antony Pavlov
2023-11-24 6:01 ` [PATCH 2/2] MIPS: qemu-malta*_defconfig: enable virtio network driver Antony Pavlov
@ 2023-11-27 7:21 ` Sascha Hauer
2 siblings, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2023-11-27 7:21 UTC (permalink / raw)
To: Antony Pavlov; +Cc: barebox, Ahmad Fatoum
On Fri, Nov 24, 2023 at 09:01:28AM +0300, Antony Pavlov wrote:
> Antony Pavlov (2):
> virtio: ring: fix erroneous behavior on MIPS
> MIPS: qemu-malta*_defconfig: enable virtio network driver
Applied, thanks
Sascha
>
> arch/mips/configs/qemu-malta64el_defconfig | 1 +
> arch/mips/configs/qemu-malta_defconfig | 1 +
> drivers/virtio/virtio_ring.c | 4 ++--
> 3 files changed, 4 insertions(+), 2 deletions(-)
>
> --
> 2.39.0
>
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 4+ messages in thread