qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PULL 0/5] Hppa latest patches
@ 2024-03-03  5:46 deller
  2024-03-03  5:46 ` [PULL 1/5] target: hppa: Fix unaligned double word accesses for hppa64 deller
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: deller @ 2024-03-03  5:46 UTC (permalink / raw)
  To: qemu-devel, Richard Henderson; +Cc: deller

From: Helge Deller <deller@gmx.de>

The following changes since commit e1007b6bab5cf97705bf4f2aaec1f607787355b8:

  Merge tag 'pull-request-2024-03-01' of https://gitlab.com/thuth/qemu into staging (2024-03-01 10:14:32 +0000)

are available in the Git repository at:

  https://github.com/hdeller/qemu-hppa.git tags/hppa-latest-pull-request

for you to fetch changes up to 839a88e8bd1a1efe05844c39a59985482894f4de:

  roms/hppa: Add build rules for hppa-firmware (2024-03-03 06:41:19 +0100)

----------------------------------------------------------------
HPPA64 updates

----------------------------------------------------------------

Guenter Roeck (1):
  target: hppa: Fix unaligned double word accesses for hppa64

Helge Deller (4):
  target/hppa: Restore unwind_breg before calculating ior
  pc-bios/meson: Add hppa-firmware64.img blob
  pc-bios/README: Add information about hppa-firmware
  roms/hppa: Add build rules for hppa-firmware

 pc-bios/README           | 6 ++++++
 pc-bios/meson.build      | 1 +
 roms/Makefile            | 7 +++++++
 target/hppa/cpu.c        | 3 ++-
 target/hppa/helper.c     | 3 ++-
 target/hppa/mem_helper.c | 3 ++-
 target/hppa/op_helper.c  | 3 ++-
 7 files changed, 22 insertions(+), 4 deletions(-)

-- 
2.44.0



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

* [PULL 1/5] target: hppa: Fix unaligned double word accesses for hppa64
  2024-03-03  5:46 [PULL 0/5] Hppa latest patches deller
@ 2024-03-03  5:46 ` deller
  2024-03-03  5:46 ` [PULL 2/5] target/hppa: Restore unwind_breg before calculating ior deller
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: deller @ 2024-03-03  5:46 UTC (permalink / raw)
  To: qemu-devel, Richard Henderson; +Cc: deller, Guenter Roeck, Charlie Jenkins

From: Guenter Roeck <linux@roeck-us.net>

Unaligned 64-bit accesses were found in Linux to clobber carry bits,
resulting in bad results if an arithmetic operation involving a
carry bit was executed after an unaligned 64-bit operation.

hppa 2.0 defines additional carry bits in PSW register bits 32..39.
When restoring PSW after executing an unaligned instruction trap, those
bits were not cleared and ended up to be active all the time. Since there
are no bits other than the upper carry bits needed in the upper 32 bit of
env->psw and since those are stored in env->psw_cb, just clear the entire
upper 32 bit when storing psw to solve the problem unconditionally.

Fixes: 931adff31478 ("target/hppa: Update cpu_hppa_get/put_psw for hppa64")
Cc: Richard Henderson <richard.henderson@linaro.org>
Cc: Charlie Jenkins <charlie@rivosinc.com>
Cc: Helge Deller <deller@gmx.de>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Helge Deller <deller@gmx.de>
---
 target/hppa/helper.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/target/hppa/helper.c b/target/hppa/helper.c
index 859644c47a..9d217d051c 100644
--- a/target/hppa/helper.c
+++ b/target/hppa/helper.c
@@ -76,7 +76,8 @@ void cpu_hppa_put_psw(CPUHPPAState *env, target_ulong psw)
     }
     psw &= ~reserved;
 
-    env->psw = psw & ~(PSW_N | PSW_V | PSW_CB);
+    env->psw = psw & (uint32_t)~(PSW_N | PSW_V | PSW_CB);
+
     env->psw_n = (psw / PSW_N) & 1;
     env->psw_v = -((psw / PSW_V) & 1);
 
-- 
2.44.0



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

* [PULL 2/5] target/hppa: Restore unwind_breg before calculating ior
  2024-03-03  5:46 [PULL 0/5] Hppa latest patches deller
  2024-03-03  5:46 ` [PULL 1/5] target: hppa: Fix unaligned double word accesses for hppa64 deller
@ 2024-03-03  5:46 ` deller
  2024-03-03  5:46 ` [PULL 3/5] pc-bios/meson: Add hppa-firmware64.img blob deller
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: deller @ 2024-03-03  5:46 UTC (permalink / raw)
  To: qemu-devel, Richard Henderson; +Cc: deller

