All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Tamas K Lengyel <tamas@tklengyel.com>
Cc: xen-devel@lists.xenproject.org,
	"Stefano Stabellini" <stefano.stabellini@amd.com>,
	"Julien Grall" <julien@xen.org>,
	"Bertrand Marquis" <bertrand.marquis@arm.com>,
	"Michal Orzel" <michal.orzel@amd.com>,
	"Volodymyr Babchuk" <Volodymyr_Babchuk@epam.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Anthony PERARD" <anthony.perard@vates.tech>,
	"Roger Pau Monné" <roger.pau@citrix.com>,
	"Alexandru Isaila" <aisaila@bitdefender.com>,
	"Petre Pircalabu" <ppircalabu@bitdefender.com>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Ayan Kumar Halder" <ayan.kumar.halder@amd.com>,
	"Sergiy Kibrik" <Sergiy_Kibrik@epam.com>
Subject: Re: [PATCH v2 4/4] xen: mem_access: conditionally compile vm_event.c & monitor.c
Date: Fri, 31 Jan 2025 07:42:36 +0100	[thread overview]
Message-ID: <36708a3f-2664-4b04-9f5d-f115d362d100@suse.com> (raw)
In-Reply-To: <CABfawhkw-MDvVnfgTi44YHA9JYSkzFS6VkdtLdH33big9BcHdA@mail.gmail.com>

On 31.01.2025 01:33, Tamas K Lengyel wrote:
> On Tue, Jan 21, 2025 at 5:25 AM Sergiy Kibrik <Sergiy_Kibrik@epam.com> wrote:
>> --- a/xen/arch/arm/vsmc.c
>> +++ b/xen/arch/arm/vsmc.c
>> @@ -330,7 +330,8 @@ void do_trap_smc(struct cpu_user_regs *regs, const union hsr hsr)
>>      }
>>
>>      /* If monitor is enabled, let it handle the call. */
>> -    if ( current->domain->arch.monitor.privileged_call_enabled )
>> +    if ( IS_ENABLED(CONFIG_VM_EVENT) &&
>> +         current->domain->arch.monitor.privileged_call_enabled )
>>          rc = monitor_smc();
> 
> Why not wrap this entire if block above in an #ifdef CONFIG_VM_EVENT?
> I think it would be more explicit what code is being compiled that way
> instead of just relying on the compiler optimization to take care of
> removing it.

Well - we generally prefer things being written this way, where possible.
This is to keep as much code as possible exposed to the compiler no
matter what configuration. This way the risk of bit-rotting is a little
lower (e.g. when making changes affecting such a piece of code, but not
noticing the need for a change because things compile fine in whatever
configuration(s) the person tests).

Jan

> The rest of the patch looks fine to me.
> 
> Tamas



      reply	other threads:[~2025-01-31  6:42 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-21 10:17 [PATCH v2 0/4] make build of vm_event/mem_access/monitor optional Sergiy Kibrik
2025-01-21 10:19 ` [PATCH v2 1/4] xen: kconfig: rename MEM_ACCESS -> VM_EVENT Sergiy Kibrik
2025-01-30 13:24   ` Jan Beulich
2025-01-31  0:26     ` Tamas K Lengyel
2025-01-31  6:30       ` Jan Beulich
2025-01-31 23:36         ` Tamas K Lengyel
2025-02-03  7:36           ` Jan Beulich
2025-02-04  1:07             ` Tamas K Lengyel
2025-01-30 13:26   ` Jan Beulich
2025-01-31  0:29   ` Tamas K Lengyel
2025-01-21 10:21 ` [PATCH v2 2/4] x86:monitor: control monitor.c build with CONFIG_VM_EVENT option Sergiy Kibrik
2025-01-30 13:27   ` Jan Beulich
2025-01-21 10:23 ` [PATCH v2 3/4] automation: rename CONFIG_MEM_ACCESS -> CONFIG_VM_EVENT Sergiy Kibrik
2025-01-22  8:03   ` Nicola Vetrini
2025-01-30 13:14   ` Jan Beulich
2025-01-21 10:25 ` [PATCH v2 4/4] xen: mem_access: conditionally compile vm_event.c & monitor.c Sergiy Kibrik
2025-01-30 13:32   ` Jan Beulich
2025-01-31  0:33   ` Tamas K Lengyel
2025-01-31  6:42     ` Jan Beulich [this message]

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=36708a3f-2664-4b04-9f5d-f115d362d100@suse.com \
    --to=jbeulich@suse.com \
    --cc=Sergiy_Kibrik@epam.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=aisaila@bitdefender.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@vates.tech \
    --cc=ayan.kumar.halder@amd.com \
    --cc=bertrand.marquis@arm.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=ppircalabu@bitdefender.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=stefano.stabellini@amd.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.