[PATCH v3 03/12] virtio_ring: Maintain a shadow copy of descriptors

2022-05-16 Thread Andrew Scull
: Andrew Scull Reviewed-by: Simon Glass --- drivers/virtio/virtio_ring.c | 49 include/virtio_ring.h| 10 2 files changed, 43 insertions(+), 16 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index d3fc842f30

[PATCH v3 04/12] virtio_ring: Check used descriptors are chain heads

2022-05-16 Thread Andrew Scull
When the device returns used buffers, it should refer to the descriptor that is the head of the descriptor chain for that buffer. Confirm this to be the case by tracking the head of descriptor chains that have been made available to the device. Signed-off-by: Andrew Scull Reviewed-by: Simon

[PATCH v3 01/12] virtio_ring: Merge identical variables

2022-05-16 Thread Andrew Scull
The variables `total_sg` and `descs_used` have the same value. Replace the few uses of `total_sg` with `descs_used` to simplify the situation. Signed-off-by: Andrew Scull Reviewed-by: Simon Glass Reviewed-by: Bin Meng --- drivers/virtio/virtio_ring.c | 7 +++ 1 file changed, 3 insertions

Re: [PATCH v2] sandbox: sdl: Add stub sandbox_sdl_remove_display()

2022-05-15 Thread Andrew Scull
Friendly ping on this patch as I've seen a few others being accepted recently and wanted to make sure this fix hasn't fallen by the wayside. On Wed, 23 Mar 2022 at 20:20, Andrew Scull wrote: > > Building the sandbox with NO_SDL=1 resulted in an undefi

[PATCH 4/4] boot: Kconfig: Enable FIT processing by default on TI secure devices

2022-05-04 Thread Andrew Davis
TI secure devices chain-of-trust depends on FIT image processing, enable it by default on these devices. This also reduces the delta between the secure and non-secure defconfig files. Signed-off-by: Andrew Davis --- boot/Kconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/boot/Kconfig

[PATCH 2/4] spl: Force disable non-FIT loading for TI secure devices

2022-05-04 Thread Andrew Davis
Booting of non-FIT images bypass our chain-of-trust boot flow, these options should not be allowed when high security is set. Signed-off-by: Andrew Davis --- common/spl/Kconfig | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/spl/Kconfig b/common/spl/Kconfig

[PATCH 1/4] spl: Rename Kconfig SPL_LEGACY_IMAGE_SUPPORT to SPL_LEGACY_IMAGE_FORMAT

2022-05-04 Thread Andrew Davis
This matches what this support is called in the non-SPL case. The postfix _SUPPORT is redundant as enabling Kconfig options implies support. With this we can use CONFIG_IS_ENABLED() as needed. Signed-off-by: Andrew Davis --- common/spl/Kconfig | 6 +++--- common/spl

[PATCH 3/4] boot: Kconfig: Disable non-FIT loading for TI secure devices

2022-05-04 Thread Andrew Davis
Non-FIT image loading support should be disabled for TI secure devices as the image handlers for those image types do not follow our secure boot checks. Signed-off-by: Andrew Davis --- boot/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boot/Kconfig b/boot/Kconfig

Re: [RFC PATCH 2/8] rockchip: Add binman definitions for final images

2022-05-04 Thread Andrew Abbott
all the patches in the next version, as well as renaming "u-boot-rockchip-sdmmc.bin" to "u-boot-rockchip.bin" - that should be equivalent to the original output. Regards, Andrew

Re: [PATCH v2 03/12] sandbox: Migrate getopt section to linker list

2022-05-02 Thread Andrew Scull
On Fri, 29 Apr 2022 at 08:11, Tom Rini wrote: > > On Thu, Apr 14, 2022 at 01:59:32PM +, Andrew Scull wrote: > > > Use the common infrastructure to create a linker list of the sandbox > > command line flags rather than using a custom method. > > > > The list is

[RFC PATCH 8/8] board: rockpro64: Enable building SPI image

2022-04-24 Thread Andrew Abbott
Signed-off-by: Andrew Abbott --- arch/arm/mach-rockchip/rk3399/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-rockchip/rk3399/Kconfig b/arch/arm/mach-rockchip/rk3399/Kconfig index c1f251316c..4a049935df 100644 --- a/arch/arm/mach-rockchip/rk3399/Kconfig +++ b/arch/arm

[RFC PATCH 6/8] rockchip: Enable binman for ARM64

2022-04-24 Thread Andrew Abbott
Binman is now being used to build the final flashable images for Rockchip devices, thus enabling it for all Rockchip targets here. But it is not yet being used to generate the FIT image (u-boot.itb), thus we need to force it to be built. Signed-off-by: Andrew Abbott --- Question: Will this

[RFC PATCH 7/8] doc: rockchip: Update for new binman image generation

2022-04-24 Thread Andrew Abbott
Signed-off-by: Andrew Abbott --- doc/board/rockchip/rockchip.rst | 34 +++-- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/doc/board/rockchip/rockchip.rst b/doc/board/rockchip/rockchip.rst index 4ca7b00b1f..1639ce4f72 100644 --- a/doc/board/rockchip