From: Helge Deller <deller@gmx.de>

When calculating the IOR for the exception handlers, the current
unwind_breg value is needed on 64-bit hppa machines.
Restore that value by calling cpu_restore_state() earlier, which in turn
calls hppa_restore_state_to_opc() which restores the unwind_breg for the
current instruction.

Signed-off-by: Helge Deller <deller@gmx.de>
Fixes: 3824e0d643f3 ("target/hppa: Export function hppa_set_ior_and_isr()")
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/hppa/cpu.c        | 3 ++-
 target/hppa/mem_helper.c | 3 ++-
 target/hppa/op_helper.c  | 3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c
index afe73d4474..3831cb6db2 100644
--- a/target/hppa/cpu.c
+++ b/target/hppa/cpu.c
@@ -121,9 +121,10 @@ void hppa_cpu_do_unaligned_access(CPUState *cs, vaddr addr,
     CPUHPPAState *env = &cpu->env;
 
     cs->exception_index = EXCP_UNALIGN;
+    cpu_restore_state(cs, retaddr);
     hppa_set_ior_and_isr(env, addr, MMU_IDX_MMU_DISABLED(mmu_idx));
 
-    cpu_loop_exit_restore(cs, retaddr);
+    cpu_loop_exit(cs);
 }
 #endif /* CONFIG_USER_ONLY */
 
diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c
index 66b8fa7d72..3fc895c1c2 100644
--- a/target/hppa/mem_helper.c
+++ b/target/hppa/mem_helper.c
@@ -348,9 +348,10 @@ raise_exception_with_ior(CPUHPPAState *env, int excp, uintptr_t retaddr,
     CPUState *cs = env_cpu(env);
 
     cs->exception_index = excp;
+    cpu_restore_state(cs, retaddr);
     hppa_set_ior_and_isr(env, addr, mmu_disabled);
 
-    cpu_loop_exit_restore(cs, retaddr);
+    cpu_loop_exit(cs);
 }
 
 void hppa_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr,
