mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH master 1/7] test: self: ramfs: fix unintended macro identifier confusion
@ 2023-05-22  5:22 Ahmad Fatoum
  2023-05-22  5:22 ` [PATCH master 2/7] include: zero_page: hide possibly NULL pointer variable from optimizer Ahmad Fatoum
                   ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: Ahmad Fatoum @ 2023-05-22  5:22 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

int ret = (_ret) is problematic, because when _ret is replaced with ret
in a macro, we end up with int ret = ret, which is valid syntactically,
but invokes undefined behavior. Guard against this by using different
identifiers.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 test/self/ramfs.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/test/self/ramfs.c b/test/self/ramfs.c
index f8e1d60a61b5..bce396dc171e 100644
--- a/test/self/ramfs.c
+++ b/test/self/ramfs.c
@@ -14,17 +14,17 @@
 
 BSELFTEST_GLOBALS();
 
-#define __expect(_ret, _cond, fmt, ...) ({ \
-	bool cond = (_cond); \
-	int ret = (_ret); \
+#define __expect(ret, cond, fmt, ...) ({ \
+	bool __cond = (cond); \
+	int __ret = (ret); \
 	total_tests++; \
 	\
-	if (!cond) { \
+	if (!__cond) { \
 		failed_tests++; \
 		printf("%s:%d error %pe: " fmt "\n", \
-		       __func__, __LINE__, ERR_PTR(ret), ##__VA_ARGS__); \
+		       __func__, __LINE__, ERR_PTR(__ret), ##__VA_ARGS__); \
 	} \
-	cond; \
+	__cond; \
 })
 
 #define expect_success(ret, ...) __expect((ret), (ret) >= 0, __VA_ARGS__)
-- 
2.39.2




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

* [PATCH master 2/7] include: zero_page: hide possibly NULL pointer variable from optimizer
  2023-05-22  5:22 [PATCH master 1/7] test: self: ramfs: fix unintended macro identifier confusion Ahmad Fatoum
@ 2023-05-22  5:22 ` Ahmad Fatoum
  2023-05-23  6:46   ` Ahmad Fatoum
  2023-05-22  5:22 ` [PATCH master 3/7] ARM: configs: temporarily revive vexpress_defconfig Ahmad Fatoum
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 11+ messages in thread
From: Ahmad Fatoum @ 2023-05-22  5:22 UTC (permalink / raw)
  To: barebox

---
 include/zero_page.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/zero_page.h b/include/zero_page.h