[RFC PATCH 5/8] rockchip: Remove obsolete Makefile targets

2022-04-24 Thread Andrew Abbott
These are obsoleted by a previous patch which added binman image definitions for Rockchip SD/MMC and SPI images. Signed-off-by: Andrew Abbott --- Makefile | 31 +++ 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/Makefile b/Makefile index 7937a4cfd3

[RFC PATCH 4/8] board: rockchip: Move SPI U-Boot offset to config

2022-04-24 Thread Andrew Abbott
_SYS_SPI_U_BOOT_OFFS', so this change should not functionally change the offset for any of the affected boards. Signed-off-by: Andrew Abbott --- arch/arm/dts/rk3368-lion-haikou-u-boot.dtsi | 1 - arch/arm/dts/rk3399-pinebook-pro-u-boot.dtsi | 4 arch/arm/dts/rk3399-puma-haikou-u-boot.dt

[RFC PATCH 3/8] soc: rockchip: Include common U-Boot dtsi file

2022-04-24 Thread Andrew Abbott
This pulls in binman definitions so images can be built for all Rockchip platforms. Signed-off-by: Andrew Abbott --- arch/arm/dts/rk3308-u-boot.dtsi | 2 ++ arch/arm/dts/rk3328-u-boot.dtsi | 2 ++ arch/arm/dts/rk3368-u-boot.dtsi | 1 + arch/arm/dts/rk3568-u-boot.dtsi | 2 ++ 4 files changed, 7

[RFC PATCH 2/8] rockchip: Add binman definitions for final images

2022-04-24 Thread Andrew Abbott
. Signed-off-by: Andrew Abbott --- Question: Does this break/not play nicely with rockchip-optee generation? It creates u-boot.itb for rk3288 targets. That would need to run before what I've implemented here? --- arch/arm/dts/rockchip-u-boot.dtsi | 59 +++ arch/arm

[RFC PATCH 1/8] binman: mkimage: Support ':'-separated inputs

2022-04-24 Thread Andrew Abbott
ned-off-by: Andrew Abbott --- This is a bit of a messy implementation for now and would probably break existing uses of mkimage that rely on the concatenation behaviour. Questions: - Should this be a separate entry type, or an option to the mkimage entry type that enables this behaviour? - What ki

[RFC PATCH 0/8] Build Rockchip final images using binman

2022-04-24 Thread Andrew Abbott
s: - I noticed that ATF generation for ARM64 Rockchip is done via a Python script instead of binman. I don't currently know how to change that over to binman, but is that something worth pursuing as part of this? Please give me your feedback! Andrew Abbott (8): binman: mkimage: S

[PATCH v3 00/18] virtio: pci: Add and fix consistency checks

2022-04-21 Thread Andrew Scull
the current implementations don't have the needed consistencty checks. Changelog: v2: - Refactor dm_pci_* functions, not adding new ones - Reorder patches per request in v1 v3: - Use CI to test more targets - Move EA config patch to end for dropping if needed Andrew Scull (18): virtio

Re: [PATCH 11/11] doc: ti: Add readme for AM62x SK

2022-04-18 Thread Andrew Davis
abihf- am62x_evm_r5_defconfig O=/tmp/r5 Lets not pollute directories outside of the current one, suggest `O=build/r5` and the same below. Andrew

[PATCH] fdt: Fix TPL SEPARATE_BSS check when locating DTB

2022-04-16 Thread Andrew Abbott
ned, but because of the above, only TPL options are considered. Since there is no CONFIG_TPL_SEPARATE_BSS, this fails. Fixes: 690af71850 ("fdt: Correct condition for SEPARATE_BSS") Signed-off-by: Andrew Abbott --- The serial output from a ROCKPro64 booting master (9859465bfe) is:

[PATCH v2 12/12] virtio_ring: Reduce logging noise

2022-04-14 Thread Andrew Scull
Demote logs about problems with the vrings to debug level rather than always logging. This reduces noise from the logs, especially in the fuzz test where these cases get reached frequently. Signed-off-by: Andrew Scull --- drivers/virtio/virtio_ring.c | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH v2 07/12] test: fuzz: Add framework for fuzzing

2022-04-14 Thread Andrew Scull
Add the basic infrastructure for declaring fuzz tests and a command to invoke them. Signed-off-by: Andrew Scull Reviewed-by: Simon Glass --- Kconfig | 9 + include/test/fuzz.h | 51 +++ test/Makefile| 1 + test/fuzz/Makefile | 7 test

[PATCH v2 06/12] fuzzing_engine: Add fuzzing engine uclass

2022-04-14 Thread Andrew Scull
This new class of device will provide fuzzing inputs from a fuzzing engine. Signed-off-by: Andrew Scull Reviewed-by: Simon Glass --- drivers/Kconfig | 2 ++ drivers/Makefile | 1 + drivers/fuzz/Kconfig | 9 + drivers/fuzz/Makefile

[PATCH v2 05/12] sandbox: Add support for Address Sanitizer

