lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aLHzmBFuWy2P5Opq@liuwe-devbox-ubuntu-v2.tail21d00.ts.net>
Date: Fri, 29 Aug 2025 18:38:16 +0000
From: Wei Liu <wei.liu@...nel.org>
To: Sean Christopherson <seanjc@...gle.com>
Cc: Marc Zyngier <maz@...nel.org>, Oliver Upton <oliver.upton@...ux.dev>,
	Catalin Marinas <catalin.marinas@....com>,
	Will Deacon <will@...nel.org>,
	Tianrui Zhao <zhaotianrui@...ngson.cn>,
	Bibo Mao <maobibo@...ngson.cn>, Huacai Chen <chenhuacai@...nel.org>,
	Anup Patel <anup@...infault.org>,
	Paul Walmsley <paul.walmsley@...ive.com>,
	Palmer Dabbelt <palmer@...belt.com>,
	Albert Ou <aou@...s.berkeley.edu>,
	Paolo Bonzini <pbonzini@...hat.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
	Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
	"K. Y. Srinivasan" <kys@...rosoft.com>,
	Haiyang Zhang <haiyangz@...rosoft.com>,
	Wei Liu <wei.liu@...nel.org>, Dexuan Cui <decui@...rosoft.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Andy Lutomirski <luto@...nel.org>,
	"Paul E. McKenney" <paulmck@...nel.org>,
	Frederic Weisbecker <frederic@...nel.org>,
	Neeraj Upadhyay <neeraj.upadhyay@...nel.org>,
	Joel Fernandes <joelagnelf@...dia.com>,
	Josh Triplett <josh@...htriplett.org>,
	Boqun Feng <boqun.feng@...il.com>,
	Uladzislau Rezki <urezki@...il.com>, linux-kernel@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org, kvmarm@...ts.linux.dev,
	kvm@...r.kernel.org, loongarch@...ts.linux.dev,
	kvm-riscv@...ts.infradead.org, linux-riscv@...ts.infradead.org,
	linux-hyperv@...r.kernel.org, rcu@...r.kernel.org,
	Nuno Das Neves <nunodasneves@...ux.microsoft.com>,
	Mukesh R <mrathor@...ux.microsoft.com>, ssengar@...ux.microsoft.com,
	namjain@...ux.microsoft.com
Subject: Re: [PATCH v2 2/7] Drivers: hv: Disentangle VTL return cancellation
 from SIGPENDING

On Wed, Aug 27, 2025 at 05:01:51PM -0700, Sean Christopherson wrote:
> Check for return to a lower VTL being cancelled separately from handling
> pending TIF-based work, as there is no need to immediately process pending
> work; the kernel will immediately exit to userspace (ignoring preemption)
> and handle the pending work at that time.
> 
> Disentangling cancellation from the TIF-based work will allow switching to
> common virtualization APIs for detecting and processing pending work.
> 
> Signed-off-by: Sean Christopherson <seanjc@...gle.com>

Thanks for this patch, Sean.

My current plan is to drop this driver from my tree (hence it will
disappear from linux-next soon) because Peter has an objection to the
ABI it introduces. I just have not gotten around to it yet.

I won't apply this patch, the next one and the last one. I have CC'ed
the owner of that driver to this patch here so that your suggestion can
be incorporated in future submissions.

CC Saurabh and Naman.

Thanks,
Wei

> ---
>  drivers/hv/mshv_vtl_main.c | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/hv/mshv_vtl_main.c b/drivers/hv/mshv_vtl_main.c
> index 12f5e77b7095..aa09a76f0eff 100644
> --- a/drivers/hv/mshv_vtl_main.c
> +++ b/drivers/hv/mshv_vtl_main.c
> @@ -731,19 +731,21 @@ static int mshv_vtl_ioctl_return_to_lower_vtl(void)
>  						_TIF_NOTIFY_RESUME | _TIF_NOTIFY_SIGNAL |
>  						_TIF_NEED_RESCHED_LAZY;
>  		unsigned long ti_work;
> -		u32 cancel;
>  		unsigned long irq_flags;
>  		struct hv_vp_assist_page *hvp;
>  		int ret;
>  
>  		local_irq_save(irq_flags);
> +		if (READ_ONCE(mshv_vtl_this_run()->cancel)) {
> +			local_irq_restore(irq_flags);
> +			preempt_enable();
> +			return -EINTR;
> +		}
> +
>  		ti_work = READ_ONCE(current_thread_info()->flags);
> -		cancel = READ_ONCE(mshv_vtl_this_run()->cancel);
> -		if (unlikely((ti_work & VTL0_WORK) || cancel)) {
> +		if (unlikely(ti_work & VTL0_WORK)) {
>  			local_irq_restore(irq_flags);
>  			preempt_enable();
> -			if (cancel)
> -				ti_work |= _TIF_SIGPENDING;
>  			ret = mshv_do_pre_guest_mode_work(ti_work);
>  			if (ret)
>  				return ret;
> -- 
> 2.51.0.268.g9569e192d0-goog
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