| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Linux only considers the value of CONFIG_ARCH_DMA_DEFAULT_COHERENT if
the architecture also defines either of:
- CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE
- CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU
- CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU_ALL
We don't have those in barebox and also have less architectures to
support, so we'll just select ARCH_DMA_DEFAULT_COHERENT from all
architectures where this applies to: x86, sandbox and RISC-V.
RISC-V already selects it, so we add it to the other two.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20240110160112.4134162-3-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
| |
We should do away altogether with <asm/common.h>, so prepare for doing
that in the future by moing the only content it has on sandbox into
Kconfig.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20231109124326.1499612-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
| |
The two sandbox related options are shown in the top-level menu.
Move them into an architecture-specific menu instead as done for other
architectures.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20231009115201.2210460-2-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
| |
When CONFIG_HAS_ASM_DEBUG_LL is set then include/debug_ll.h includes
asm/debug_ll.h, otherwise it includes mach/debug_ll.h. Drop this option
and instead always include asm/debug_ll.h and include mach/debug_ll.h
from there if necessary. This also adds the missing asm/debug_ll.h for
architectures which previously did not have that file.
Link: https://lore.barebox.org/20230302111606.1054037-6-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
| |
We have 9 symbols beginning with ARCH_HAS, but only with HAS_ARCH.
Change it over for symmetry. No functional change.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20221205133033.3008535-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
| |
We can't currently debug malloc() or early parts of the driver model on
sandbox, because we require both to allocate the sandbox console device.
To make debugging such early startup easier in future, add some simple
DEBUG_LL support.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20221004154800.3457742-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To verify only Kconfig/Makefile is touched:
git show --numstat --format=oneline HEAD | grep -v 'Kconfig\|Makefile'
will print only arch/powerpc/Kbuild.
To verify nothing unexpected is added:
git show -U0 | grep '^-[^-]\|^+[^+]' | sort -u
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220103120539.1730644-3-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For the sandbox architecture, we use __sanitizer_start_switch_fiber
and __sanitizer_finish_switch_fiber to tell ASan when we switch stacks.
If we don't, ASan complains that:
==2472828==WARNING: ASan is ignoring requested __asan_handle_no_return:
stack top: 0xff9fc000; bottom 0xf3be8000; size: 0x0be14000 (199311360)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
This works on 64-bit sandbox, but 32-bit sandbox currently crashes on
bthread -v:
==2469590==AddressSanitizer CHECK failed: ../../../../../src/libsanitizer/asan/asan_poisoning.cpp:37 "((AddrIsAlignedByGranularity(addr + size))) != (0)" (0x0, 0x0)
#0 0xf7a4aa46 in AsanCheckFailed ../../../../../src/libsanitizer/asan/asan_rtl.cpp:73
#1 0xf7a6b5cf in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) ../../../../../src/libsanitizer/sanitizer_common/sanitizer_termination.cpp:78
#2 0xf7a4489f in __asan::PoisonShadow(unsigned long, unsigned long, unsigned char) ../../../../../src/libsanitizer/asan/asan_poisoning.cpp:37
#3 0xf7a4c81b in __asan_handle_no_return ../../../../../src/libsanitizer/asan/asan_rtl.cpp:595
#4 0x566a1ce7 in bthread_schedule /home/a3f/dl/barebox-stm32mp/common/bthread.c:178
#5 0x566a1d54 in bthread_reschedule /home/a3f/dl/barebox-stm32mp/common/bthread.c:165
#6 0x566a1d80 in bthread_trampoline /home/a3f/dl/barebox-stm32mp/common/bthread.c:56
#7 0x567f5bfb in coroutine_bootstrap (/home/a3f/dl/build/barebox/sandbox/barebox+0x1bdbfb)
#8 0x567f5c4b in coroutine_trampoline (/home/a3f/dl/build/barebox/sandbox/barebox+0x1bdc4b)
#9 0xf7f7056f (linux-gate.so.1+0x56f)
#10 0xf7f70558 (linux-gate.so.1+0x558)
#11 0x56892fff (/home/a3f/dl/build/barebox/sandbox/barebox+0x25afff)
Just disable the special ASan accounting there until this is figured
out. bthreads still function there, but ASan may yield false positives
according to the message. This does not affect non-sandbox platforms.
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To extend incoming bthread support to sandbox, implement setjmp, longjmp
and initjmp. Unlike bare metal platforms, setjmp() and longjmp() are
readily provided on standard-conforming hosted platforms. initjmp() on
the other hand requires us to be able to invoke a function with a
user-supplied stack pointer, which isn't possible in standard C.
For POSIX systems, there are two methods to portably achieve this though:
- Use makecontext(2) to set up a new context. makecontext(2) was however
removed in POSIX.1-2008 and at least GCC 10.2.1 ASan complains that it
"doesn't fully support makecontext/swapcontext functions and may
produce false positives in some cases!"
- Use sigaltstack to set a new signal stack, raise the signal call,
setjmp in the signal handler to store the new stack pointer, return
regularly from signal handler and then longjmp back
Both methods are implemented in QEMU. While QEMU uses the makecontext
method by default, for the reasons described, import the second implementation
and use it implement initjmp.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
SDL 2.0 has been released more than 7 years ago and should be available
everywhere. Replace barebox's SDL 1.2 with SDL 2.0 instead:
- better maintained
- At least on Debian, you can't install x86_64 and i386 libsdl-dev at
the same time, which makes a quick use of CONFIG_SANDBOX_LINUX_I386
harder as the user needs to reinstall libraries. With SDL 2.0, it
works
- SDL 2.0 has easier audio API, which will be used in a later commit
- Wayland support for sandbox video driver
Port to SDL 2.0 and as we touch everything anyway, rename the
sdl_ functions to start with sdl_video_ to differentiate from upcoming
sdl_sound_.
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
| |
`make hosttools_defconfig` shows that PARTITION_DISK was selected
without all its dependencies being enabled as well.
Select the missing PARTITION symbol to fix this.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
5211e428cbab ("image: Convert the IH_... values to enums") removed the
IH_ARCH_LINUX enumeration value leading to breakage of sandbox
configurations that enable bootm. Instead of reinstating IH_ARCH_LINUX,
just use IH_ARCH_SANDBOX and remove mention of CONFIG_LINUX altogether,
it's always true anyway when CONFIG_SANDBOX is true.
Fixes: 5211e428cbab ("image: Convert the IH_... values to enums")
Cc: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
dc7f1fce6747 ("sandbox: fix SANDBOX_UNWIND dependency to be KASAN
only") already restricted ARCH_HAS_STACK_DUMP to be dependent
only on AddressSanitizer being available.
This change got lost by an erroneous merge conflict resolution in
39bdcdfb814a ("Merge branch 'for-next/misc' into master"). Fix it up.
Fixes: 39bdcdfb814a ("Merge branch 'for-next/misc' into master")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
While we can mount file systems on cdevs in barebox, partition table
parsing only works for block devices. Allow for
--image=argument,blkdev to try to mount an image as block device.
This will fail for files that aren't of a multiple of the 512 byte
block size. Host OS block devices are suitable for use as barebox
block devices always, so that's the default unless overridden with
a ,cdev suffix.
The initcall level has been changed to occur after fs initcall level.
This is required, because we can't have automounts without / mounted.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
On Linux, /proc/self/exe is a symlink to the originally exec(2)d
executable. We can exec that with the original argv to simulate
a reset. This is useful for shorter development cycles on sandbox
and in future, could be used to test barebox behavior around resets
(e.g. reset reason can be passed through via libc environment).
We leave the original hanging reset in place though, because:
- Many boards have multiple reset providers and incoming patches
will allow users to select a specific one. Having this on
sandbox as well makes testing easier.
- /proc/self/exe is Linux-specific and wouldn't work when being
run on e.g. BSDs or macOS
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
gcc v9.3.0's libubsan does not export a __sanitizer_print_stack_trace
symbol. Play it safe and avoid possible linker errors by having the
optional SANDBOX_UNWIND depend only on CONFIG_KASAN.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
| |
sandbox really has ASan support, that is address sanitizer with the help
of the userspace library libasan. In contrast KASan is used on real
hardware where we have to implement our own support code. Rename sandbox
KASan to ASan to not clash with upcoming KASan support.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
sizeof(dma_addr_t) == 8 shouldn't introduce any functional change, because
we can't have DMA on sandbox. For now it suppresses benign warnings about
mismatched pointer and integer sizes when some headers are included.
sizeof(phys_addr_t) == 8 was already the case on systems with
__x86_64__. As CONFIG_64BIT now is set according to the bitness
of the compiler, we can migrate this fully to Kconfig.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
| |
With the DMA stubs in place, we can indicate HAS_DMA in good conscience.
Do so.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If gcc supports multiple architectures, barebox uses only the default
when compiling for ARCH=sandbox, this is e.g. the case with compilers
that generate both 32- and 64-bit x86 executables.
There can be good reasons to force 32-bit though, e.g. to reduce memory
consumption while fuzzing or to temporarily avoid 32-to-64-bit warnings,
while running the static analyzer. Add an option for this.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
| |
All 64-bit architectures are supposed to define CONFIG_64BIT to support
the relevant 64-bit MMIO accessors. The sandbox architecture is a bit
of a special case, because barebox uses the toolchain default and
doesn't force a bitness. Add 64BIT as promptless symbol, which reflects
the pointer size of the target platform.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
It's not referenced anywhere anymore, so drop it.
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
For the hosted implementation, we just need to pass the appropriate
options at compile and link time. No further arch-specific
code needed.
Because we define our own handlers in lib/ubsan.c, linking against
libubsan isn't strictly required. We do it anyway on sandbox, so we can
use the backtrace functionality within.
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
| |
The sanitize unwind looks pretty and is just a function call away if we
are compiling with KASAN or UBSAN. Use it if available.
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Based on this linux kernel commit:
> commit 1572497cb0e6d2016078bc9d5a95786bb878389f
> Author: Christoph Hellwig <hch@lst.de>
> Date: Tue Jul 31 13:39:30 2018 +0200
>
> kconfig: include common Kconfig files from top-level Kconfig
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
| |
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
| |
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
| |
With multiboard support the compiletime generated BOARDINFO string
gets more and more meaningless. This removes it from Kconfig and
replaces it with a variable that can be set at boardlevel.
Also many boards have a standard setting for the hostname in the
environment. This patch also moves the standard to C code by calling
barebox_set_hostname().
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This will allow speed up the dev on framebuffer.
By default the resolution is VGA but this can be changed via cmdline.
We use a pthread to Flip the screen every 100ms as we can not detect when
barebox update it as barebox simpliy write in a buffer.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
| |
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
| |
Use asm-generic/bitops/xyz.h instead of using
generic_xyz functions.
Signed-off-by: Nishanth Menon <x0nishan@ti.com>
|
|
|
|
|
|
|
| |
This patch makes TEXT_BASE a consistent per-arch config switch.
Additionally, it converts all TEXT_BASE occurences from string to hex.
Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
|
|
|