index 26a12246f155..a71c0e0b8733 100644
--- a/include/zero_page.h
+++ b/include/zero_page.h
@@ -44,6 +44,8 @@ static inline void *zero_page_memcpy(void *dest, const void *src, size_t count)
 {
 	void *ret;
 
+	OPTIMIZER_HIDE_VAR(dest);
+
 	zero_page_access();
 	ret = memcpy(dest, src, count);
 	zero_page_faulting();
-- 
2.39.2




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

* [PATCH master 3/7] ARM: configs: temporarily revive vexpress_defconfig
  2023-05-22  5:22 [PATCH master 1/7] test: self: ramfs: fix unintended macro identifier confusion Ahmad Fatoum
  2023-05-22  5:22 ` [PATCH master 2/7] include: zero_page: hide possibly NULL pointer variable from optimizer Ahmad Fatoum
@ 2023-05-22  5:22 ` Ahmad Fatoum
  2023-05-22  8:23   ` Sascha Hauer
  2023-05-22  5:22 ` [PATCH master 4/7] ARM64: configs: temporarily revive qemu_virt64_defconfig Ahmad Fatoum
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 11+ messages in thread
From: Ahmad Fatoum @ 2023-05-22  5:22 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

Vexpress and the Qemu ARM Virt platform have a memory-mapped flash
starting at physical address 0. This clashes with the zero page used to
trap NULL pointer accesses when MMU is enabled. For this reason,
vexpress_defconfig disabled the MMU. vexpress_defconfig was removed in
favor of multi_v7_defconfig, but the latter enables the MMU, breaking
the ability to test barebox environment and state out of the box.

Patches to resolve that are being upstreamed, so until they are, let's
reinstate vexpress_defconfig.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 Documentation/user/virtio.rst       |  2 +-
 arch/arm/configs/vexpress_defconfig | 76 +++++++++++++++++++++++++++++
 2 files changed, 77 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/configs/vexpress_defconfig

diff --git a/Documentation/user/virtio.rst b/Documentation/user/virtio.rst
index a8624649f473..d944fa4821b1 100644
--- a/Documentation/user/virtio.rst
+++ b/Documentation/user/virtio.rst
@@ -44,7 +44,7 @@ Building barebox for QEMU targets is no different from others.
 For example, we can do the following with the CROSS_COMPILE environment
 variable being properly set to a working toolchain for ARM::
 
-  $ make multi_v7_defconfig
+  $ make vexpress_defconfig
   $ make
 
 Testing
diff --git a/arch/arm/configs/vexpress_defconfig b/arch/arm/configs/vexpress_defconfig
new file mode 100644
index 000000000000..d58ca7ebd0ec
--- /dev/null
+++ b/arch/arm/configs/vexpress_defconfig
@@ -0,0 +1,76 @@
+CONFIG_ARCH_VEXPRESS=y
+CONFIG_MACH_VEXPRESS=y
+CONFIG_MACH_VIRT=y
+CONFIG_AEABI=y
+CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
+CONFIG_MALLOC_SIZE=0x0
+CONFIG_MALLOC_TLSF=y
+CONFIG_KALLSYMS=y
+CONFIG_PROMPT="vexpress: "
+CONFIG_HUSH_FANCY_PROMPT=y
+CONFIG_CMDLINE_EDITING=y
+CONFIG_AUTO_COMPLETE=y
+CONFIG_MENU=y
+CONFIG_BOOTM_SHOW_TYPE=y
+CONFIG_BOOTM_VERBOSE=y
+CONFIG_BOOTM_INITRD=y
+CONFIG_CONSOLE_ACTIVATE_ALL=y
+CONFIG_CONSOLE_ALLOW_COLOR=y
+CONFIG_PARTITION_DISK_EFI=y
+CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y
+CONFIG_CMD_DMESG=y
+CONFIG_LONGHELP=y
+CONFIG_CMD_IOMEM=y
+CONFIG_CMD_MEMINFO=y
+# CONFIG_CMD_BOOTU is not set
+CONFIG_CMD_GO=y
+CONFIG_CMD_LOADB=y
+CONFIG_CMD_RESET=y
+CONFIG_CMD_UIMAGE=y
+CONFIG_CMD_PARTITION=y
+CONFIG_CMD_EXPORT=y
+CONFIG_CMD_PRINTENV=y
+CONFIG_CMD_SAVEENV=y
+CONFIG_CMD_FILETYPE=y
+CONFIG_CMD_UNCOMPRESS=y
+CONFIG_CMD_SLEEP=y
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_TFTP=y
+CONFIG_CMD_ECHO_E=y
+CONFIG_CMD_EDIT=y
+CONFIG_CMD_LOGIN=y
+CONFIG_CMD_MENU=y
+CONFIG_CMD_MENU_MANAGEMENT=y
+CONFIG_CMD_PASSWD=y
+CONFIG_CMD_READLINE=y
+CONFIG_CMD_TIMEOUT=y
+CONFIG_CMD_CRC=y
+CONFIG_CMD_CRC_CMP=y
+CONFIG_CMD_CLK=y
+CONFIG_CMD_DETECT=y
+CONFIG_CMD_POWEROFF=y
+CONFIG_CMD_OFTREE=y
+CONFIG_NET=y
+CONFIG_NET_NFS=y
+CONFIG_NET_NETCONSOLE=y
+CONFIG_OF_BAREBOX_DRIVERS=y
+CONFIG_SERIAL_AMBA_PL011=y
+CONFIG_VIRTIO_CONSOLE=y
+CONFIG_DRIVER_NET_SMC91111=y
+# CONFIG_SPI is not set
+CONFIG_MTD=y
+CONFIG_MTD_CONCAT=y
+CONFIG_DRIVER_CFI=y
+CONFIG_VIRTIO_BLK=y
+CONFIG_MCI=y
+CONFIG_MCI_MMCI=y
+CONFIG_HWRNG=y
+CONFIG_HW_RANDOM_VIRTIO=y
+# CONFIG_PINCTRL is not set
+CONFIG_VIRTIO_MMIO=y
+CONFIG_FS_EXT4=y
+CONFIG_FS_TFTP=y
+CONFIG_FS_FAT=y
+CONFIG_DIGEST_SHA1_GENERIC=y
+CONFIG_DIGEST_SHA256_GENERIC=y
-- 
2.39.2




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

* [PATCH master 4/7] ARM64: configs: temporarily revive qemu_virt64_defconfig
  2023-05-22  5:22 [PATCH master 1/7] test: self: ramfs: fix unintended macro identifier confusion Ahmad Fatoum
  2023-05-22  5:22 ` [PATCH master 2/7] include: zero_page: hide possibly NULL pointer variable from optimizer Ahmad Fatoum
  2023-05-22  5:22 ` [PATCH master 3/7] ARM: configs: temporarily revive vexpress_defconfig Ahmad Fatoum
@ 2023-05-22  5:22 ` Ahmad Fatoum
  2023-05-22  5:22 ` [PATCH master 5/7] pbl: have DEBUG_PBL depend only on PBL_CONSOLE Ahmad Fatoum
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Ahmad Fatoum @ 2023-05-22  5:22 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

The Qemu ARM64 Virt platform has a memory-mapped flash
starting at physical address 0. This clashes with the zero page used to
trap NULL pointer accesses when MMU is enabled. For this reason,
qemu_virt64_defconfig disabled the MMU. qemu_virt64_defconfig was removed
in favor of multi_v8_defconfig, but the latter enables the MMU, breaking
the ability to test barebox environment and state out of the box.

Another pitfall of multi_v8_defconfig is that it requires firmware to
build. Until there's a way to:

  make $defconfig
  make

result in a working QEMU Virt64 image, we should not drop the
qemu_virt64_defconfig file. We import here the last version with
CONFIG_MTD_CONCAT=y enabled.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/arm/configs/qemu_virt64_defconfig | 106 +++++++++++++++++++++++++
 1 file changed, 106 insertions(+)
 create mode 100644 arch/arm/configs/qemu_virt64_defconfig

diff --git a/arch/arm/configs/qemu_virt64_defconfig b/arch/arm/configs/qemu_virt64_defconfig
new file mode 100644
index 000000000000..5330380fe49d
--- /dev/null
+++ b/arch/arm/configs/qemu_virt64_defconfig
@@ -0,0 +1,106 @@
+CONFIG_ARCH_ARM64_VIRT=y
+CONFIG_ARM_PSCI_CLIENT=y
+CONFIG_MALLOC_SIZE=0x0
+CONFIG_KALLSYMS=y
+CONFIG_PROMPT=""
+CONFIG_HUSH_FANCY_PROMPT=y
+CONFIG_CMDLINE_EDITING=y
+CONFIG_AUTO_COMPLETE=y
+CONFIG_MENU=y
+CONFIG_BOOTM_INITRD=y
+CONFIG_BLSPEC=y
+CONFIG_CONSOLE_ACTIVATE_NONE=y
+CONFIG_CONSOLE_ALLOW_COLOR=y
+CONFIG_PARTITION_DISK_EFI=y
+CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y
+CONFIG_STATE=y
+CONFIG_BOOTCHOOSER=y
+CONFIG_RESET_SOURCE=y
+CONFIG_MACHINE_ID=y
+CONFIG_LONGHELP=y
+CONFIG_CMD_IOMEM=y
+CONFIG_CMD_IMD=y
+CONFIG_CMD_MEMINFO=y
+CONFIG_CMD_POLLER=y
+CONFIG_CMD_SLICE=y
+CONFIG_CMD_GO=y
+CONFIG_CMD_LOADB=y
+CONFIG_CMD_RESET=y
+CONFIG_CMD_UIMAGE=y
+CONFIG_CMD_BOOTCHOOSER=y
+CONFIG_CMD_PARTITION=y
+CONFIG_CMD_EXPORT=y
+CONFIG_CMD_PRINTENV=y
+CONFIG_CMD_MAGICVAR=y
+CONFIG_CMD_MAGICVAR_HELP=y
+CONFIG_CMD_SAVEENV=y
+CONFIG_CMD_FILETYPE=y
+CONFIG_CMD_LN=y
+CONFIG_CMD_SHA256SUM=y
+CONFIG_CMD_UNCOMPRESS=y
+CONFIG_CMD_SLEEP=y
+CONFIG_CMD_ECHO_E=y
+CONFIG_CMD_EDIT=y
+CONFIG_CMD_LOGIN=y
+CONFIG_CMD_MENU=y
+CONFIG_CMD_MENU_MANAGEMENT=y
+CONFIG_CMD_PASSWD=y
+CONFIG_CMD_SPLASH=y
+CONFIG_CMD_FBTEST=y
+CONFIG_CMD_READLINE=y
+CONFIG_CMD_TIMEOUT=y
+CONFIG_CMD_CRC=y
+CONFIG_CMD_CRC_CMP=y
+CONFIG_CMD_DETECT=y
+CONFIG_CMD_FLASH=y
+CONFIG_CMD_POWEROFF=y
+CONFIG_CMD_SMC=y
+CONFIG_CMD_BAREBOX_UPDATE=y
+CONFIG_CMD_OF_DIFF=y
+CONFIG_CMD_OF_NODE=y
+CONFIG_CMD_OF_PROPERTY=y
+CONFIG_CMD_OF_DISPLAY_TIMINGS=y
+CONFIG_CMD_OF_FIXUP_STATUS=y
+CONFIG_CMD_OF_OVERLAY=y
+CONFIG_CMD_OFTREE=y
+CONFIG_CMD_TIME=y
+CONFIG_NET=y
+CONFIG_NET_NFS=y
+CONFIG_NET_NETCONSOLE=y
+CONFIG_NET_DHCP=y
+CONFIG_NET_SNTP=y
+CONFIG_NET_FASTBOOT=y
+CONFIG_OF_BAREBOX_DRIVERS=y
+CONFIG_OF_BAREBOX_ENV_IN_FS=y
+CONFIG_OF_OVERLAY_LIVE=y
+CONFIG_SERIAL_AMBA_PL011=y
+CONFIG_VIRTIO_CONSOLE=y
+CONFIG_DRIVER_NET_VIRTIO=y
+# CONFIG_SPI is not set
+CONFIG_MTD=y
+CONFIG_MTD_CONCAT=y
+CONFIG_DRIVER_CFI=y
+CONFIG_CFI_BUFFER_WRITE=y
+CONFIG_DISK=y
+CONFIG_DISK_WRITE=y
+CONFIG_VIRTIO_BLK=y
+CONFIG_VIDEO=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_DRIVER_VIDEO_BOCHS_PCI=y
+CONFIG_SOUND=y
+CONFIG_VIRTIO_INPUT=y
+CONFIG_HWRNG=y
+CONFIG_HW_RANDOM_VIRTIO=y
+# CONFIG_PINCTRL is not set
+CONFIG_NVMEM=y
+CONFIG_NVMEM_RMEM=y
+CONFIG_PCI_ECAM_GENERIC=y
+CONFIG_NVMEM_REBOOT_MODE=y
+CONFIG_VIRTIO_MMIO=y
+CONFIG_VIRTIO_PCI=y
+CONFIG_FS_EXT4=y
+CONFIG_FS_NFS=y
+CONFIG_FS_FAT=y
+CONFIG_FS_PSTORE=y
+CONFIG_FS_PSTORE_CONSOLE=y
+CONFIG_DIGEST_SHA1_GENERIC=y
-- 
2.39.2




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

* [PATCH master 5/7] pbl: have DEBUG_PBL depend only on PBL_CONSOLE
  2023-05-22  5:22 [PATCH master 1/7] test: self: ramfs: fix unintended macro identifier confusion Ahmad Fatoum
                   ` (2 preceding siblings ...)
  2023-05-22  5:22 ` [PATCH master 4/7] ARM64: configs: temporarily revive qemu_virt64_defconfig Ahmad Fatoum
@ 2023-05-22  5:22 ` Ahmad Fatoum
  2023-05-22  5:22 ` [PATCH master 6/7] meminfo: avoid out-of-bounds compiler warning Ahmad Fatoum
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Ahmad Fatoum @ 2023-05-22  5:22 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

PBL_CONSOLE enables use of printf and friends in the prebootloader. The
underlying putc will be what was passed to pbl_set_putc or alternatively
the DEBUG_LL PUTC_LL implementation.

In either case, PBL_CONSOLE is required to get the PBL output useful to
debugging, so let's drop the DEBUG_LL depends, but keep the help text to
lessen user confusion.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 common/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/Kconfig b/common/Kconfig
index e423b4c33b3e..b9e175045608 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -1636,7 +1636,7 @@ config DEBUG_INITCALLS
 
 config DEBUG_PBL
 	bool "Print PBL debugging information"
-	depends on PBL_CONSOLE || DEBUG_LL
+	depends on PBL_CONSOLE
 	help
 	  If enabled this will enable all debug prints in the prebootloader.
 	  For this to work, a console needs to be configured in the
-- 
2.39.2




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

* [PATCH master 6/7] meminfo: avoid out-of-bounds compiler warning
  2023-05-22  5:22 [PATCH master 1/7] test: self: ramfs: fix unintended macro identifier confusion Ahmad Fatoum
                   ` (3 preceding siblings ...)
  2023-05-22  5:22 ` [PATCH master 5/7] pbl: have DEBUG_PBL depend only on PBL_CONSOLE Ahmad Fatoum
@ 2023-05-22  5:22 ` Ahmad Fatoum
  2023-05-22  5:22 ` [PATCH master 7/7] console: don't fixup baud rate into earlycon string Ahmad Fatoum
  2023-05-23  7:23 ` [PATCH master 1/7] test: self: ramfs: fix unintended macro identifier confusion Sascha Hauer
  6 siblings, 0 replies; 11+ messages in thread
From: Ahmad Fatoum @ 2023-05-22  5:22 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

GCC warns about _etext and __bss_stop being arrays whose starting address
is subtracted by one. The arrays are linker defined and subtracting them
is fine, so silence the warning by casting the pointer to an equally
sized integer with no limitations on arithmetic.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 common/meminfo.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/meminfo.c b/common/meminfo.c
index f4994959b6ae..3ceb0ba4cf25 100644
--- a/common/meminfo.c
+++ b/common/meminfo.c
@@ -13,8 +13,8 @@ static int display_meminfo(void)
 	ulong msize  = mend - mstart + 1;
 
 	if (!IS_ENABLED(CONFIG_SANDBOX)) {
-		pr_debug("barebox code: 0x%p -> 0x%p\n", _stext, _etext - 1);
-		pr_debug("bss segment:  0x%p -> 0x%p\n", __bss_start, __bss_stop - 1);
+		pr_debug("barebox code: 0x%lx -> 0x%lx\n", (ulong)_stext, (ulong)_etext - 1);
+		pr_debug("bss segment:  0x%lx -> 0x%lx\n", (ulong)__bss_start, (ulong)__bss_stop - 1);
 	}
 	pr_info("malloc space: 0x%08lx -> 0x%08lx (size %s)\n",
 		mstart, mend, size_human_readable(msize));
-- 
2.39.2




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

* [PATCH master 7/7] console: don't fixup baud rate into earlycon string
  2023-05-22  5:22 [PATCH master 1/7] test: self: ramfs: fix unintended macro identifier confusion Ahmad Fatoum
                   ` (4 preceding siblings ...)
  2023-05-22  5:22 ` [PATCH master 6/7] meminfo: avoid out-of-bounds compiler warning Ahmad Fatoum
@ 2023-05-22  5:22 ` Ahmad Fatoum
  2023-05-23  7:23 ` [PATCH master 1/7] test: self: ramfs: fix unintended macro identifier confusion Sascha Hauer
  6 siblings, 0 replies; 11+ messages in thread
From: Ahmad Fatoum @ 2023-05-22  5:22 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

By design, earlycon depends on boot firmware to setup the console for
Linux to use early before proper driver probe. When we specify the
baudrate though, the earlycon implementation may configure UART-internal
dividers to try to achieve the specified baudrate. The bus clock being
divided is defined statically Linux-architecture-wide using the BASE_BAUD
symbol, which is not suitable across different baudrates and SoCs.

Side step this issue by skipping fix up of the baudrate, so Linux just
uses what was preconfigured. This fixed global.bootm.earlycon=1 for
the ROCK-3A with 1.5 MBaud.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 common/console.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/console.c b/common/console.c
index c09c8e7d44c2..768550eb7df9 100644
--- a/common/console.c
+++ b/common/console.c
@@ -227,8 +227,8 @@ static void console_add_earlycon_param(struct console_device *cdev, unsigned bau
 	if (!cdev->linux_earlycon_name)
 		return;
 
-	str = basprintf("earlycon=%s,0x%lx,%dn8", cdev->linux_earlycon_name,
-			(ulong)cdev->phys_base, baudrate);
+	str = basprintf("earlycon=%s,0x%lx", cdev->linux_earlycon_name,
+			(ulong)cdev->phys_base);
 
 	dev_add_param_fixed(&cdev->class_dev, "linux.bootargs.earlycon", str);
 
-- 
2.39.2




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

* Re: [PATCH master 3/7] ARM: configs: temporarily revive vexpress_defconfig
  2023-05-22  5:22 ` [PATCH master 3/7] ARM: configs: temporarily revive vexpress_defconfig Ahmad Fatoum
@ 2023-05-22  8:23   ` Sascha Hauer
  2023-05-22  8:36     ` Ahmad Fatoum
  0 siblings, 1 reply; 11+ messages in thread
From: Sascha Hauer @ 2023-05-22  8:23 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

On Mon, May 22, 2023 at 07:22:18AM +0200, Ahmad Fatoum wrote:
> Vexpress and the Qemu ARM Virt platform have a memory-mapped flash
> starting at physical address 0. This clashes with the zero page used to
> trap NULL pointer accesses when MMU is enabled. For this reason,
> vexpress_defconfig disabled the MMU. vexpress_defconfig was removed in
> favor of multi_v7_defconfig, but the latter enables the MMU, breaking
> the ability to test barebox environment and state out of the box.
> 
> Patches to resolve that are being upstreamed, so until they are, let's
> reinstate vexpress_defconfig.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  Documentation/user/virtio.rst       |  2 +-
>  arch/arm/configs/vexpress_defconfig | 76 +++++++++++++++++++++++++++++
>  2 files changed, 77 insertions(+), 1 deletion(-)
>  create mode 100644 arch/arm/configs/vexpress_defconfig
> 
> diff --git a/Documentation/user/virtio.rst b/Documentation/user/virtio.rst
> index a8624649f473..d944fa4821b1 100644
> --- a/Documentation/user/virtio.rst
> +++ b/Documentation/user/virtio.rst
> @@ -44,7 +44,7 @@ Building barebox for QEMU targets is no different from others.
>  For example, we can do the following with the CROSS_COMPILE environment
>  variable being properly set to a working toolchain for ARM::
>  
> -  $ make multi_v7_defconfig
> +  $ make vexpress_defconfig
>    $ make
>  
>  Testing
> diff --git a/arch/arm/configs/vexpress_defconfig b/arch/arm/configs/vexpress_defconfig

vexpress_defconfig is not removed in master. The patch is still in
-next.

Sascha


-- 
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] 11+ messages in thread

