Re: [PATCH] target/riscv: Ensure opcode is saved for every instruction

2022-07-27 Thread Richard Henderson
On 7/26/22 21:06, Anup Patel wrote: I see that decode_save_opc() only saves opcode in an array through tcg_set_insn_start_param(). Which brings me to the question about how much are we saving by distributing decode_save_opc() calls ? It's not about tcg_set_insn_start_param(), but later when it

Re: [PATCH] target/riscv: Ensure opcode is saved for every instruction

2022-07-26 Thread Anup Patel
On Wed, Jul 27, 2022 at 9:24 AM Richard Henderson wrote: > > On 7/26/22 20:25, Anup Patel wrote: > > We should call decode_save_opc() for every decoded instruction > > because generating transformed instruction upon guest page faults > > expects opcode to be available. Without this, hypervisor see

Re: [PATCH] target/riscv: Ensure opcode is saved for every instruction

2022-07-26 Thread Richard Henderson
On 7/26/22 20:25, Anup Patel wrote: We should call decode_save_opc() for every decoded instruction because generating transformed instruction upon guest page faults expects opcode to be available. Without this, hypervisor sees transformed instruction as zero in htinst CSR for guest MMIO emulation

[PATCH] target/riscv: Ensure opcode is saved for every instruction

2022-07-26 Thread Anup Patel
We should call decode_save_opc() for every decoded instruction because generating transformed instruction upon guest page faults expects opcode to be available. Without this, hypervisor sees transformed instruction as zero in htinst CSR for guest MMIO emulation which makes MMIO emulation in hypervi