2022-04-14 Thread Andrew Scull
tions. Alternatively, the sandbox may be able to play games with the system allocator and somehow still keep the required memory abstraction. No effort to address dynamic allocation is made by this patch. Signed-off-by: Andrew Scull Reviewed-by: Simon Glass --- Kconfig

[PATCH v2 04/12] linker_lists: Rename sections to remove . prefix

2022-04-14 Thread Andrew Scull
h clang's ASAN instrumentation which tries to add redzones between the linker list elements, causing expected accesses to fail. However, clang doesn't try to add redzones to user sections, which are names with all alphanumeric and underscore characters. Signed-off-by: Andrew Scull Revie

[PATCH v2 03/12] sandbox: Migrate getopt section to linker list

2022-04-14 Thread Andrew Scull
Use the common infrastructure to create a linker list of the sandbox command line flags rather than using a custom method. The list is changed from containing pointers to containing structs and the uses are updated accordingly. Signed-off-by: Andrew Scull Reviewed-by: Simon Glass --- arch

[PATCH v2 02/12] sandbox: Rename EFI runtime sections

2022-04-14 Thread Andrew Scull
ed redzones to the sections and the extra padding meant that the relocation list was no longer in the expected format. Naming the sections as user sections resolves this issue. Signed-off-by: Andrew Scull --- arch/sandbox/cpu/u-boot.lds | 22 ++ arch/sandbox/lib/sections.c

[PATCH v2 01/12] sandbox: Fix EFI runtime symbol placement

2022-04-14 Thread Andrew Scull
The EFI symbols are collected in subsections of the .text, .rodata, .data and .rel sections. Use those when creating EFI runtime sections. Fixes: 7bf07cf872 (Partially revert "efi_loader: Rename sections to allow for implicit data") Signed-off-by: Andrew Scull Cc: Heinrich Schuchardt

[PATCH 00/11] Fuzzing and ASAN for sandbox

2022-04-14 Thread Andrew Scull
aming and explaining - dropped RFC for dlmalloc ASAN instrumentation (work required to improve it) - added patch to reduce logging noise in fuzzer Andrew Scull (12): sandbox: Fix EFI runtime symbol placement sandbox: Rename EFI runtime sections sandbox: Migrate getopt section to linke

Re: [PATCH v2 09/18] pci: Add config for Enhanced Allocation

2022-04-14 Thread Andrew Scull
On Thu, 14 Apr 2022 at 08:58, Andrew Scull wrote: > > On Thu, 14 Apr 2022 at 01:42, Bin Meng wrote: > > > > On Thu, Apr 14, 2022 at 12:30 AM Andrew Scull wrote: > > > > > > > > diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig > > > >

Re: [PATCH v2 09/18] pci: Add config for Enhanced Allocation

2022-04-14 Thread Andrew Scull
On Thu, 14 Apr 2022 at 01:42, Bin Meng wrote: > > On Thu, Apr 14, 2022 at 12:30 AM Andrew Scull wrote: > > > > > > diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig > > > > index 47cd074aa1..fd2203420c 100644 > > > > --- a/drive

Re: [PATCH v2 13/18] pci: Map bars with offset and length

2022-04-13 Thread Andrew Scull
On Wed, 13 Apr 2022 at 15:05, Bin Meng wrote: > > On Wed, Mar 30, 2022 at 12:59 AM Andrew Scull wrote: > > > > Evolve dm_pci_map_bar() to include an offset and length parameter. These > > allow a portion of the memory to be mapped and range checks to be > > app

Re: [PATCH v2 12/18] test: pci: Test PCI address conversion functions

2022-04-13 Thread Andrew Scull
On Wed, 13 Apr 2022 at 15:03, Bin Meng wrote: > > On Wed, Mar 30, 2022 at 12:59 AM Andrew Scull wrote: > > > > Add tests for the functions dm_pci_bus_to_phys() and > > dm_pci_phys_to_bus() which convert between PCI bus addresses and > > physical addresses based on t

Re: [PATCH v2 08/18] pci: Fix use of flags in dm_pci_map_bar()