* Re: [PATCH master 3/7] ARM: configs: temporarily revive vexpress_defconfig
  2023-05-22  8:23   ` Sascha Hauer
@ 2023-05-22  8:36     ` Ahmad Fatoum
  0 siblings, 0 replies; 11+ messages in thread
From: Ahmad Fatoum @ 2023-05-22  8:36 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

On 22.05.23 10:23, Sascha Hauer wrote:
> On Mon, May 22, 2023 at 07:22:18AM +0200, Ahmad Fatoum wrote:
>> Vexpress and the Qemu ARM Virt platform have a memory-mapped flash
>> starting at physical address 0. This clashes with the zero page used to
>> trap NULL pointer accesses when MMU is enabled. For this reason,
>> vexpress_defconfig disabled the MMU. vexpress_defconfig was removed in
>> favor of multi_v7_defconfig, but the latter enables the MMU, breaking
>> the ability to test barebox environment and state out of the box.
>>
>> Patches to resolve that are being upstreamed, so until they are, let's
>> reinstate vexpress_defconfig.
>>
>> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
>> ---
>>  Documentation/user/virtio.rst       |  2 +-
>>  arch/arm/configs/vexpress_defconfig | 76 +++++++++++++++++++++++++++++
>>  2 files changed, 77 insertions(+), 1 deletion(-)
>>  create mode 100644 arch/arm/configs/vexpress_defconfig
>>
>> diff --git a/Documentation/user/virtio.rst b/Documentation/user/virtio.rst
>> index a8624649f473..d944fa4821b1 100644
>> --- a/Documentation/user/virtio.rst
>> +++ b/Documentation/user/virtio.rst
>> @@ -44,7 +44,7 @@ Building barebox for QEMU targets is no different from others.
>>  For example, we can do the following with the CROSS_COMPILE environment
>>  variable being properly set to a working toolchain for ARM::
>>  
>> -  $ make multi_v7_defconfig
>> +  $ make vexpress_defconfig
>>    $ make
>>  
>>  Testing
>> diff --git a/arch/arm/configs/vexpress_defconfig b/arch/arm/configs/vexpress_defconfig
> 
> vexpress_defconfig is not removed in master. The patch is still in
> -next.

