On Tue, May 05, 2026 at 09:50:22PM +0300, Doru Blânzeanu wrote:
> Remove function `fetch_guest_state` because it is a duplicate function
> of `mshv_load_regs` function.
> 
> Signed-off-by: Doru Blânzeanu <[email protected]>
> ---
>  target/i386/mshv/mshv-cpu.c | 21 +--------------------
>  1 file changed, 1 insertion(+), 20 deletions(-)
> 
> diff --git a/target/i386/mshv/mshv-cpu.c b/target/i386/mshv/mshv-cpu.c
> index 4ed6e7548f..9defd05db6 100644
> --- a/target/i386/mshv/mshv-cpu.c
> +++ b/target/i386/mshv/mshv-cpu.c
> @@ -1291,25 +1291,6 @@ static int handle_pio_non_str(const CPUState *cpu,
>      return 0;
>  }
>  
> -static int fetch_guest_state(CPUState *cpu)
> -{
> -    int ret;
> -
> -    ret = mshv_get_standard_regs(cpu);
> -    if (ret < 0) {
> -        error_report("Failed to get standard registers");
> -        return -1;
> -    }
> -
> -    ret = mshv_get_special_regs(cpu);
> -    if (ret < 0) {
> -        error_report("Failed to get special registers");
> -        return -1;
> -    }
> -
> -    return 0;
> -}
> -
>  static int read_memory(const CPUState *cpu, uint64_t initial_gva,
>                         uint64_t initial_gpa, uint64_t gva, uint8_t *data,
>                         size_t len)
> @@ -1429,7 +1410,7 @@ static int handle_pio_str(CPUState *cpu, 
> hv_x64_io_port_intercept_message *info)
>      X86CPU *x86_cpu = X86_CPU(cpu);
>      CPUX86State *env = &x86_cpu->env;
>  
> -    ret = fetch_guest_state(cpu);
> +    ret = mshv_load_regs(cpu);
>      if (ret < 0) {
>          error_report("Failed to fetch guest state");
>          return -1;
> -- 
> 2.53.0

Reviewed-by: Magnus Kulke <[email protected]>

Reply via email to