diff --git a/target/hppa/op_helper.c b/target/hppa/op_helper.c
index b1f24a5aad..480fe80844 100644
--- a/target/hppa/op_helper.c
+++ b/target/hppa/op_helper.c
@@ -351,11 +351,12 @@ target_ulong HELPER(probe)(CPUHPPAState *env, target_ulong addr,
     excp = hppa_get_physical_address(env, addr, mmu_idx, 0, &phys,
                                      &prot, NULL);
     if (excp >= 0) {
+        cpu_restore_state(env_cpu(env), GETPC());
         hppa_set_ior_and_isr(env, addr, MMU_IDX_MMU_DISABLED(mmu_idx));
         if (excp == EXCP_DTLB_MISS) {
             excp = EXCP_NA_DTLB_MISS;
         }
-        hppa_dynamic_excp(env, excp, GETPC());
+        helper_excp(env, excp);
     }
     return (want & prot) != 0;
 #endif
-- 
2.44.0



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

* [PULL 3/5] pc-bios/meson: Add hppa-firmware64.img blob
  2024-03-03  5:46 [PULL 0/5] Hppa latest patches deller
  2024-03-03  5:46 ` [PULL 1/5] target: hppa: Fix unaligned double word accesses for hppa64 deller
  2024-03-03  5:46 ` [PULL 2/5] target/hppa: Restore unwind_breg before calculating ior deller
@ 2024-03-03  5:46 ` deller
  2024-03-03  5:46 ` [PULL 4/5] pc-bios/README: Add information about hppa-firmware deller
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: deller @ 2024-03-03  5:46 UTC (permalink / raw)
  To: qemu-devel, Richard Henderson; +Cc: deller

From: Helge Deller <deller@gmx.de>

Add the missing 64-bit hppa firmware blob so that it gets installed.

Signed-off-by: Helge Deller <deller@gmx.de>
Fixes: 7c0dfcf9395e ("target/hppa: Update SeaBIOS-hppa to version 16")
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
 pc-bios/meson.build | 1 +
 1 file changed, 1 insertion(+)

diff --git a/pc-bios/meson.build b/pc-bios/meson.build
index e67fa433a1..0760612bea 100644
--- a/pc-bios/meson.build
+++ b/pc-bios/meson.build
@@ -73,6 +73,7 @@ blobs = [
   'qemu_vga.ndrv',
   'edk2-licenses.txt',
   'hppa-firmware.img',
+  'hppa-firmware64.img',
   'opensbi-riscv32-generic-fw_dynamic.bin',
   'opensbi-riscv64-generic-fw_dynamic.bin',
   'npcm7xx_bootrom.bin',
-- 
2.44.0



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

* [PULL 4/5] pc-bios/README: Add information about hppa-firmware
  2024-03-03  5:46 [PULL 0/5] Hppa latest patches deller
                   ` (2 preceding siblings ...)
  2024-03-03  5:46 ` [PULL 3/5] pc-bios/meson: Add hppa-firmware64.img blob deller
@ 2024-03-03  5:46 ` deller
  2024-03-03  5:46 ` [PULL 5/5] roms/hppa: Add build rules for hppa-firmware deller
  2024-03-05  9:44 ` [PULL 0/5] Hppa latest patches Peter Maydell
  5 siblings, 0 replies; 8+ messages in thread
From: deller @ 2024-03-03  5:46 UTC (permalink / raw)
  To: qemu-devel, Richard Henderson; +Cc: deller

From: Helge Deller <deller@gmx.de>

Signed-off-by: Helge Deller <deller@gmx.de>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
 pc-bios/README | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/pc-bios/README b/pc-bios/README
index b8a0210d24..7ffb2f43a4 100644
--- a/pc-bios/README
+++ b/pc-bios/README
@@ -75,3 +75,9 @@
   initialize and run boot images stored in SPI flash, but may grow more
   features over time as needed. The source code is available at:
   https://github.com/google/vbootrom
+
+- hppa-firmware.img (32-bit) and hppa-firmware64.img (64-bit) are firmware
+  files for the HP-PARISC (hppa) architecture.
+  They are built form the SeaBIOS-hppa sources, which is a fork of SeaBIOS
+  adapted for hppa.
+  SeaBIOS-hppa is available at https://github.com/hdeller/seabios-hppa
-- 
2.44.0



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

* [PULL 5/5] roms/hppa: Add build rules for hppa-firmware
  2024-03-03  5:46 [PULL 0/5] Hppa latest patches deller
                   ` (3 preceding siblings ...)
  2024-03-03  5:46 ` [PULL 4/5] pc-bios/README: Add information about hppa-firmware deller
@ 2024-03-03  5:46 ` deller
  2024-03-04  9:57   ` Michael Tokarev
  2024-03-05  9:44 ` [PULL 0/5] Hppa latest patches Peter Maydell
  5 siblings, 1 reply; 8+ messages in thread
From: deller @ 2024-03-03  5:46 UTC (permalink / raw)
  To: qemu-devel, Richard Henderson; +Cc: deller, Michael Tokarev

From: Helge Deller <deller@gmx.de>

Signed-off-by: Helge Deller <deller@gmx.de>
Suggested-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
 roms/Makefile | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/roms/Makefile b/roms/Makefile
index 67f709ba2d..8e5d8d26a9 100644
--- a/roms/Makefile
+++ b/roms/Makefile
@@ -68,6 +68,7 @@ default help:
 	@echo "  opensbi32-generic  -- update OpenSBI for 32-bit generic machine"
 	@echo "  opensbi64-generic  -- update OpenSBI for 64-bit generic machine"
 	@echo "  qboot              -- update qboot"
+	@echo "  hppa-firmware      -- update 32- and 64-bit hppa firmware"
 	@echo "  clean              -- delete the files generated by the previous" \
 	                              "build targets"
 
@@ -177,6 +178,11 @@ npcm7xx_bootrom:
 	$(MAKE) -C vbootrom CROSS_COMPILE=$(arm_cross_prefix)
 	cp vbootrom/npcm7xx_bootrom.bin ../pc-bios/npcm7xx_bootrom.bin
 
+hppa-firmware:
+	$(MAKE) -C seabios-hppa parisc
+	cp seabios-hppa/out/hppa-firmware.img      ../pc-bios/
+	cp seabios-hppa/out-64/hppa-firmware64.img ../pc-bios/
+
 clean:
 	rm -rf seabios/.config seabios/out seabios/builds
 	$(MAKE) -C ipxe/src veryclean
@@ -189,3 +195,4 @@ clean:
 	$(MAKE) -C opensbi clean
 	$(MAKE) -C qboot clean
 	$(MAKE) -C vbootrom clean
+	$(MAKE) -C seabios-hppa clean
-- 
2.44.0



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

* Re: [PULL 5/5] roms/hppa: Add build rules for hppa-firmware
  2024-03-03  5:46 ` [PULL 5/5] roms/hppa: Add build rules for hppa-firmware deller
@ 2024-03-04  9:57   ` Michael Tokarev
  0 siblings, 0 replies; 8+ messages in thread
From: Michael Tokarev @ 2024-03-04  9:57 UTC (permalink / raw)
  To: deller, qemu-devel, Richard Henderson; +Cc: deller

03.03.2024 08:46, deller@kernel.org :
> From: Helge Deller <deller@gmx.de>
> 
> Signed-off-by: Helge Deller <deller@gmx.de>
> Suggested-by: Michael Tokarev <mjt@tls.msk.ru>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>

Thank you!

/mjt

>   roms/Makefile | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/roms/Makefile b/roms/Makefile
> index 67f709ba2d..8e5d8d26a9 100644
> --- a/roms/Makefile
> +++ b/roms/Makefile
> @@ -68,6 +68,7 @@ default help:
>   	@echo "  opensbi32-generic  -- update OpenSBI for 32-bit generic machine"
>   	@echo "  opensbi64-generic  -- update OpenSBI for 64-bit generic machine"
>   	@echo "  qboot              -- update qboot"
> +	@echo "  hppa-firmware      -- update 32- and 64-bit hppa firmware"
>   	@echo "  clean              -- delete the files generated by the previous" \
>   	                              "build targets"
>   
> @@ -177,6 +178,11 @@ npcm7xx_bootrom:
>   	$(MAKE) -C vbootrom CROSS_COMPILE=$(arm_cross_prefix)
>   	cp vbootrom/npcm7xx_bootrom.bin ../pc-bios/npcm7xx_bootrom.bin
>   
> +hppa-firmware:
> +	$(MAKE) -C seabios-hppa parisc
> +	cp seabios-hppa/out/hppa-firmware.img      ../pc-bios/
> +	cp seabios-hppa/out-64/hppa-firmware64.img ../pc-bios/
> +
>   clean:
>   	rm -rf seabios/.config seabios/out seabios/builds
>   	$(MAKE) -C ipxe/src veryclean
> @@ -189,3 +195,4 @@ clean:
>   	$(MAKE) -C opensbi clean
>   	$(MAKE) -C qboot clean
>   	$(MAKE) -C vbootrom clean
> +	$(MAKE) -C seabios-hppa clean



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

* Re: [PULL 0/5] Hppa latest patches
  2024-03-03  5:46 [PULL 0/5] Hppa latest patches deller
                   ` (4 preceding siblings ...)
  2024-03-03  5:46 ` [PULL 5/5] roms/hppa: Add build rules for hppa-firmware deller
@ 2024-03-05  9:44 ` Peter Maydell
  5 siblings, 0 replies; 8+ messages in thread
From: Peter Maydell @ 2024-03-05  9:44 UTC (permalink / raw)
  To: deller; +Cc: qemu-devel, Richard Henderson, deller

On Sun, 3 Mar 2024 at 05:47, <deller@kernel.org> wrote:
>
> From: Helge Deller <deller@gmx.de>
>
> The following changes since commit e1007b6bab5cf97705bf4f2aaec1f607787355b8:
>
>   Merge tag 'pull-request-2024-03-01' of https://gitlab.com/thuth/qemu into staging (2024-03-01 10:14:32 +0000)
>
> are available in the Git repository at:
>
>   https://github.com/hdeller/qemu-hppa.git tags/hppa-latest-pull-request
>
> for you to fetch changes up to 839a88e8bd1a1efe05844c39a59985482894f4de:
>
>   roms/hppa: Add build rules for hppa-firmware (2024-03-03 06:41:19 +0100)
>
> ----------------------------------------------------------------
> HPPA64 updates
>
> ----------------------------------------------------------------


Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/9.0
for any user-visible changes.

-- PMM


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

end of thread, other threads:[~2024-03-05  9:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-03  5:46 [PULL 0/5] Hppa latest patches deller
2024-03-03  5:46 ` [PULL 1/5] target: hppa: Fix unaligned double word accesses for hppa64 deller
2024-03-03  5:46 ` [PULL 2/5] target/hppa: Restore unwind_breg before calculating ior deller
2024-03-03  5:46 ` [PULL 3/5] pc-bios/meson: Add hppa-firmware64.img blob deller
2024-03-03  5:46 ` [PULL 4/5] pc-bios/README: Add information about hppa-firmware deller
2024-03-03  5:46 ` [PULL 5/5] roms/hppa: Add build rules for hppa-firmware deller
2024-03-04  9:57   ` Michael Tokarev
2024-03-05  9:44 ` [PULL 0/5] Hppa latest patches Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).