All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Penny Zheng <Penny.Zheng@amd.com>
Cc: ray.huang@amd.com, grygorii_strashko@epam.com,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>,
	"Tamas K Lengyel" <tamas@tklengyel.com>,
	"Alexandru Isaila" <aisaila@bitdefender.com>,
	"Petre Pircalabu" <ppircalabu@bitdefender.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v3 6/7] xen/mem_access: wrap memory access when VM_EVENT=n
Date: Mon, 24 Nov 2025 15:09:31 +0100	[thread overview]
Message-ID: <e9a85592-9df1-4f32-82df-20c7f069d1e2@suse.com> (raw)
In-Reply-To: <20251121091554.1003315-7-Penny.Zheng@amd.com>

On 21.11.2025 10:15, Penny Zheng wrote:
> @@ -2080,7 +2081,11 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
>  #endif
>      }
>  
> -    if ( req_ptr )
> +    /*
> +     * Excessive condition is to avoid runtime undefined error only
> +     * when CONFIG_USBAN=y
> +     */
> +    if ( req_ptr && vm_event_is_enabled(curr) )
>      {

I fear the comment isn't really helpful this way. What's "excessive" here may
be clear from patch context, but it won't be clear when looking at the code
later. Nor would it then be immediately clear why the vm_event_is_enabled()
check is (seemingly) unnecessary. How about this:

"req_ptr being constant NULL when !CONFIG_VM_EVENT, CONFIG_UBSAN=y builds
 have been observed to still hit undefined-ness at runtime. Hence do a
 seemingly redundant vm_event_is_enabled() check here."

With this or any other suitable improvement to the comment:
Acked-by: Jan Beulich <jbeulich@suse.com>
If we want to go with the suggestion above, I'd be happy to do the replacement
while committing. But of course first the necessary 2nd ack will want
collecting.

Jan


  reply	other threads:[~2025-11-24 14:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-21  9:15 [PATCH v3 0/7] consolidate vm event subsystem Penny Zheng
2025-11-21  9:15 ` [PATCH v3 1/7] xen/x86: move declaration from mem_access.h to altp2m.h Penny Zheng
2025-11-21  9:15 ` [PATCH v3 2/7] xen/xsm: wrap xsm_vm_event_control() with CONFIG_VM_EVENT Penny Zheng
2025-11-25 14:57   ` Daniel P. Smith
2025-11-25 15:01     ` Jan Beulich
2025-11-21  9:15 ` [PATCH v3 4/7] x86/monitor: wrap monitor_op under CONFIG_VM_EVENT Penny Zheng
2025-11-21  9:15 ` [PATCH v3 5/7] xen/p2m: move xenmem_access_to_p2m_access() to common p2m.c Penny Zheng
2025-11-24 14:01   ` Jan Beulich
2025-11-21  9:15 ` [PATCH v3 6/7] xen/mem_access: wrap memory access when VM_EVENT=n Penny Zheng
2025-11-24 14:09   ` Jan Beulich [this message]
2025-12-01  3:46     ` Penny, Zheng
2025-11-21  9:15 ` [PATCH v3 7/7] xen/vm_event: consolidate CONFIG_VM_EVENT Penny Zheng

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=e9a85592-9df1-4f32-82df-20c7f069d1e2@suse.com \
    --to=jbeulich@suse.com \
    --cc=Penny.Zheng@amd.com \
    --cc=aisaila@bitdefender.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=grygorii_strashko@epam.com \
    --cc=ppircalabu@bitdefender.com \
    --cc=ray.huang@amd.com \
    --cc=roger.pau@citrix.com \
    --cc=tamas@tklengyel.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.