2022-04-13 Thread Andrew Scull
> > diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c > > index 33dda2..8bbeb62f2e 100644 > > --- a/drivers/pci/pci-uclass.c > > +++ b/drivers/pci/pci-uclass.c > > @@ -1533,8 +1533,8 @@ static phys_addr_t dm_pci_map_ea_virt(struct udevice > > *dev, int ea_off, > > return

[PATCH v2 12/12] test: dm: virtio_rng: Test virtio-rng with faked device

2022-04-13 Thread Andrew Scull
Add a regression test for virtio-rng reading beyond the end of its buffer if the virtio device provides an invalid length. Signed-off-by: Andrew Scull Reviewed-by: Simon Glass --- test/dm/Makefile | 1 + test/dm/virtio_rng.c | 52 2 files

[PATCH v2 11/12] virtio: rng: Check length before copying

2022-04-13 Thread Andrew Scull
Check the length of data written by the device is consistent with the size of the buffers to avoid out-of-bounds memory accesses in case values aren't consistent. Signed-off-by: Andrew Scull Cc: Sughosh Ganu Reviewed-by: Simon Glass --- drivers/virtio/virtio_rng.c | 3 +++ 1 file chang

[PATCH v2 10/12] test: dm: virtio: Test virtio device driver probing

2022-04-13 Thread Andrew Scull
Once the virtio-rng driver has been bound, probe it to trigger the pre and post child probe hooks of the virtio uclass driver. Check the status of the virtio device to confirm it reached the expected state. Signed-off-by: Andrew Scull Reviewed-by: Simon Glass --- test/dm/virtio_device.c | 9

[PATCH v2 08/12] test: dm: virtio: Split out virtio device tests

2022-04-13 Thread Andrew Scull
Virtio tests that find a child device require the virtio device driver to be included in the build so it can probe. The sandbox virtio transport driver currently reports a virtio-blk device so make sure the corresponding driver is built before running tests that need it. Signed-off-by: Andrew

[PATCH v2 09/12] virtio: sandbox: Bind RNG rather than block device

2022-04-13 Thread Andrew Scull
The virtio-rng driver is extremely simple, making it suitable for testing more of the virtio uclass logic. Have the sandbox driver bind the virtio-rng driver rather than the virtio-blk driver so it can be used in tests. Signed-off-by: Andrew Scull Reviewed-by: Simon Glass --- drivers/virtio

[PATCH v2 07/12] test: dm: virtio: Test notify before del_vqs

2022-04-13 Thread Andrew Scull
ge and it was a bad example. Signed-off-by: Andrew Scull Reviewed-by: Simon Glass --- test/dm/virtio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/dm/virtio.c b/test/dm/virtio.c index aa4e3d778e..ff1dea323c 100644 --- a/test/dm/virtio.c +++ b/test/dm/virtio.c

[PATCH v2 06/12] virtio: sandbox: Fix device features bitfield

2022-04-13 Thread Andrew Scull
The virtio sandbox transport was setting the device features value to the bit index rather than shifting a bit to the right index. Fix this using the bit manipulation macros. Signed-off-by: Andrew Scull Reviewed-by: Simon Glass --- drivers/virtio/virtio_sandbox.c | 2 +- test/dm/virtio.c

[PATCH v2 05/12] dm: test: virtio: Test the virtio ring

2022-04-13 Thread Andrew Scull
The virtio ring is the basis of virtio communication. Test its basic functionality and its resilience against corruption from the device. Signed-off-by: Andrew Scull Reviewed-by: Simon Glass --- test/dm/virtio.c | 72 1 file changed, 72

[PATCH v2 04/12] virtio_ring: Check used descriptors are chain heads

2022-04-13 Thread Andrew Scull
When the device returns used buffers, it should refer to the descriptor that is the head of the descriptor chain for that buffer. Confirm this to be the case by tracking the head of descriptor chains that have been made available to the device. Signed-off-by: Andrew Scull Reviewed-by: Simon

[PATCH v2 03/12] virtio_ring: Maintain a shadow copy of descriptors

2022-04-13 Thread Andrew Scull
: Andrew Scull Reviewed-by: Simon Glass --- drivers/virtio/virtio_ring.c | 49 include/virtio_ring.h| 10 2 files changed, 43 insertions(+), 16 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 8e0cb3d666

[PATCH v2 02/12] virtio_ring: Add helper to attach vring descriptor

2022-04-13 Thread Andrew Scull
Move the logic for attaching a descriptor to its own function. Signed-off-by: Andrew Scull Reviewed-by: Simon Glass --- drivers/virtio/virtio_ring.c | 30 +++--- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers

[PATCH v2 01/12] virtio_ring: Merge identical variables

2022-04-13 Thread Andrew Scull
The variables `total_sg` and `descs_used` have the same value. Replace the few uses of `total_sg` with `descs_used` to simplify the situation. Signed-off-by: Andrew Scull Reviewed-by: Simon Glass --- drivers/virtio/virtio_ring.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions

Re: [PATCH 00/11] virtio: Harden and test vring

2022-04-12 Thread Andrew Scull
On Tue, 12 Apr 2022 at 19:10, Tom Rini wrote: > > On Thu, Mar 31, 2022 at 10:09:38AM +, Andrew Scull wrote: > > > Continuing the theme of making the virtio code resilient against > > corruption of the buffers shared with the device, this series focusses > > o

Re: [PATCH 10/11] fuzz: virtio: Add fuzzer for vring

2022-04-12 Thread Andrew Scull
On Mon, 11 Apr 2022 at 19:36, Simon Glass wrote: > > Hi Andrew, > > On Thu, 7 Apr 2022 at 03:41, Andrew Scull wrote: > > > > Add a fuzzer to test the vring handling code against unexpected > > mutations from the virtio device. > > > > After building the

Re: [PATCH 01/11] sandbox: Set the EFI symbols in linker script

2022-04-11 Thread Andrew Scull
On Mon, 11 Apr 2022 at 23:15, Heinrich Schuchardt wrote: > > On 4/7/22 11:41, Andrew Scull wrote: > > The sandbox doesn't populate the EFI lists so explicitly set the list > > start and end symbols to indicate that the lists are empty. This > > simplifies the linker s

Re: [PATCH 08/11] virtio: sandbox: Bind RNG rather than block device

2022-04-07 Thread Andrew Scull
On Thu, 7 Apr 2022 at 08:20, Heinrich Schuchardt wrote: > > On 3/31/22 12:09, Andrew Scull wrote: > > The virtio-rng driver is extremely simple, making it suitable for > > testing more of the virtio uclass logic. Have the sandbox driver bind > > the virtio-rng driver ra

Re: [PATCH 10/11] virtio: rng: Check length before copying

2022-04-07 Thread Andrew Scull
On Wed, 6 Apr 2022 at 15:18, Pierre-Clément Tosi wrote: > > Hi, > > On Thu, Mar 31, 2022 at 10:09:48AM +, Andrew Scull wrote: > > Check the length of data written by the device is consistent with the > > size of the buffers to avoid out-of-bounds memory accesses i

[PATCH 11/11] RFC: Hack dlmalloc to poison memory

2022-04-07 Thread Andrew Scull
limted value but has able to spot immediate buffer overruns. The instrumentation is extremely intrusive and would be benefited by more intrusions to increase redzone sizes etc. Signed-off-by: Andrew Scull --- common/dlmalloc.c | 284 -- include

[PATCH 07/11] sandbox: Decouple program entry from sandbox init

2022-04-07 Thread Andrew Scull
Move the program's entry point to os.c, in preparation for a separate fuzzing entry point to be added. Signed-off-by: Andrew Scull --- arch/sandbox/cpu/os.c | 6 ++ arch/sandbox/cpu/start.c| 2 +- arch/sandbox/include/asm/main.h | 18 ++ 3 files ch

[PATCH 09/11] sandbox: Implement fuzzing engine driver

2022-04-07 Thread Andrew Scull
Add a fuzzing engine driver for the sandbox to take inputs from libfuzzer and expose them to the fuzz tests. Signed-off-by: Andrew Scull --- arch/Kconfig | 2 ++ arch/sandbox/dts/test.dts | 4 +++ drivers/fuzzing_engine/Kconfig

[PATCH 03/11] linker_lists: Rename sections to remove . prefix

2022-04-07 Thread Andrew Scull
h clang's ASAN instrumentation which tries to add redzones between the linker list elements, causing expected accesses to fail. However, clang doesn't try to add redzones to user sections, which are names with all alphanumeric and underscore characters. Signed-off-by: An

[PATCH 08/11] sandbox: Add libfuzzer integration

2022-04-07 Thread Andrew Scull
Add an implementation of LLVMFuzzerTestOneInput() that starts the sandbox on a secondary thread and exposes a function to synchronize the generation of fuzzing inputs with their consumption by the sandbox. Signed-off-by: Andrew Scull --- arch/sandbox/config.mk| 3 + arch

[PATCH 06/11] test: fuzz: Add framework for fuzzing

2022-04-07 Thread Andrew Scull
Add the basic infrastructure for declaring fuzz tests and a command to invoke them. Signed-off-by: Andrew Scull --- Kconfig | 8 + include/test/fuzz.h | 51 +++ test/Makefile| 1 + test/fuzz/Makefile | 7 test/fuzz/cmd_fuzz.c | 82

[PATCH 04/11] sandbox: Add support for Address Sanitizer

2022-04-07 Thread Andrew Scull
tions. Alternatively, the sandbox may be able to play games with the system allocator and somehow still keep the required memory abstraction. No effort to address dynamic allocation is made by this patch. Signed-off-by: Andrew Scull --- Kconfig | 7 +++ arch/sandbox/conf

[PATCH 05/11] fuzzing_engine: Add fuzzing engine uclass

2022-04-07 Thread Andrew Scull
This new class of device will provide fuzzing inputs from a fuzzing engine. Signed-off-by: Andrew Scull --- drivers/Kconfig | 2 + drivers/Makefile | 1 + drivers/fuzzing_engine/Kconfig| 6 +++ drivers/fuzzing_engine

[PATCH 02/11] sandbox: Migrate getopt section to linker list

2022-04-07 Thread Andrew Scull
Use the common infrastructure to create a linker list of the sandbox command line flags rather than using a custom method. The list is changed from containing pointers to containing structs and the uses are updated accordingly. Signed-off-by: Andrew Scull --- arch/sandbox/cpu/os.c

[PATCH 01/11] sandbox: Set the EFI symbols in linker script

2022-04-07 Thread Andrew Scull
ASAN. Signed-off-by: Andrew Scull --- arch/sandbox/cpu/u-boot.lds | 32 +--- arch/sandbox/lib/Makefile | 2 +- arch/sandbox/lib/sections.c | 13 - 3 files changed, 6 insertions(+), 41 deletions(-) delete mode 100644 arch/sandbox/lib/sections.c diff --git

[PATCH 7/8] test: Fix pointer overrun in dm_test_devm_regmap()

2022-04-03 Thread Andrew Scull
This tests calls regmap_read() which takes a uint pointer as an output parameter. The test was passing a pointer to a u16 which resulted in an overflow when the output was written. Fix this by following the regmap_read() API and passing a uint pointer instead. Signed-off-by: Andrew Scull Cc

Re: [PATCH 01/10] Makefile: v2 Allow LTO to be disabled for a build

2022-03-31 Thread Andrew Scull
On Sun, 27 Mar 2022 at 21:27, Simon Glass wrote: > > LTO (Link-Time Optimisation) is an very useful feature which can > significantly reduce the size of U-Boot binaries. So far it has been > made available for selected ARM boards and sandbox. > > However, incremental builds are much slower when LT

[PATCH 04/11] virtio_ring: Check used descriptors are chain heads

2022-03-31 Thread Andrew Scull
When the device returns used buffers, it should refer to the descriptor that is the head of the descriptor chain for that buffer. Confirm this to be the case by tracking the head of descriptor chains that have been made available to the device. Signed-off-by: Andrew Scull --- drivers/virtio

[PATCH 01/11] virtio_ring: Merge identical variables

2022-03-31 Thread Andrew Scull
The variables `total_sg` and `descs_used` have the same value. Replace the few uses of `total_sg` with `descs_used` to simplify the situation. Signed-off-by: Andrew Scull --- drivers/virtio/virtio_ring.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/virtio

[PATCH 03/11] virtio_ring: Maintain a shadow copy of descriptors

2022-03-31 Thread Andrew Scull
: Andrew Scull --- drivers/virtio/virtio_ring.c | 49 include/virtio_ring.h| 10 2 files changed, 43 insertions(+), 16 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 8e0cb3d666..69fd8c6aa0 100644 --- a

[PATCH v2 18/18] virtio: pci: Make use of dm_pci_map_bar()

2022-03-29 Thread Andrew Scull
The virtio PCI capabilities describe regions of memory that should be mapped. Map those with dm_pci_map_bar() which will ensure they are valid PCI regions. Signed-off-by: Andrew Scull --- drivers/virtio/virtio_pci_modern.c | 18 -- 1 file changed, 8 insertions(+), 10 deletions

[PATCH v2 15/18] pci: Update dm_pci_bus_to_virt() parameters

2022-03-29 Thread Andrew Scull
igned-off-by: Andrew Scull --- drivers/bios_emulator/atibios.c | 4 ++-- drivers/pci/pci-uclass.c| 4 ++-- include/pci.h | 19 ++- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/drivers/bios_emulator/atibios.c b/drivers/bios_emulator/atib

[PATCH v2 12/18] test: pci: Test PCI address conversion functions

2022-03-29 Thread Andrew Scull
. Signed-off-by: Andrew Scull --- arch/sandbox/dts/test.dts | 2 +- test/dm/pci.c | 102 ++ 2 files changed, 103 insertions(+), 1 deletion(-) diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts index 48ca3e1e47..76c75e08e7 100644

[PATCH v2 08/18] pci: Fix use of flags in dm_pci_map_bar()

2022-03-29 Thread Andrew Scull
The flags parameter of dm_pci_map_bar() is used for PCI region flags rather than memory mapping flags. Fix the type to match that of the region flags and stop using the regions flags as memory mapping flags. Signed-off-by: Andrew Scull --- drivers/pci/pci-uclass.c | 10 +- include/pci.h

[PATCH v2 10/18] pci: Check region ranges are addressable

2022-03-29 Thread Andrew Scull
When parsing the `ranges` DT node, check that both extremes of the regions are addressable without overflow. This assumption can then be safely made when processing the regions. Signed-off-by: Andrew Scull Reviewed-by: Bin Meng --- drivers/pci/pci-uclass.c | 17 - 1 file

[PATCH v2 07/18] virtio: pci: Read entire capability into memory

2022-03-29 Thread Andrew Scull
-of-use problems, should the value in the configuration space change. The range check of the `bar` field and the later call to `dm_pci_read_bar32()` is an example of where this could happen. Signed-off-by: Andrew Scull --- drivers/virtio/virtio_pci_modern.c | 72 -- 1

[PATCH v2 06/18] virtio: pci: Check virtio capability is in bounds

2022-03-29 Thread Andrew Scull
Ensure the virtio PCI capabilities are contained within the bounds of the device's configuration space. The expected size of the capability is passed when searching for the capability to enforce this check. Signed-off-by: Andrew Scull --- drivers/virtio/virtio_pci_modern.c

[PATCH v2 04/18] virtio: pci: Bounds check notification writes

2022-03-29 Thread Andrew Scull
Make sure virtio notifications are written within their allocated buffer. Signed-off-by: Andrew Scull Reviewed-by: Bin Meng --- drivers/virtio/virtio_pci_modern.c | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/drivers/virtio/virtio_pci_modern.c b

[PATCH v2 05/18] virtio: pci: Check virtio common config size

2022-03-29 Thread Andrew Scull
Check that the common config is at least as large as the struct it is expected to contain. Only then is it safe to cast the pointer and be safe from out-of-bounds accesses. Signed-off-by: Andrew Scull Reviewed-by: Bin Meng --- drivers/virtio/virtio_pci_modern.c | 8 1 file changed, 8

[PATCH v2 03/18] virtio: pci: Bounds check device config access

2022-03-29 Thread Andrew Scull
The device config is optional, so check it was present and mapped before trying to use the pointer. Bounds violations are an error, not just a warning, so bail if the checks fail. Signed-off-by: Andrew Scull Reviewed-by: Bin Meng --- drivers/virtio/virtio_pci_modern.c | 16 1

[PATCH v2 00/18] virtio: pci: Add and fix consistency checks

2022-03-29 Thread Andrew Scull
the current implementations don't have the needed consistencty checks. Changelog: v2: - Refactor dm_pci_* functions, not adding new ones - Reorder patches per request in v1 Andrew Scull (18): virtio: pci: Allow exclusion of legacy driver virtio: pci: Fix discovery of device config l

Re: [PATCH 09/11] pci: Add function to validate PCI address range

2022-03-25 Thread Andrew Scull
On Fri, 25 Mar 2022 at 07:14, Bin Meng wrote: > > On Sun, Mar 20, 2022 at 7:42 PM Andrew Scull wrote: > > > > Add a function to convert a PCI address range to a physical address > > range. The address range is validated to ensure it is contained within > > one of th

Re: [PATCH 05/11] virtio: pci: Check virtio capability is in bounds

2022-03-24 Thread Andrew Scull
On Thu, 24 Mar 2022 at 15:24, Bin Meng wrote: > > On Sun, Mar 20, 2022 at 7:41 PM Andrew Scull wrote: > > > > Ensure the virtio PCI capabilities are contained within the bounds of > > the device's configuration space. The expected size of the capability is >

atsama5d27 SD card boot question

2022-03-18 Thread Andrew Steinert
Hi, I am struggling to boot my image from a uSD card my issue I believe is that my uSD is connected to the SDMMC0 port instead of the SDMMC1. How can I save my changes in the output/build/linux4sam_6.2/arch/arm/boot/dts files so that they are included in my next make? Thanks, Andrew Steinert

Re: [PATCH] image: Control FIT signature verification at runtime

2022-02-28 Thread Andrew Jeffery
On Tue, 1 Mar 2022, at 08:42, Alex G. wrote: > On 2/27/22 19:29, Andrew Jeffery wrote: >> >> >> On Tue, 15 Feb 2022, at 13:55, Andrew Jeffery wrote: >>> On Tue, 15 Feb 2022, at 13:42, Dhananjay Phadke wrote: >>>> On 2/14/2022 3:13 PM, Patrick Willia

Re: [PATCH] image: Control FIT signature verification at runtime

2022-02-27 Thread Andrew Jeffery
On Tue, 15 Feb 2022, at 13:55, Andrew Jeffery wrote: > On Tue, 15 Feb 2022, at 13:42, Dhananjay Phadke wrote: >> On 2/14/2022 3:13 PM, Patrick Williams wrote: >>> On Mon, Feb 14, 2022 at 11:14:53AM -0800, Dhananjay Phadke wrote: >>>> There's a key-requir

Re: [PATCH 0/3] gpio: Add AST2[456]00 GPIO driver

2022-02-16 Thread Andrew Jeffery
On Wed, 16 Feb 2022, at 19:02, Ryan Chen wrote: > Hello Andrew, > This patch series are ok, Please help add Reviewed-by: Ryan Chen > Thanks Ryan. This is all that's necessary! Andrew

[PATCH 3/3] configs: evb-ast2[56]00: Enable GPIO control

2022-02-15 Thread Andrew Jeffery
Build in the driver for the Aspeed GPIO controller and turn on the `gpio` shell command. Signed-off-by: Andrew Jeffery --- configs/evb-ast2500_defconfig | 3 +++ configs/evb-ast2600_defconfig | 3 +++ 2 files changed, 6 insertions(+) diff --git a/configs/evb-ast2500_defconfig b/configs/evb

[PATCH 1/3] gpio: Add Aspeed GPIO driver

2022-02-15 Thread Andrew Jeffery
The Aspeed GPIO driver supports the GPIO controllers found in the AST2400, AST2500 and AST2600 BMC SoCs. The implementation is a cut-down copy of the upstream Linux kernel driver, adapted for u-boot. Signed-off-by: Andrew Jeffery --- drivers/gpio/Kconfig | 7 + drivers/gpio/Makefile

[PATCH 2/3] ARM: dts: ast2500: Add ngpios property to GPIO node

2022-02-15 Thread Andrew Jeffery
Populate gpio_count in the gpio subsystem for the AST2500. Signed-off-by: Andrew Jeffery --- arch/arm/dts/ast2500.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/dts/ast2500.dtsi b/arch/arm/dts/ast2500.dtsi index 98359bf92425..ee66ef67042b 100644 --- a/arch/arm/dts/ast2500

[PATCH 0/3] gpio: Add AST2[456]00 GPIO driver

2022-02-15 Thread Andrew Jeffery
7;ve lightly tested the driver as-presented under qemu. That said, as the code has been lifted from Aspeed's SDK (and in-turn from Linux) the implementation has seen much wider testing. Please review! Andrew Andrew Jeffery (3): gpio: Add Aspeed GPIO driver ARM: dts: ast2500: Add ngpios proper

Re: [PATCH] image: Control FIT signature verification at runtime

2022-02-14 Thread Andrew Jeffery
just pointed > that it maybe done by board code by just patching U-Boot control FDT, > either the "required-policy" property at /signature or "required" > property in individual key nodes. This might separate the logic out in a way that's acceptable to Alex. Let me poke at it. Thanks, Andrew

Re: [PATCH] image: Control FIT signature verification at runtime

2022-02-14 Thread Andrew Jeffery
On Tue, 15 Feb 2022, at 09:43, Patrick Williams wrote: > On Mon, Feb 14, 2022 at 11:14:53AM -0800, Dhananjay Phadke wrote: >> On 2/13/2022 5:13 PM, Andrew Jeffery wrote: >> >> We can decouple HW RoT and runtime control on enforcing secure boot >> (requirin

Re: [PATCH] image: Control FIT signature verification at runtime

2022-02-14 Thread Andrew Jeffery
On Tue, 15 Feb 2022, at 05:44, Dhananjay Phadke wrote: > On 2/13/2022 5:13 PM, Andrew Jeffery wrote: >> Right, I think this question is an indication that I could write a more >> informative commit message, so if we converge on something acceptable >> I'll update it

Re: [PATCH] image: Control FIT signature verification at runtime

2022-02-13 Thread Andrew Jeffery
Hi Alex, thanks for taking a look at the patch. On Sun, 13 Feb 2022, at 05:25, Alex G. wrote: > On 1/30/22 21:41, Andrew Jeffery wrote: >> Some platform designs include support for disabling secure-boot via a >> jumper on the board. Sometimes this control can be separate from t

Re: [PATCH] image: Control FIT signature verification at runtime

2022-02-08 Thread Andrew Jeffery
On Mon, 7 Feb 2022, at 11:37, ChiaWei Wang wrote: > Hi Andrew, > > I am curious about the usage scenario. > Is the runtime control required for production release? Yes. > As this control acts like a backdoor to bypass the chain-of-trust. Right, just as strap pin controlling th

Re: [PATCH] gpio: Add gpio_request_by_line_name()

2022-01-31 Thread Andrew Jeffery
Hi Fabio, thanks for taking a look. On Tue, 1 Feb 2022, at 02:40, Fabio Estevam wrote: > On Mon, Jan 31, 2022 at 9:55 AM Andrew Jeffery wrote: >> >> Add support for the upstream gpio-line-names property already described >> in the common GPIO binding document[1]. The ability

[PATCH] image: Control FIT signature verification at runtime

2022-01-31 Thread Andrew Jeffery
(), which is then invoked in the usual FIT verification paths. Signed-off-by: Andrew Jeffery --- Hi, This patch is extracted from and motivated by a series adding run-time control of FIT signature verification to u-boot in OpenBMC: https://lore.kernel.org/openbmc/20220131012538.73021-1-and

[PATCH] gpio: Add gpio_request_by_line_name()

2022-01-31 Thread Andrew Jeffery
/devicetree-org/dt-schema/blob/3c35bfee83c2e38e2ae7af5f83eb89ca94a521e8/dtschema/schemas/gpio/gpio.yaml#L17 Signed-off-by: Andrew Jeffery --- Hi, This patch is extracted from and motivated by a series adding run-time control of FIT signature verification to u-boot in OpenBMC: https

fatal error: configs/.h: No such file or directory

2020-12-15 Thread Andrew Ellis
fig SYS_VENDOR// //    default "MSC"// // //config SYS_CONFIG_NAME// //    default "msc_q7_imx6plus"// // //endif/ and a maintainers file which contains: /MSC BOARD// //M:    Andrew // //S:    Maintained// //F:    board/MSC/iMX6_Q7/// //F:    include/configs/msc_q7_imx6plus.

[PATCH] arm: mach-k3: Clean non-coherent lines out of L3 cache

2020-07-15 Thread Andrew F. Davis
nally, leading to a loss of data. Signed-off-by: Andrew F. Davis Tested-by: Faiz Abbas --- arch/arm/mach-k3/Makefile | 1 + arch/arm/mach-k3/cache.S | 24 2 files changed, 25 insertions(+) create mode 100644 arch/arm/mach-k3/cache.S diff --git a/arch/arm/mach-k3/Mak

[PATCH] board: ti: am654: Disable SA2UL node for HS devices

2020-06-09 Thread Andrew F. Davis
. Signed-off-by: Andrew F. Davis --- board/ti/am65x/evm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/board/ti/am65x/evm.c b/board/ti/am65x/evm.c index a22900dcf9..20b75ba133 100644 --- a/board/ti/am65x/evm.c +++ b/board/ti/am65x/evm.c @@ -108,10 +108,10 @@ int

<    1   2   3   4   5   6   7   8   9   10   >