All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Paolo Bonzini <pbonzini@redhat.com>, Xin Li <xin@zytor.com>,
	Sean Christopherson <seanjc@google.com>,
	Max Kellermann <max.kellermann@ionos.com>
Cc: hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	kvm@vger.kernel.org
Subject: Re: [PATCH] arch/x86/entry_fred: don't set up KVM IRQs if KVM is disabled
Date: Fri, 16 Feb 2024 22:45:45 +0100	[thread overview]
Message-ID: <87ttm8axrq.ffs@tglx> (raw)
In-Reply-To: <5a332064-0a26-4bb9-8a3e-c99604d2d919@redhat.com>

On Fri, Feb 16 2024 at 07:31, Paolo Bonzini wrote:
> On 2/16/24 03:10, Xin Li wrote:
>
> It is intentional that KVM-related things are compiled out completely
> if !IS_ENABLED(CONFIG_KVM), because then it's also not necessary to
> have

That's a matter of taste. In both cases _ALL_ KVM related things are
compiled out.

#ifdeffing out the vector numbers is silly to begin with because these
vector numbers stay assigned to KVM whether KVM is enabled or not.

And no, I don't think it's a net win to have the #ifdeffery in that
table. Look at apic_idts[] in arch/x86/kernel/idt.c how this ends up
looking. It's unreadable gunk.

The few NULL defines in a header file next to the real stuff

#if IS_ENABLED(CONFIG_KVM)
.....
#else
# define fred_sysvec_kvm_posted_intr_ipi                NULL
# define fred_sysvec_kvm_posted_intr_wakeup_ipi         NULL
# define fred_sysvec_kvm_posted_intr_nested_ipi         NULL
#endif

are not hurting at all and they are at a place where #ifdeffery is
required anyway. That's a very common pattern all over the kernel and it
limits the #ifdef horror to _ONE_ place.

With your change you propagate the #ifdefffery to the multiple and the
very wrong places for absolutely zero practical value. The resulting
binary code is exactly the same for the price of tasteless #ifdeffery in
places where it matters.

Please get rid of this #ifdef in the vector header and don't inflict
bad taste on everyone.

Thanks,

        tglx



  parent reply	other threads:[~2024-02-16 21:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-15 13:36 [PATCH] arch/x86/entry_fred: don't set up KVM IRQs if KVM is disabled Max Kellermann
2024-02-15 18:23 ` Xin Li
2024-02-15 19:30   ` Max Kellermann
2024-02-15 19:55 ` Sean Christopherson
2024-02-16  2:10   ` Xin Li
2024-02-16  6:31     ` Paolo Bonzini
2024-02-16 17:41       ` Xin Li
2024-02-16 17:47         ` Xin Li
2024-02-16 21:45       ` Thomas Gleixner [this message]
2024-02-16 23:00         ` Max Kellermann
2024-02-17  0:11           ` Thomas Gleixner
2024-02-17  9:52         ` Paolo Bonzini
2024-02-17 22:25           ` Thomas Gleixner
2024-02-16 21:46       ` Borislav Petkov
2024-02-16 22:29         ` Thomas Gleixner

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=87ttm8axrq.ffs@tglx \
    --to=tglx@linutronix.de \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=max.kellermann@ionos.com \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=sfr@canb.auug.org.au \
    --cc=x86@kernel.org \
    --cc=xin@zytor.com \
    /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.