[PATCH v4 08/25] linux-user/hexagon: Implement setup_sigtramp

2021-09-27 Thread Richard Henderson
Continue to initialize the words on the stack, as documented. However, use the off-stack trampoline. Reviewed-by: Taylor Simpson Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/hexagon/target_signal.h | 2 ++ linux-user/hexagon/signal.c| 19

[PATCH v4 11/25] linux-user/x86_64: Raise SIGSEGV if SA_RESTORER not set

2021-09-27 Thread Richard Henderson
This has been a fixme for some time. The effect of returning -EFAULT from the kernel code is to raise SIGSEGV. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/i386/signal.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git

[PATCH v4 09/25] linux-user/hppa: Document non-use of setup_sigtramp

2021-09-27 Thread Richard Henderson
We cannot use a raw sigtramp page for hppa, but must wait for full vdso support. Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/hppa/target_signal.h | 14 ++ 1 file changed, 14 insertions(+) diff --git

[PATCH v4 16/25] linux-user/nios2: Document non-use of setup_sigtramp

2021-09-27 Thread Richard Henderson
Signed-off-by: Richard Henderson --- linux-user/nios2/target_signal.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linux-user/nios2/target_signal.h b/linux-user/nios2/target_signal.h index aebf749f12..fe266c4c51 100644 --- a/linux-user/nios2/target_signal.h +++

[PATCH v4 13/25] linux-user/microblaze: Implement setup_sigtramp

2021-09-27 Thread Richard Henderson
Create and record the rt signal trampoline. Cc: Edgar E. Iglesias Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/microblaze/target_signal.h | 2 ++ linux-user/microblaze/signal.c| 24 +--- 2 files changed, 19 insertions(+), 7

[PATCH v4 15/25] linux-user/mips: Implement setup_sigtramp

2021-09-27 Thread Richard Henderson
Create and record the two signal trampolines. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/mips/target_signal.h | 1 + linux-user/mips64/target_signal.h | 2 ++ linux-user/mips/signal.c | 34 ++- 3 files changed,

[PATCH v4 20/25] linux-user/riscv: Implement setup_sigtramp

2021-09-27 Thread Richard Henderson
Create and record the rt signal trampoline. This fixes a bug wrt libgcc fallback unwinding. It expects the stack pointer to point to the siginfo_t, whereas we had inexplicably placed our private signal trampoline at the start of the signal frame instead of the end. Now moot because we have

[PATCH v4 25/25] linux-user: Remove default for TARGET_ARCH_HAS_SIGTRAMP_PAGE

2021-09-27 Thread Richard Henderson
All targets now define TARGET_ARCH_HAS_SIGTRAMP_PAGE. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/elfload.c | 4 1 file changed, 4 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 459a26ef1d..2404d482ba 100644 ---

[PATCH v4 19/25] linux-user/ppc: Implement setup_sigtramp

2021-09-27 Thread Richard Henderson
Create and record the two signal trampolines. Cc: qemu-...@nongnu.org Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/ppc/target_signal.h | 2 ++ linux-user/ppc/signal.c| 34 ++ 2 files changed, 20 insertions(+), 16

[PATCH v4 23/25] linux-user/sparc: Implement setup_sigtramp

2021-09-27 Thread Richard Henderson
Create and record the two signal trampolines. Use them when the guest does not use SA_RESTORER. Cc: Mark Cave-Ayland Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/sparc/target_signal.h | 4 linux-user/sparc/signal.c| 40

[PATCH 1/1] hw: aspeed_gpio: Fix pin I/O type declarations

2021-09-27 Thread pdel
From: Peter Delevoryas Some of the pin declarations in the Aspeed GPIO module were incorrect, probably because of confusion over which bits in the input and output uint32_t's correspond to which groups in the label array. Since the uint32_t literals are in big endian, it's sort of the opposite

[PATCH 1/1] hw: aspeed_gpio: Fix GPIO array indexing

2021-09-27 Thread pdel
From: Peter Delevoryas The gpio array is declared as a dense array: qemu_irq gpios[ASPEED_GPIO_NR_PINS]; (AST2500 has 228, AST2400 has 216, AST2600 has 208) However, this array is used like a matrix of GPIO sets (e.g. gpio[NR_SETS][NR_PINS_PER_SET] = gpio[8][32]) size_t offset = set *

Re: [PATCH v3 10/27] linux-user/i386: Implement setup_sigtramp