I am fine with either taking this to next or dropping the original commit.

> 
> Sascha
> 
> 

-- 
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] 11+ messages in thread

* Re: [PATCH master 2/7] include: zero_page: hide possibly NULL pointer variable from optimizer
  2023-05-22  5:22 ` [PATCH master 2/7] include: zero_page: hide possibly NULL pointer variable from optimizer Ahmad Fatoum
@ 2023-05-23  6:46   ` Ahmad Fatoum
  0 siblings, 0 replies; 11+ messages in thread
From: Ahmad Fatoum @ 2023-05-23  6:46 UTC (permalink / raw)
  To: barebox

On 22.05.23 07:22, Ahmad Fatoum wrote:

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>

> ---
>  include/zero_page.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/zero_page.h b/include/zero_page.h
> index 26a12246f155..a71c0e0b8733 100644
> --- a/include/zero_page.h
> +++ b/include/zero_page.h
> @@ -44,6 +44,8 @@ static inline void *zero_page_memcpy(void *dest, const void *src, size_t count)
>  {
>  	void *ret;
>  
> +	OPTIMIZER_HIDE_VAR(dest);
> +
>  	zero_page_access();
>  	ret = memcpy(dest, src, count);
>  	zero_page_faulting();

-- 
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] 11+ messages in thread

