kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmytro Maluka <dmy@semihalf.com>
To: Sean Christopherson <seanjc@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	kvm@vger.kernel.org, Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org, Eric Auger <eric.auger@redhat.com>,
	Alex Williamson <alex.williamson@redhat.com>,
	Rong L Liu <rong.l.liu@intel.com>,
	Zhenyu Wang <zhenyuw@linux.intel.com>,
	Tomasz Nowicki <tn@semihalf.com>,
	Grzegorz Jaszczyk <jaz@semihalf.com>,
	Dmitry Torokhov <dtor@google.com>
Subject: Re: [PATCH 1/3] KVM: x86: Move kvm_(un)register_irq_mask_notifier() to generic KVM
Date: Fri, 29 Jul 2022 13:09:19 +0200	[thread overview]
Message-ID: <1cdff41c-c917-1344-02bc-ad5cf5c79ab1@semihalf.com> (raw)
In-Reply-To: <YuLZng8mW0qn4MFk@google.com>

On 7/28/22 20:46, Sean Christopherson wrote:
> On Fri, Jul 15, 2022, Dmytro Maluka wrote:
>> In preparation for implementing postponing resamplefd event until the
>> interrupt is unmasked, move kvm_(un)register_irq_mask_notifier() from
>> x86 to arch-independent code to make it usable by irqfd.
> 
> This patch needs to move more than just the helpers, e.g. mask_notifier_list
> needs to be in "struct kvm", not "stuct kvm_arch".
> 
> arch/arm64/kvm/../../../virt/kvm/eventfd.c: In function ‘kvm_register_irq_mask_notifier’:
> arch/arm64/kvm/../../../virt/kvm/eventfd.c:528:51: error: ‘struct kvm_arch’ has no member named ‘mask_notifier_list’
>   528 |         hlist_add_head_rcu(&kimn->link, &kvm->arch.mask_notifier_list);
>       |                                                   ^
> make[3]: *** [scripts/Makefile.build:249: arch/arm64/kvm/../../../virt/kvm/eventfd.o] Error 1
> make[3]: *** Waiting for unfinished jobs....
>   AR      kernel/entry/built-in.a

Oops, sorry.

> And kvm_fire_mask_notifiers() should probably be moved as well, otherwise there's
> no point in moving the registration to common code.

Good point, we can move it right away, even though it is not called on
other architectures for now.

> The other option would be to make the generic functions wrappers around arch-specific
> hooks.  But IIRC won't this eventually be needed for other architectures?

Right, I assume we will eventually need it for ARM at least. Not in the
near future though, and at the moment I have no non-x86 hardware on hand
to implement it for other architectures.

Actually I feel a bit uncomfortable with generic irqfd relying on
kvm_register_irq_mask_notifier() which silently has no effect on other
architectures. Maybe it's better to keep
kvm_(un)register_irq_mask_notifier() in the x86 code, and for the
generic code add a weak version which e.g. just prints a warning like
"irq mask notifiers not implemented on this arch". (Or maybe instead of
weak functions introduce arch-specific hooks as you suggested, and print
such a warning if no hook is provided.) What do you think?

Thanks,
Dmytro


  reply	other threads:[~2022-07-29 11:09 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-15 15:59 [PATCH 0/3] KVM: Fix oneshot interrupts forwarding Dmytro Maluka
2022-07-15 15:59 ` [PATCH 1/3] KVM: x86: Move kvm_(un)register_irq_mask_notifier() to generic KVM Dmytro Maluka
2022-07-28 18:46   ` Sean Christopherson
2022-07-29 11:09     ` Dmytro Maluka [this message]
2022-08-02 21:43       ` Sean Christopherson
2022-07-15 15:59 ` [PATCH 2/3] KVM: x86: Add kvm_irq_is_masked() Dmytro Maluka
2022-08-04 17:14   ` Eric Auger
2022-08-04 19:31     ` Dmytro Maluka
2022-07-15 15:59 ` [PATCH 3/3] KVM: irqfd: Postpone resamplefd notify for oneshot interrupts Dmytro Maluka
2022-07-25 23:44   ` Liu, Rong L
2022-07-26 14:07     ` Dmytro Maluka
2022-07-29 20:48       ` Liu, Rong L
2022-07-30 14:34         ` Dmytro Maluka
2022-08-09 22:02           ` Liu, Rong L
2022-08-10  0:56             ` Dmytro Maluka
2022-08-11 16:12               ` Liu, Rong L
2022-08-13 14:33                 ` Dmytro Maluka
2022-08-10 17:34             ` Liu, Rong L
2022-07-28 18:55   ` Sean Christopherson
2022-07-29 11:19     ` Dmytro Maluka
2022-07-29 21:21   ` Liu, Rong L
2022-07-30 15:30     ` Dmytro Maluka
2022-08-02 18:47   ` Dmytro Maluka

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=1cdff41c-c917-1344-02bc-ad5cf5c79ab1@semihalf.com \
    --to=dmy@semihalf.com \
    --cc=alex.williamson@redhat.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=dtor@google.com \
    --cc=eric.auger@redhat.com \
    --cc=hpa@zytor.com \
    --cc=jaz@semihalf.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=rong.l.liu@intel.com \
    --cc=seanjc@google.com \
    --cc=tglx@linutronix.de \
    --cc=tn@semihalf.com \
    --cc=x86@kernel.org \
    --cc=zhenyuw@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).