2021-09-27 Thread Richard Henderson
On 9/24/21 2:01 PM, Philippe Mathieu-Daudé wrote: +static void install_sigtramp(void *tramp) +{ +    /* This is popl %eax ; movl $syscall,%eax ; int $0x80 */ +    __put_user(0xb858, (uint16_t *)(tramp + 0)); +    __put_user(TARGET_NR_sigreturn, (int *)(tramp + 2)); I know this is mostly code

[PATCH v4 05/25] linux-user/arm: Implement setup_sigtramp

2021-09-27 Thread Richard Henderson
Mirror what the kernel does in arch/arm/kernel/signal.h, using the old sigframe struct in the rt sigframe struct. Update the trampoline code to match the kernel: this uses sp-relative accesses rather than pc-relative. Copy the code into frame->retcode from the trampoline page. This minimises the

[PATCH v4 04/25] linux-user/arm: Drop "_v2" from symbols in signal.c

2021-09-27 Thread Richard Henderson
Since we no longer support "v1", there's no need to distinguish "v2". Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/arm/signal.c | 155 +--- 1 file changed, 65 insertions(+), 90 deletions(-) diff --git

[PATCH v4 03/25] linux-user/arm: Drop v1 signal frames

2021-09-27 Thread Richard Henderson
Version 2 signal frames are used from 2.6.12 and since cbc14e6f286, we have set UNAME_MINIMUM_RELEASE to 2.6.32. Suggested-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/arm/signal.c | 220 +--- 1 file

[PATCH v4 01/25] linux-user: Add infrastructure for a signal trampoline page

2021-09-27 Thread Richard Henderson
Allocate a page to hold the signal trampoline(s). Invoke a guest-specific hook to fill in the contents of the page before marking it read-execute again. Reviewed-by: Max Filippov Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson ---

[PATCH v4 12/25] linux-user/m68k: Implement setup_sigtramp

2021-09-27 Thread Richard Henderson
Create and record the two signal trampolines. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/m68k/target_signal.h | 2 ++ linux-user/m68k/signal.c| 47 +++-- 2 files changed, 24 insertions(+), 25 deletions(-) diff --git

[PATCH v4 07/25] linux-user/cris: Implement setup_sigtramp

2021-09-27 Thread Richard Henderson
Split out setup_sigreturn so that we can continue to initialize the words on the stack, as documented. However, use the off-stack trampoline. Cc: Edgar E. Iglesias Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/cris/target_signal.h | 2 ++

[PATCH v4 14/25] linux-user/mips: Tidy install_sigtramp

2021-09-27 Thread Richard Henderson
The return value is constant 0, and unused as well -- change to void. Drop inline marker. Change tramp type to uint32_t* for clarity. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/mips/signal.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-)

[PATCH v4 17/25] linux-user/openrisc: Implement setup_sigtramp

2021-09-27 Thread Richard Henderson
Create and record the rt signal trampoline. Reviewed-by: Stafford Horne Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/openrisc/target_signal.h | 2 ++ linux-user/openrisc/signal.c| 22 ++ 2 files changed, 16 insertions(+), 8

[PATCH v4 18/25] linux-user/ppc: Simplify encode_trampoline

2021-09-27 Thread Richard Henderson
The sigret parameter is never 0, and even if it was the encoding of the LI instruction would still work. Reported-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/ppc/signal.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-)

[PATCH v4 21/25] linux-user/s390x: Implement setup_sigtramp

2021-09-27 Thread Richard Henderson
Create and record the two signal trampolines. Use them when the guest does not use SA_RESTORER. Cc: qemu-s3...@nongnu.org Tested-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/s390x/target_signal.h | 2 ++ linux-user/s390x/signal.c

[PATCH v4 24/25] linux-user/xtensa: Implement setup_sigtramp

2021-09-27 Thread Richard Henderson
Create and record the rt signal trampoline. Use it when the guest does not use SA_RESTORER. Reviewed-by: Max Filippov Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/xtensa/target_signal.h | 2 ++ linux-user/xtensa/signal.c| 56

[PATCH v4 22/25] linux-user/sh4: Implement setup_sigtramp

2021-09-27 Thread Richard Henderson
Create and record the two signal trampolines. Use them when the guest does not use SA_RESTORER. Cc: Yoshinori Sato Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/sh4/target_signal.h | 2 ++ linux-user/sh4/signal.c| 40

[PATCH 0/1] hw: aspeed_gpio: Fix pin I/O type declarations

2021-09-27 Thread pdel
From: Peter Delevoryas In the Aspeed chips, the GPIO pins are mostly labeled in groups of 8, but some of the groups only have 4 elements. Also, most pins have input and output capabilities, but some are strictly input or strictly output pins. We have some arrays that describe the I/O

[PATCH 0/1] hw: aspeed_gpio: Fix GPIO array indexing

2021-09-27 Thread pdel
From: Peter Delevoryas Hey everyone, I think there might be a bug in aspeed_gpio_update, where it's selecting a GPIO IRQ to update. The indexing that maps from GPIO pin to IRQ leads to an out-of-bounds array access and a segfault after that. tl;dr There's 8 rows of 32 pins (8 * 32 == 256

<    1   2   3   4