All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Penny Zheng <Penny.Zheng@amd.com>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>,
	"Jason Andryuk" <jason.andryuk@amd.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v1 1/7] xen/svm: limit the scope of "rc"
Date: Thu, 13 Nov 2025 09:56:29 +0100	[thread overview]
Message-ID: <8304ea57-0574-482b-a2ea-e1dadc58656e@suse.com> (raw)
In-Reply-To: <20251113031630.1465599-2-Penny.Zheng@amd.com>

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 <jbeulich@suse.com>
> Signed-off-by: Penny Zheng <Penny.Zheng@amd.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>

> @@ -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


  parent reply	other threads:[~2025-11-13  8:56 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-13  3:16 [PATCH v1 0/7] consolidate vm event subsystem Penny Zheng
2025-11-13  3:16 ` [PATCH v1 3/7] xen/monitor: wrap monitor_op under CONFIG_VM_EVENT Penny Zheng
2025-11-13  9:18   ` Jan Beulich
2025-11-18 23:32     ` Jason Andryuk
2025-11-13  3:16 ` [PATCH v1 4/7] xen/p2m: move xenmem_access_to_p2m_access() to common p2m.c Penny Zheng
2025-11-13  9:29   ` Jan Beulich
2025-11-13  3:16 ` [PATCH v1 5/7] xen/x86: move declaration from mem_access.h to altp2m.h Penny Zheng
2025-11-13  9:35   ` Jan Beulich
2025-11-18 11:09     ` Penny, Zheng
2025-11-18 23:40       ` Jason Andryuk
2025-11-13  3:16 ` [PATCH v1 6/7] xen/mem_access: wrap memory access when VM_EVENT=n Penny Zheng
2025-11-13  9:48   ` Jan Beulich
2025-11-13  3:16 ` [PATCH v1 7/7] xen/vm_event: consolidate CONFIG_VM_EVENT Penny Zheng
2025-11-13 10:16   ` Jan Beulich
2025-11-18 23:49     ` Jason Andryuk
     [not found] ` <20251113031630.1465599-2-Penny.Zheng@amd.com>
2025-11-13  8:56   ` Jan Beulich [this message]
2025-11-18  7:11     ` [PATCH v1 1/7] xen/svm: limit the scope of "rc" Penny, Zheng
2025-11-18 23:20       ` Jason Andryuk
     [not found] ` <20251113031630.1465599-3-Penny.Zheng@amd.com>
2025-11-13  9:13   ` [PATCH v1 2/7] xen/vm_event: introduce vm_event_is_enabled() Jan Beulich
2025-11-18 10:11     ` Penny, Zheng
2025-11-18 23:30       ` Jason Andryuk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8304ea57-0574-482b-a2ea-e1dadc58656e@suse.com \
    --to=jbeulich@suse.com \
    --cc=Penny.Zheng@amd.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jason.andryuk@amd.com \
    --cc=roger.pau@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.