On 13.11.2025 04:16, Penny Zheng wrote:
> To make codes less fragile, we limit the scope of "rc" through adding several
> instances in relatively narrow scopes. We also fixes wrong indentation.
> 
> Suggested-by: Jan Beulich <[email protected]>
> Signed-off-by: Penny Zheng <[email protected]>

Reviewed-by: Jan Beulich <[email protected]>

> @@ -2748,16 +2749,18 @@ void asmlinkage svm_vmexit_handler(void)
>          }
>          else
>          {
> -           rc = hvm_monitor_debug(regs->rip,
> -                                  HVM_MONITOR_SOFTWARE_BREAKPOINT,
> -                                  X86_ET_SW_EXC,
> -                                  insn_len, 0);
> -           if ( rc < 0 )
> -               goto unexpected_exit_type;
> -           if ( !rc )
> -               hvm_inject_exception(X86_EXC_BP,
> -                                    X86_ET_SW_EXC,
> -                                    insn_len, X86_EVENT_NO_EC);
> +            int rc;
> +
> +            rc = hvm_monitor_debug(regs->rip,
> +                                   HVM_MONITOR_SOFTWARE_BREAKPOINT,
> +                                   X86_ET_SW_EXC,
> +                                   insn_len, 0);

As you touch the code anyway, make this the initializer of rc? And at the same
time join the latter two lines? (I may take the liberty of making these
adjustments while committing.)

Jan

Reply via email to