[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMvTesAPeLBfYVa5TGx-o6p+0g_Q1bn6s+nZK5i7NK8QGyfbTA@mail.gmail.com>
Date: Thu, 13 Mar 2025 15:34:28 +0800
From: Tianyu Lan <ltykernel@...il.com>
To: Nuno Das Neves <nunodasneves@...ux.microsoft.com>
Cc: linux-hyperv@...r.kernel.org, x86@...nel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-arch@...r.kernel.org, linux-acpi@...r.kernel.org, kys@...rosoft.com,
haiyangz@...rosoft.com, wei.liu@...nel.org, mhklinux@...look.com,
decui@...rosoft.com, catalin.marinas@....com, will@...nel.org,
tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
dave.hansen@...ux.intel.com, hpa@...or.com, daniel.lezcano@...aro.org,
joro@...tes.org, robin.murphy@....com, arnd@...db.de,
jinankjain@...ux.microsoft.com, muminulrussell@...il.com,
skinsburskii@...ux.microsoft.com, mrathor@...ux.microsoft.com,
ssengar@...ux.microsoft.com, apais@...ux.microsoft.com,
Tianyu.Lan@...rosoft.com, stanislav.kinsburskiy@...il.com,
gregkh@...uxfoundation.org, vkuznets@...hat.com, prapal@...ux.microsoft.com,
muislam@...rosoft.com, anrayabh@...ux.microsoft.com, rafael@...nel.org,
lenb@...nel.org, corbet@....net
Subject: Re: [PATCH v5 07/10] Drivers: hv: Introduce per-cpu event ring tail
On Thu, Mar 13, 2025 at 3:45 AM Nuno Das Neves
<nunodasneves@...ux.microsoft.com> wrote:
>
> On 3/10/2025 6:01 AM, Tianyu Lan wrote:
> > On Thu, Feb 27, 2025 at 7:09 AM Nuno Das Neves
> > <nunodasneves@...ux.microsoft.com> wrote:
> >>
> >> Add a pointer hv_synic_eventring_tail to track the tail pointer for the
> >> SynIC event ring buffer for each SINT.
> >>
> >> This will be used by the mshv driver, but must be tracked independently
> >> since the driver module could be removed and re-inserted.
> >>
> >> Signed-off-by: Nuno Das Neves <nunodasneves@...ux.microsoft.com>
> >> Reviewed-by: Wei Liu <wei.liu@...nel.org>
> >
> > It's better to expose a function to check the tail instead of exposing
> > hv_synic_eventring_tail directly.
> >
> What is the advantage of using a function for this? We need to both set
> and get the tail.
We may add lock or check to avoid race conditions and this depends on the
user case. This is why I want to see how mshv driver uses it.
>
> > BTW, how does mshv driver use hv_synic_eventring_tail? Which patch
> > uses it in this series?
> >
> This variable stores indices into the synic eventring page (one for each
> SINT, and per-cpu). Each SINT has a ringbuffer of u32 messages. The tail
> index points to the latest one.
>
> This is only used for doorbell messages today. The message in this case is
> a port number which is used to lookup and invoke a callback, which signals
> ioeventfd(s), to notify the VMM of a guest MMIO write.
>
> It is used in patch 10.
I found "extern u8 __percpu **hv_synic_eventring_tail;" in the
drivers/hv/mshv_root.h of patch 10.
I seem to miss the code to use it.
+int hv_call_unmap_stat_page(enum hv_stats_object_type type,
+ const union hv_stats_object_identity *identity);
+int hv_call_modify_spa_host_access(u64 partition_id, struct page **pages,
+ u64 page_struct_count, u32 host_access,
+ u32 flags, u8 acquire);
+
+extern struct mshv_root mshv_root;
+extern enum hv_scheduler_type hv_scheduler_type;
+extern u8 __percpu **hv_synic_eventring_tail;
+
+#endif /* _MSHV_ROOT_H_ */
--
Thanks
Tianyu Lan
Powered by blists - more mailing lists