* Re: [PATCH master 1/7] test: self: ramfs: fix unintended macro identifier confusion
  2023-05-22  5:22 [PATCH master 1/7] test: self: ramfs: fix unintended macro identifier confusion Ahmad Fatoum
                   ` (5 preceding siblings ...)
  2023-05-22  5:22 ` [PATCH master 7/7] console: don't fixup baud rate into earlycon string Ahmad Fatoum
@ 2023-05-23  7:23 ` Sascha Hauer
  6 siblings, 0 replies; 11+ messages in thread
From: Sascha Hauer @ 2023-05-23  7:23 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

On Mon, May 22, 2023 at 07:22:16AM +0200, Ahmad Fatoum wrote:
> int ret = (_ret) is problematic, because when _ret is replaced with ret
> in a macro, we end up with int ret = ret, which is valid syntactically,
> but invokes undefined behavior. Guard against this by using different
> identifiers.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  test/self/ramfs.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)

Applied 1-2 and 5-7, thanks

Sascha

-- 
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] 11+ messages in thread

end of thread, other threads:[~2023-05-23  7:25 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-22  5:22 [PATCH master 1/7] test: self: ramfs: fix unintended macro identifier confusion Ahmad Fatoum
2023-05-22  5:22 ` [PATCH master 2/7] include: zero_page: hide possibly NULL pointer variable from optimizer Ahmad Fatoum
2023-05-23  6:46   ` Ahmad Fatoum
2023-05-22  5:22 ` [PATCH master 3/7] ARM: configs: temporarily revive vexpress_defconfig Ahmad Fatoum
2023-05-22  8:23   ` Sascha Hauer
2023-05-22  8:36     ` Ahmad Fatoum
2023-05-22  5:22 ` [PATCH master 4/7] ARM64: configs: temporarily revive qemu_virt64_defconfig Ahmad Fatoum
2023-05-22  5:22 ` [PATCH master 5/7] pbl: have DEBUG_PBL depend only on PBL_CONSOLE Ahmad Fatoum
2023-05-22  5:22 ` [PATCH master 6/7] meminfo: avoid out-of-bounds compiler warning Ahmad Fatoum
2023-05-22  5:22 ` [PATCH master 7/7] console: don't fixup baud rate into earlycon string Ahmad Fatoum
2023-05-23  7:23 ` [PATCH master 1/7] test: self: ramfs: fix unintended macro identifier confusion Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox