target/ppc: Fix icount access for some hypervisor instructions
PATCH 1/2 target/ppc: Fix icount access for some hypervisor instructions
Several instructions and register access require icount reads and are missing translator_io_start().
--- target/ppc/translate.c | 7 +++++++ 1 file changed, 7 insertions(+)
target/ppc/translate.c +7 -0
@@ -1177,6 +1177,7 @@ void spr_write_hmer(DisasContext *ctx, int sprn, int gprn)void spr_write_lpcr (DisasContext *ctx,int sprn,int gprn) { +translator_io_start (&ctx->base);gen_helper_store_lpcr (cpu_env, cpu_gpr[gprn]); }#endif /* !defined(CONFIG_USER_ONLY) */
@@ -4002,6 +4003,7 @@ static void gen_doze(DisasContext *ctx)TCGv_i32 t;CHK_HV (ctx); +translator_io_start (&ctx->base); t =tcg_constant_i32 (PPC_PM_DOZE );gen_helper_pminsn (cpu_env, t);/* Stop translation, as the CPU is supposed to sleep from now */
@@ -4017,6 +4019,7 @@ static void gen_nap(DisasContext *ctx)TCGv_i32 t;CHK_HV (ctx); +translator_io_start (&ctx->base); t =tcg_constant_i32 (PPC_PM_NAP );gen_helper_pminsn (cpu_env, t);/* Stop translation, as the CPU is supposed to sleep from now */
@@ -4032,6 +4035,7 @@ static void gen_stop(DisasContext *ctx)TCGv_i32 t;CHK_HV (ctx); +translator_io_start (&ctx->base); t =tcg_constant_i32 (PPC_PM_STOP );gen_helper_pminsn (cpu_env, t);/* Stop translation, as the CPU is supposed to sleep from now */
@@ -4047,6 +4051,7 @@ static void gen_sleep(DisasContext *ctx)TCGv_i32 t;CHK_HV (ctx); +translator_io_start (&ctx->base); t =tcg_constant_i32 (PPC_PM_SLEEP );gen_helper_pminsn (cpu_env, t);/* Stop translation, as the CPU is supposed to sleep from now */
@@ -4062,6 +4067,7 @@ static void gen_rvwinkle(DisasContext *ctx)TCGv_i32 t;CHK_HV (ctx); +translator_io_start (&ctx->base); t =tcg_constant_i32 (PPC_PM_RVWINKLE );gen_helper_pminsn (cpu_env, t);/* Stop translation, as the CPU is supposed to sleep from now */
@@ -4458,6 +4464,7 @@ static void gen_hrfid(DisasContext *ctx)#else /* Restore CPU state */ CHK_HV (ctx); +translator_io_start (&ctx->base);gen_helper_hrfid (cpu_env); ctx->base.is_jmp =DISAS_EXIT ;#endif
Signature · 1 line
2.40.1
PATCH 2/2 tests/avocado: record_replay test for ppc powernv machine
The powernv machine can boot Linux to VFS mount with icount enabled. Add a test case for it.
--- tests/avocado/replay_kernel.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
tests/avocado/replay_kernel.py +16 -0
@@ -258,6 +258,22 @@ def test_ppc64_pseries(self): console_pattern = 'VFS: Cannot open root device' self.run_rr(kernel_path, kernel_command_line, console_pattern) + def test_ppc64_powernv(self): + """ + :avocado: tags=arch:ppc64 + :avocado: tags=machine:powernv + :avocado: tags=accel:tcg + """ + kernel_url = ('https://archives.fedoraproject.org/pub/archive' + '/fedora-secondary/releases/29/Everything/ppc64le/os' + '/ppc/ppc64/vmlinuz') + kernel_hash = '3fe04abfc852b66653b8c3c897a59a689270bc77' + kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash) + + kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=tty0 console=hvc0' + console_pattern = 'VFS: Cannot open root device' + self.run_rr(kernel_path, kernel_command_line, console_pattern) + def test_m68k_q800(self): """ :avocado: tags=arch:m68k
Signature · 1 line
2.40.1
Re: [PATCH 2/2] tests/avocado: record_replay test for ppc powernv machine
Quoted 4 lines · Nicholas Piggin
The powernv machine can boot Linux to VFS mount with icount enabled. Add a test case for it.
Signed-off-by Nicholas Piggin <[email protected]>
Thanks,
C.
Quoted 31 lines
--- tests/avocado/replay_kernel.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)tests/avocado/replay_kernel.py +16
-0@@ -258,6 +258,22 @@ def test_ppc64_pseries(self): console_pattern = 'VFS: Cannot open root device' self.run_rr(kernel_path, kernel_command_line, console_pattern) + def test_ppc64_powernv(self): + """ + :avocado: tags=arch:ppc64 + :avocado: tags=machine:powernv + :avocado: tags=accel:tcg + """ + kernel_url = ('https://archives.fedoraproject.org/pub/archive' + '/fedora-secondary/releases/29/Everything/ppc64le/os' + '/ppc/ppc64/vmlinuz') + kernel_hash = '3fe04abfc852b66653b8c3c897a59a689270bc77' + kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash) + + kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=tty0 console=hvc0' + console_pattern = 'VFS: Cannot open root device' + self.run_rr(kernel_path, kernel_command_line, console_pattern) + def test_m68k_q800(self): """ :avocado: tags=arch:m68k
Daniel Henrique Barboza
AppliedRe: [PATCH 2/2] tests/avocado: record_replay test for ppc powernv machine
In reply to Nicholas PigginQuoted 5 lines · Nicholas Piggin
The powernv machine can boot Linux to VFS mount with icount enabled. Add a test case for it.
Signed-off-by Nicholas Piggin <[email protected]>---
Queued in gitlab.com/danielhb/qemu/tree/ppc-next. Thanks,
Daniel
Quoted 30 lines
tests/avocado/replay_kernel.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)tests/avocado/replay_kernel.py +16
-0@@ -258,6 +258,22 @@ def test_ppc64_pseries(self): console_pattern = 'VFS: Cannot open root device' self.run_rr(kernel_path, kernel_command_line, console_pattern) + def test_ppc64_powernv(self): + """ + :avocado: tags=arch:ppc64 + :avocado: tags=machine:powernv + :avocado: tags=accel:tcg + """ + kernel_url = ('https://archives.fedoraproject.org/pub/archive' + '/fedora-secondary/releases/29/Everything/ppc64le/os' + '/ppc/ppc64/vmlinuz') + kernel_hash = '3fe04abfc852b66653b8c3c897a59a689270bc77' + kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash) + + kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=tty0 console=hvc0' + console_pattern = 'VFS: Cannot open root device' + self.run_rr(kernel_path, kernel_command_line, console_pattern) + def test_m68k_q800(self): """ :avocado: tags=arch:m68k
Quoted 7 lines · Nicholas Piggin
Several instructions and register access require icount reads and are missing
translator_io_start().Signed-off-by Nicholas Piggin<[email protected]>--- target/ppc/translate.c | 7 +++++++ 1 file changed, 7 insertions(+)
r~
Daniel Henrique Barboza
AppliedQuoted 5 lines · Nicholas Piggin
Several instructions and register access require icount reads and are missing
translator_io_start().Signed-off-by Nicholas Piggin <[email protected]>---
Queued in gitlab.com/danielhb/qemu/tree/ppc-next. Thanks,
Daniel
Quoted 63 lines
target/ppc/translate.c | 7 +++++++ 1 file changed, 7 insertions(+)target/ppc/translate.c +7
-0@@ -1177,6 +1177,7 @@ void spr_write_hmer(DisasContext *ctx, int sprn, int gprn)void spr_write_lpcr (DisasContext *ctx,int sprn,int gprn) { +translator_io_start (&ctx->base);gen_helper_store_lpcr (cpu_env, cpu_gpr[gprn]); }#endif /* !defined(CONFIG_USER_ONLY) */ @@ -4002,6 +4003,7 @@ static void gen_doze(DisasContext *ctx)TCGv_i32 t;CHK_HV (ctx); +translator_io_start (&ctx->base); t =tcg_constant_i32 (PPC_PM_DOZE );gen_helper_pminsn (cpu_env, t);/* Stop translation, as the CPU is supposed to sleep from now */ @@ -4017,6 +4019,7 @@ static void gen_nap(DisasContext *ctx)TCGv_i32 t;CHK_HV (ctx); +translator_io_start (&ctx->base); t =tcg_constant_i32 (PPC_PM_NAP );gen_helper_pminsn (cpu_env, t);/* Stop translation, as the CPU is supposed to sleep from now */ @@ -4032,6 +4035,7 @@ static void gen_stop(DisasContext *ctx)TCGv_i32 t;CHK_HV (ctx); +translator_io_start (&ctx->base); t =tcg_constant_i32 (PPC_PM_STOP );gen_helper_pminsn (cpu_env, t);/* Stop translation, as the CPU is supposed to sleep from now */ @@ -4047,6 +4051,7 @@ static void gen_sleep(DisasContext *ctx)TCGv_i32 t;CHK_HV (ctx); +translator_io_start (&ctx->base); t =tcg_constant_i32 (PPC_PM_SLEEP );gen_helper_pminsn (cpu_env, t);/* Stop translation, as the CPU is supposed to sleep from now */ @@ -4062,6 +4067,7 @@ static void gen_rvwinkle(DisasContext *ctx)TCGv_i32 t;CHK_HV (ctx); +translator_io_start (&ctx->base); t =tcg_constant_i32 (PPC_PM_RVWINKLE );gen_helper_pminsn (cpu_env, t);/* Stop translation, as the CPU is supposed to sleep from now */ @@ -4458,6 +4464,7 @@ static void gen_hrfid(DisasContext *ctx)#else /* Restore CPU state */ CHK_HV (ctx); +translator_io_start (&ctx->base);gen_helper_hrfid (cpu_env); ctx->base.is_jmp =DISAS_EXIT ;#endif