From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: Jan Beulich <jbeulich@suse.com>,
xen-devel@lists.xenproject.org,
Andrew Cooper <andrew.cooper3@citrix.com>,
Sergiy Kibrik <Sergiy_Kibrik@epam.com>
Subject: Re: [XEN PATCH v1 1/3] x86/hvm: introduce config option for ACPI PM timer
Date: Mon, 7 Oct 2024 12:12:03 +0200 [thread overview]
Message-ID: <ZwOz81NgKetWDpVc@macbook.local> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2410041404430.1138574@ubuntu-linux-20-04-desktop>
On Fri, Oct 04, 2024 at 02:07:09PM -0700, Stefano Stabellini wrote:
> On Fri, 4 Oct 2024, Jan Beulich wrote:
> > On 04.10.2024 15:09, Roger Pau Monné wrote:
> > > On Fri, Oct 04, 2024 at 12:31:50PM +0300, Sergiy Kibrik wrote:
> > >> --- a/xen/arch/x86/include/asm/domain.h
> > >> +++ b/xen/arch/x86/include/asm/domain.h
> > >> @@ -496,7 +496,8 @@ struct arch_domain
> > >>
> > >> #define has_vlapic(d) (!!((d)->arch.emulation_flags & X86_EMU_LAPIC))
> > >> #define has_vhpet(d) (!!((d)->arch.emulation_flags & X86_EMU_HPET))
> > >> -#define has_vpm(d) (!!((d)->arch.emulation_flags & X86_EMU_PM))
> > >> +#define has_vpm(d) (IS_ENABLED(CONFIG_X86_PMTIMER) && \
> > >> + !!((d)->arch.emulation_flags & X86_EMU_PM))
> > >
> > > Do you really need the IS_ENABLED() here? If you modify
> > > emulation_flags_ok() to reject the flag if not available it won't be
> > > possible for any domain to have it set.
> >
> > With the IS_ENABLED() the only other approach to have the compiler DCE any
> > code left unreachable would be to #define X86_EMU_PM to 0 in that case. I
> > guess I'd slightly prefer that alternative, but otherwise the approach used
> > here would still be wanted imo.
>
> The compiler DCE is important, either the approach in this patch or
> Jan's suggestion would work fine as far as I can tell.
I guess I was too focused on has_vpm() usage: note that has_vpm() is
only used in the file that's being removed from the build, so there
will be nothing to DCE afterwards. That however might not be the case
for all has_* options, neither for has_vpm() moving forwards.
Thanks, Roger.
next prev parent reply other threads:[~2024-10-07 10:12 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-04 9:29 [XEN PATCH v1 0/3] configurable stdvga & pmtimer emulation Sergiy Kibrik
2024-10-04 9:31 ` [XEN PATCH v1 1/3] x86/hvm: introduce config option for ACPI PM timer Sergiy Kibrik
2024-10-04 13:09 ` Roger Pau Monné
2024-10-04 13:30 ` Jan Beulich
2024-10-04 21:07 ` Stefano Stabellini
2024-10-07 10:12 ` Roger Pau Monné [this message]
2024-10-04 9:33 ` [XEN PATCH v1 2/3] x86/hvm: introduce config option for stdvga emulation Sergiy Kibrik
2024-10-04 13:12 ` Roger Pau Monné
2024-10-04 21:08 ` Stefano Stabellini
2024-10-07 10:14 ` Roger Pau Monné
2024-10-07 20:24 ` Stefano Stabellini
2024-10-04 13:34 ` Jan Beulich
2024-10-04 9:35 ` [XEN PATCH v1 3/3] x86/hvm: make ACPI PM & stdvga emulation optional Sergiy Kibrik
2024-10-04 13:36 ` Jan Beulich
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=ZwOz81NgKetWDpVc@macbook.local \
--to=roger.pau@citrix.com \
--cc=Sergiy_Kibrik@epam.com \
--cc=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=sstabellini@kernel.org \
--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.