From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CA715CA0FED for ; Fri, 5 Sep 2025 07:13:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Message-ID: References:Mime-Version:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=y2szFDZKaTdsxNo15Gm5fhhQ13UtcgFqxlOpwV9lWQs=; b=y04nV+IOc3bEdD+03tprty5TGe NEOMwZ32O4+3mPpflOYshl2sBITy01mGI6smx99ecnsIYtxl91Bc2Ii7NXy+E/3qJgrHceYoIW6pw QvEEb0DgSBxCYpIAtwr426hxepBhdlCdUp8cfUkFkC8NpkkkD9L/G7b2S3bRCHIOyJAi8EKzQOy95 gW9ao8rEhVicuwG8CTWAwOQdIGytMu+K3K/tqFfMyZywaX7B6FxPtIkGEjeBy/ONrwX4rF1g89C2l qndtHiXZnpbaz3ms7hYql7QLhcVnLZW5R5IMg1dI3irQgPNXUSZYmhd3Reo35VTrlDVk+DlyicSKo zgGBZn1w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uuQdm-0000000HW8v-1BAO; Fri, 05 Sep 2025 07:13:46 +0000 Received: from mail-pj1-x1049.google.com ([2607:f8b0:4864:20::1049]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uuPAo-0000000H3Os-1xHa for kvm-riscv@lists.infradead.org; Fri, 05 Sep 2025 05:39:48 +0000 Received: by mail-pj1-x1049.google.com with SMTP id 98e67ed59e1d1-32b58eeb874so1686301a91.3 for ; Thu, 04 Sep 2025 22:39:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1757050785; x=1757655585; darn=lists.infradead.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=3udnh9xsllR+FkjIGPPOo5bX8r6scLid4vmBPD5wmTc=; b=zUWO50D3tiM87PviUcIZeXZHpRKLACZowq5urDeMUufJe8NTS2KuH/gppho7SKIqB7 /YDJ3u8WlYU1zM4jUFyGgoVfLQpLFb08dx52N5maIYS6IO9D9wbmbe+3GdUwX8FNZkzV pYeFDn1PCbPTllXIxPJp7TOlhXBXh7ImatvaQmAIvjSkC7uyQ3mWlVPQ3ztuwXv10cbR zckgjoyAK213NOjrtVVukE0PgNXdiViELF1ErH6ej+YJkkWOz7a+5IVQHAe4eSqlGfAi 7NRFLmJePAh6dTzGii8rnF//Kdn5f1ChyJzke/YMVQPkTQ356Gc7GcgmLLRBVNTkd2fn Ob/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757050785; x=1757655585; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3udnh9xsllR+FkjIGPPOo5bX8r6scLid4vmBPD5wmTc=; b=e06xAzeE7CWbtK9FrG8PoOEzBC8jg3yfV67nvnazHydOXv42Svm0yX5RGBfY9Juz3q 2icabDzPxqG1ZrI9VYDvFczbb4Dskc3QZCncDjHDH2bHf6lRTvQfD0burhdhaeO2aQ76 oKBEw3n0Kqi6x/oVPek2e+axjcugmECriQK7bmUvejiB51Zzjmxeo4ehqdI3AXbUVyqh Ine83EW0P5ZucBvtxxychayWzbFVOpIE8m8QS4lDQLEANWssYqr6Utb+Krf6830XAotH sGAxiMJ41v9MZaqehBv8ipF/yFLUBp02qm5HQgfaFzK9sYhgEdHHmO2kkHTvaXhlO77V /hYg== X-Forwarded-Encrypted: i=1; AJvYcCVwBBtAJluiCNMWwiT1l1rNkutxbojGzH08UCtQghe45J/sxUSQM3j/Uj5rZ3yQcaWsMPrp5kVCrw0=@lists.infradead.org X-Gm-Message-State: AOJu0YyeHm4wJyhcUAD5buNTdRY7/jezrw7hcY7Ahnyg1JmSY24x+J6U PK27GauFPdgdJSRkl+Krk2QHyr0r4kYbq1RhST02CvXko656RMnURFaAYH9CiJHsfzCsETLPKmH Bx6NMSw== X-Google-Smtp-Source: AGHT+IEl3aDxdJxOeFOgsIqqYfLRUExl039yXm0dtHzzby5zYzVGU35ZbpW1dVjZIdU0C50mCLd9IUYMCJw= X-Received: from pjuw15.prod.google.com ([2002:a17:90a:d60f:b0:325:5e4e:4bd4]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:3809:b0:329:dff0:701b with SMTP id 98e67ed59e1d1-329dff070c6mr19066965a91.17.1757050784899; Thu, 04 Sep 2025 22:39:44 -0700 (PDT) Date: Thu, 4 Sep 2025 22:39:37 -0700 In-Reply-To: Mime-Version: 1.0 References: <20250828000156.23389-1-seanjc@google.com> Message-ID: Subject: Re: [PATCH v2 0/7] Drivers: hv: Fix NEED_RESCHED_LAZY and use common APIs From: Sean Christopherson To: Wei Liu Cc: Marc Zyngier , Oliver Upton , Catalin Marinas , Will Deacon , Tianrui Zhao , Bibo Mao , Huacai Chen , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Paolo Bonzini , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "K. Y. Srinivasan" , Haiyang Zhang , Dexuan Cui , Peter Zijlstra , Andy Lutomirski , "Paul E. McKenney" , Frederic Weisbecker , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Uladzislau Rezki , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvm@vger.kernel.org, loongarch@lists.linux.dev, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-hyperv@vger.kernel.org, rcu@vger.kernel.org, Nuno Das Neves , Mukesh R X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250904_223946_516864_B967F922 X-CRM114-Status: GOOD ( 30.47 ) X-BeenThere: kvm-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kvm-riscv" Errors-To: kvm-riscv-bounces+kvm-riscv=archiver.kernel.org@lists.infradead.org On Thu, Sep 04, 2025, Wei Liu wrote: > On Wed, Aug 27, 2025 at 05:01:49PM -0700, Sean Christopherson wrote: > > Fix a bug where MSHV root partitions (and upper-level VTL code) don't honor > > NEED_RESCHED_LAZY, and then deduplicate the TIF related MSHV code by turning > > the "kvm" entry APIs into more generic "virt" APIs. > > > > This version is based on > > > > git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git hyperv-next > > > > in order to pickup the VTL changes that are queued for 6.18. I also > > squashed the NEED_RESCHED_LAZY fixes for root and VTL modes into a single > > patch, as it should be easy/straightforward to drop the VTL change as needed > > if we want this in 6.17 or earlier. > > > > That effectively means the full series is dependent on the VTL changes being > > fully merged for 6.18. But I think that's ok as it's really only the MSHV > > changes that have any urgency whatsoever, and I assume that Microsoft is > > the only user that truly cares about the MSHV root fix. I.e. if the whole > > thing gets delayed, I think it's only the Hyper-V folks that are impacted. > > > > I have no preference what tree this goes through, or when, and can respin > > and/or split as needed. > > > > As with v1, the Hyper-V stuff and non-x86 architectures are compile-tested > > only. > > > > v2: > > - Rebase on hyperv-next. > > - Fix and converge the VTL code as well. [Peter, Nuno] > > > > v1: https://lore.kernel.org/all/20250825200622.3759571-1-seanjc@google.com > > > > I dropped the mshv_vtl changes in this series and applied the rest > (including the KVM changes) to hyperv-next. mshv_do_pre_guest_mode_work() ended up getting left behind since its removal was in the last mshv_vtl patch. $ git grep mshv_do_pre_guest_mode_work drivers/hv/mshv.h:int mshv_do_pre_guest_mode_work(ulong th_flags); drivers/hv/mshv_common.c:int mshv_do_pre_guest_mode_work(ulong th_flags) drivers/hv/mshv_common.c:EXPORT_SYMBOL_GPL(mshv_do_pre_guest_mode_work); Want to squash this into 3786d7d6b3c0 ("mshv: Use common "entry virt" APIs to do work in root before running guest")? --- drivers/hv/mshv.h | 2 -- drivers/hv/mshv_common.c | 22 ---------------------- 2 files changed, 24 deletions(-) diff --git a/drivers/hv/mshv.h b/drivers/hv/mshv.h index 0340a67acd0a..d4813df92b9c 100644 --- a/drivers/hv/mshv.h +++ b/drivers/hv/mshv.h @@ -25,6 +25,4 @@ int hv_call_set_vp_registers(u32 vp_index, u64 partition_id, u16 count, int hv_call_get_partition_property(u64 partition_id, u64 property_code, u64 *property_value); -int mshv_do_pre_guest_mode_work(ulong th_flags); - #endif /* _MSHV_H */ diff --git a/drivers/hv/mshv_common.c b/drivers/hv/mshv_common.c index eb3df3e296bb..aa2be51979fd 100644 --- a/drivers/hv/mshv_common.c +++ b/drivers/hv/mshv_common.c @@ -138,25 +138,3 @@ int hv_call_get_partition_property(u64 partition_id, return 0; } EXPORT_SYMBOL_GPL(hv_call_get_partition_property); - -/* - * Handle any pre-processing before going into the guest mode on this cpu, most - * notably call schedule(). Must be invoked with both preemption and - * interrupts enabled. - * - * Returns: 0 on success, -errno on error. - */ -int mshv_do_pre_guest_mode_work(ulong th_flags) -{ - if (th_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL)) - return -EINTR; - - if (th_flags & (_TIF_NEED_RESCHED | _TIF_NEED_RESCHED_LAZY)) - schedule(); - - if (th_flags & _TIF_NOTIFY_RESUME) - resume_user_mode_work(NULL); - - return 0; -} -EXPORT_SYMBOL_GPL(mshv_do_pre_guest_mode_work); base-commit: 3786d7d6b3c0a412ebe4439ba4a7d4b0e27d9a12 -- -- kvm-riscv mailing list kvm-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kvm-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f74.google.com (mail-pj1-f74.google.com [209.85.216.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DC95823B611 for ; Fri, 5 Sep 2025 05:39:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757050787; cv=none; b=AY/4fwW2e0zeXlq61HzBopx+SPg7G0/q+dJDg3/Pnw9b0vjwNgxFYxKB7LMPiw16QEDEyAO0qkupeFG0VyhJfKi8cygCOSTghF6Hnerpev0Rn6fR5PHoW0wRF9dqyf6gRklyzcGooZZ82LqPPlbM23ZuaOHmE9AmnULD4MusQEA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757050787; c=relaxed/simple; bh=wP0Nh39SvLrrUzcjoVyfrVPxYIzy1SY/V7/2kWcMIHU=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=syfz38fyMxFnv8ispU9TFzADUr5x5QPLdmpbJylR3kpbiVYYgaYuwl//2F0ZxUCZ4z5FXaBmBPpUrqcrUuwXCdIcgB0IgfqwIY+z/0OuCn1HFhl4ceQby3mxWMIM4/FR7mtQEJcXc5IVTh7fuc/LWBvjkDFoGmznIM0LHGehs0Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=lQwzYtm2; arc=none smtp.client-ip=209.85.216.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="lQwzYtm2" Received: by mail-pj1-f74.google.com with SMTP id 98e67ed59e1d1-32815c1ddc7so1566704a91.1 for ; Thu, 04 Sep 2025 22:39:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1757050785; x=1757655585; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=3udnh9xsllR+FkjIGPPOo5bX8r6scLid4vmBPD5wmTc=; b=lQwzYtm2NV4Io4r/i3BCtkCOVhcIr4Ap4aY1jaLJulrXaLdfg75M9pjFwojB5+NfTR yHNRD18Y2qWcloAz3pRVhvfcE1ozVRkyC4xMA5+5XuqA3HgIOgoAZRLlWS5Ar0NFszU2 OZ6iyQ1zLlPxMtI7rbEhXVGLS65b9oBWuz2O2LPIJQnIddCHaMwaA2q3X5/wVYuPCV4A ltJ6N26FjQ5ruch2n5EzaV7VzoWAeO0rn+jMgaJhMYg0zGD/lnaNlFwReK6FUlwFh67/ VIMIFskP0SM4Yl9o+nH4nt9Ysq/iV1lH3rr4bl8GwXz8DWXh+4346twU30d/LpBESjku 9DOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757050785; x=1757655585; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3udnh9xsllR+FkjIGPPOo5bX8r6scLid4vmBPD5wmTc=; b=uXjLrJWTH3kbDI8OR+vhsMuJONBV5YYKoY3y0hBebuRuNmdgJchE/TirGuf2Udwd2k 3dw3oWCovmQDBc3NbvsxcUVq7xvdiKhu2KHKs0iVW9RWFnRvNoQtcKiJ855HJSASTDok NUZVSWtLGNz8mp3YrIi4eZw/DDkujx9jrXW3Xccb1gATftfpXaDT/BJyhCuy5rANKLC9 r8OP2V+owCsmjjnwBdOwBfLhB902CiIxdckG5zpHdmXpQy9YaQvL/9cSz79dtnbqFj39 Qllh6hnzsud3Ne+/+DEE6xqWWJZdJ1k17wc4nBQm239Cg2KkkZ/klvWGh1GSH52uSuDS nhfQ== X-Forwarded-Encrypted: i=1; AJvYcCWA/YImMj7hQwH0BIJHnrighuk0sqlR1EP3du7McnfOPvJRMFlER2u7dsmnRb0X7jRYVps=@vger.kernel.org X-Gm-Message-State: AOJu0YyCFR6fi3Qe3QH9QA2TgxLJ7rPSjGVwPQcXtxtmLojbIIgEFX3u 6GAwbwyenQhJ6g1aynU8ZGzQ2Cr8v7d/nszIs+ztYYivf4896WkwHx6MIrqof0rqh/ip4g74uXJ /m6QOCQ== X-Google-Smtp-Source: AGHT+IEl3aDxdJxOeFOgsIqqYfLRUExl039yXm0dtHzzby5zYzVGU35ZbpW1dVjZIdU0C50mCLd9IUYMCJw= X-Received: from pjuw15.prod.google.com ([2002:a17:90a:d60f:b0:325:5e4e:4bd4]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:3809:b0:329:dff0:701b with SMTP id 98e67ed59e1d1-329dff070c6mr19066965a91.17.1757050784899; Thu, 04 Sep 2025 22:39:44 -0700 (PDT) Date: Thu, 4 Sep 2025 22:39:37 -0700 In-Reply-To: Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250828000156.23389-1-seanjc@google.com> Message-ID: Subject: Re: [PATCH v2 0/7] Drivers: hv: Fix NEED_RESCHED_LAZY and use common APIs From: Sean Christopherson To: Wei Liu Cc: Marc Zyngier , Oliver Upton , Catalin Marinas , Will Deacon , Tianrui Zhao , Bibo Mao , Huacai Chen , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Paolo Bonzini , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "K. Y. Srinivasan" , Haiyang Zhang , Dexuan Cui , Peter Zijlstra , Andy Lutomirski , "Paul E. McKenney" , Frederic Weisbecker , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Uladzislau Rezki , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvm@vger.kernel.org, loongarch@lists.linux.dev, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-hyperv@vger.kernel.org, rcu@vger.kernel.org, Nuno Das Neves , Mukesh R Content-Type: text/plain; charset="us-ascii" On Thu, Sep 04, 2025, Wei Liu wrote: > On Wed, Aug 27, 2025 at 05:01:49PM -0700, Sean Christopherson wrote: > > Fix a bug where MSHV root partitions (and upper-level VTL code) don't honor > > NEED_RESCHED_LAZY, and then deduplicate the TIF related MSHV code by turning > > the "kvm" entry APIs into more generic "virt" APIs. > > > > This version is based on > > > > git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git hyperv-next > > > > in order to pickup the VTL changes that are queued for 6.18. I also > > squashed the NEED_RESCHED_LAZY fixes for root and VTL modes into a single > > patch, as it should be easy/straightforward to drop the VTL change as needed > > if we want this in 6.17 or earlier. > > > > That effectively means the full series is dependent on the VTL changes being > > fully merged for 6.18. But I think that's ok as it's really only the MSHV > > changes that have any urgency whatsoever, and I assume that Microsoft is > > the only user that truly cares about the MSHV root fix. I.e. if the whole > > thing gets delayed, I think it's only the Hyper-V folks that are impacted. > > > > I have no preference what tree this goes through, or when, and can respin > > and/or split as needed. > > > > As with v1, the Hyper-V stuff and non-x86 architectures are compile-tested > > only. > > > > v2: > > - Rebase on hyperv-next. > > - Fix and converge the VTL code as well. [Peter, Nuno] > > > > v1: https://lore.kernel.org/all/20250825200622.3759571-1-seanjc@google.com > > > > I dropped the mshv_vtl changes in this series and applied the rest > (including the KVM changes) to hyperv-next. mshv_do_pre_guest_mode_work() ended up getting left behind since its removal was in the last mshv_vtl patch. $ git grep mshv_do_pre_guest_mode_work drivers/hv/mshv.h:int mshv_do_pre_guest_mode_work(ulong th_flags); drivers/hv/mshv_common.c:int mshv_do_pre_guest_mode_work(ulong th_flags) drivers/hv/mshv_common.c:EXPORT_SYMBOL_GPL(mshv_do_pre_guest_mode_work); Want to squash this into 3786d7d6b3c0 ("mshv: Use common "entry virt" APIs to do work in root before running guest")? --- drivers/hv/mshv.h | 2 -- drivers/hv/mshv_common.c | 22 ---------------------- 2 files changed, 24 deletions(-) diff --git a/drivers/hv/mshv.h b/drivers/hv/mshv.h index 0340a67acd0a..d4813df92b9c 100644 --- a/drivers/hv/mshv.h +++ b/drivers/hv/mshv.h @@ -25,6 +25,4 @@ int hv_call_set_vp_registers(u32 vp_index, u64 partition_id, u16 count, int hv_call_get_partition_property(u64 partition_id, u64 property_code, u64 *property_value); -int mshv_do_pre_guest_mode_work(ulong th_flags); - #endif /* _MSHV_H */ diff --git a/drivers/hv/mshv_common.c b/drivers/hv/mshv_common.c index eb3df3e296bb..aa2be51979fd 100644 --- a/drivers/hv/mshv_common.c +++ b/drivers/hv/mshv_common.c @@ -138,25 +138,3 @@ int hv_call_get_partition_property(u64 partition_id, return 0; } EXPORT_SYMBOL_GPL(hv_call_get_partition_property); - -/* - * Handle any pre-processing before going into the guest mode on this cpu, most - * notably call schedule(). Must be invoked with both preemption and - * interrupts enabled. - * - * Returns: 0 on success, -errno on error. - */ -int mshv_do_pre_guest_mode_work(ulong th_flags) -{ - if (th_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL)) - return -EINTR; - - if (th_flags & (_TIF_NEED_RESCHED | _TIF_NEED_RESCHED_LAZY)) - schedule(); - - if (th_flags & _TIF_NOTIFY_RESUME) - resume_user_mode_work(NULL); - - return 0; -} -EXPORT_SYMBOL_GPL(mshv_do_pre_guest_mode_work); base-commit: 3786d7d6b3c0a412ebe4439ba4a7d4b0e27d9a12 -- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2B2BACA1010 for ; Fri, 5 Sep 2025 07:13:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Message-ID: References:Mime-Version:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=d+q0Fpscrt/AgofM5IDOM6nF+z9OCx5YHpcAI07V82s=; b=tQl1op+ZFtwfjxCs9LenfnxB0e ZPSbYLoZFwzEuScpX4q40oWpTHPRPoBlugbMY4GVkjwpynEvohs89JDVsa7jmwLJyl4/YfIOvtv+c +MpdsJXItBnSE7Sc/jJy2jJkxuCPBtSgkVY6U5nv3EajMdFa3ujRtvrWfol4BDYffvfMu9GT/ysU8 Tx6mJHSlriYngt0mgJEnKIqEtg5aDrdiSTdsFs8J5dR6pS4KwLUCw8BB/b8IVtkSvFtJqakErCJbH PH/YcwHOnaV0qXtapJebXPJ2ob9F1h/xLXm7QkwEpC9c9CakrDCvaJrFKMHD1EM3Q3V+je2rLKuiM mGl+PCtw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uuQdl-0000000HW8n-363I; Fri, 05 Sep 2025 07:13:45 +0000 Received: from mail-pj1-x104a.google.com ([2607:f8b0:4864:20::104a]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uuPAo-0000000H3Ox-1ifU for linux-riscv@lists.infradead.org; Fri, 05 Sep 2025 05:39:48 +0000 Received: by mail-pj1-x104a.google.com with SMTP id 98e67ed59e1d1-32b698861d8so1810645a91.2 for ; Thu, 04 Sep 2025 22:39:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1757050785; x=1757655585; darn=lists.infradead.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=3udnh9xsllR+FkjIGPPOo5bX8r6scLid4vmBPD5wmTc=; b=zUWO50D3tiM87PviUcIZeXZHpRKLACZowq5urDeMUufJe8NTS2KuH/gppho7SKIqB7 /YDJ3u8WlYU1zM4jUFyGgoVfLQpLFb08dx52N5maIYS6IO9D9wbmbe+3GdUwX8FNZkzV pYeFDn1PCbPTllXIxPJp7TOlhXBXh7ImatvaQmAIvjSkC7uyQ3mWlVPQ3ztuwXv10cbR zckgjoyAK213NOjrtVVukE0PgNXdiViELF1ErH6ej+YJkkWOz7a+5IVQHAe4eSqlGfAi 7NRFLmJePAh6dTzGii8rnF//Kdn5f1ChyJzke/YMVQPkTQ356Gc7GcgmLLRBVNTkd2fn Ob/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757050785; x=1757655585; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3udnh9xsllR+FkjIGPPOo5bX8r6scLid4vmBPD5wmTc=; b=JmMj6QgoKafOZRdubDYSx5/Ny+xSAbPNVy54gSOUg6Qct0Ew5OwH3WJTzCMlPyBtvC +p0/eSH2BAIHUlDImDZE2DSnIFw/FEamMnOGtqWdWRzmt9D/o5eFmgD8Veo//qCesaHh MWfqfED+epJGA+BBjEAhGNQJUh5Qx4B4DD51O7PIupwqh5PbDtJe9+JWr3O092TkM/Nj VcvgAaJ5Mf9CyHuV8g2HoZSXoiL5YyNfqDXXHMdiyqrBM6Pw93ovv1RgZ4e3XqYbtM23 f/MX/VEhDm5TGD2nq/DPGWcFw8bbemS/zBMdNS02zx6j00iVZl3ty7W9AVo5nyXHvr31 +ScA== X-Forwarded-Encrypted: i=1; AJvYcCUWZTXmMMq+isNsBZQP383G5S8bkqBt+8OisFw0KC/dnJ4qGQvxmWd8JLf9rEYevmbV1pG1Sypq6ynlXQ==@lists.infradead.org X-Gm-Message-State: AOJu0YwYTfNsmVnPLBOHT1powtG+iKYdoeI3Q/lpyhwWY8PdCgUzOQ2R 3H5NSZOJSBjBcaM9sJBVbbWxkOPOjzg5cXgrIJwZSd0IjyqAHSQqzadZqLystUZoh5vmxmG9ucf L5Yj9lA== X-Google-Smtp-Source: AGHT+IEl3aDxdJxOeFOgsIqqYfLRUExl039yXm0dtHzzby5zYzVGU35ZbpW1dVjZIdU0C50mCLd9IUYMCJw= X-Received: from pjuw15.prod.google.com ([2002:a17:90a:d60f:b0:325:5e4e:4bd4]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:3809:b0:329:dff0:701b with SMTP id 98e67ed59e1d1-329dff070c6mr19066965a91.17.1757050784899; Thu, 04 Sep 2025 22:39:44 -0700 (PDT) Date: Thu, 4 Sep 2025 22:39:37 -0700 In-Reply-To: Mime-Version: 1.0 References: <20250828000156.23389-1-seanjc@google.com> Message-ID: Subject: Re: [PATCH v2 0/7] Drivers: hv: Fix NEED_RESCHED_LAZY and use common APIs From: Sean Christopherson To: Wei Liu Cc: Marc Zyngier , Oliver Upton , Catalin Marinas , Will Deacon , Tianrui Zhao , Bibo Mao , Huacai Chen , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Paolo Bonzini , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "K. Y. Srinivasan" , Haiyang Zhang , Dexuan Cui , Peter Zijlstra , Andy Lutomirski , "Paul E. McKenney" , Frederic Weisbecker , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Uladzislau Rezki , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvm@vger.kernel.org, loongarch@lists.linux.dev, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-hyperv@vger.kernel.org, rcu@vger.kernel.org, Nuno Das Neves , Mukesh R X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250904_223946_445013_E5CC452F X-CRM114-Status: GOOD ( 30.55 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Thu, Sep 04, 2025, Wei Liu wrote: > On Wed, Aug 27, 2025 at 05:01:49PM -0700, Sean Christopherson wrote: > > Fix a bug where MSHV root partitions (and upper-level VTL code) don't honor > > NEED_RESCHED_LAZY, and then deduplicate the TIF related MSHV code by turning > > the "kvm" entry APIs into more generic "virt" APIs. > > > > This version is based on > > > > git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git hyperv-next > > > > in order to pickup the VTL changes that are queued for 6.18. I also > > squashed the NEED_RESCHED_LAZY fixes for root and VTL modes into a single > > patch, as it should be easy/straightforward to drop the VTL change as needed > > if we want this in 6.17 or earlier. > > > > That effectively means the full series is dependent on the VTL changes being > > fully merged for 6.18. But I think that's ok as it's really only the MSHV > > changes that have any urgency whatsoever, and I assume that Microsoft is > > the only user that truly cares about the MSHV root fix. I.e. if the whole > > thing gets delayed, I think it's only the Hyper-V folks that are impacted. > > > > I have no preference what tree this goes through, or when, and can respin > > and/or split as needed. > > > > As with v1, the Hyper-V stuff and non-x86 architectures are compile-tested > > only. > > > > v2: > > - Rebase on hyperv-next. > > - Fix and converge the VTL code as well. [Peter, Nuno] > > > > v1: https://lore.kernel.org/all/20250825200622.3759571-1-seanjc@google.com > > > > I dropped the mshv_vtl changes in this series and applied the rest > (including the KVM changes) to hyperv-next. mshv_do_pre_guest_mode_work() ended up getting left behind since its removal was in the last mshv_vtl patch. $ git grep mshv_do_pre_guest_mode_work drivers/hv/mshv.h:int mshv_do_pre_guest_mode_work(ulong th_flags); drivers/hv/mshv_common.c:int mshv_do_pre_guest_mode_work(ulong th_flags) drivers/hv/mshv_common.c:EXPORT_SYMBOL_GPL(mshv_do_pre_guest_mode_work); Want to squash this into 3786d7d6b3c0 ("mshv: Use common "entry virt" APIs to do work in root before running guest")? --- drivers/hv/mshv.h | 2 -- drivers/hv/mshv_common.c | 22 ---------------------- 2 files changed, 24 deletions(-) diff --git a/drivers/hv/mshv.h b/drivers/hv/mshv.h index 0340a67acd0a..d4813df92b9c 100644 --- a/drivers/hv/mshv.h +++ b/drivers/hv/mshv.h @@ -25,6 +25,4 @@ int hv_call_set_vp_registers(u32 vp_index, u64 partition_id, u16 count, int hv_call_get_partition_property(u64 partition_id, u64 property_code, u64 *property_value); -int mshv_do_pre_guest_mode_work(ulong th_flags); - #endif /* _MSHV_H */ diff --git a/drivers/hv/mshv_common.c b/drivers/hv/mshv_common.c index eb3df3e296bb..aa2be51979fd 100644 --- a/drivers/hv/mshv_common.c +++ b/drivers/hv/mshv_common.c @@ -138,25 +138,3 @@ int hv_call_get_partition_property(u64 partition_id, return 0; } EXPORT_SYMBOL_GPL(hv_call_get_partition_property); - -/* - * Handle any pre-processing before going into the guest mode on this cpu, most - * notably call schedule(). Must be invoked with both preemption and - * interrupts enabled. - * - * Returns: 0 on success, -errno on error. - */ -int mshv_do_pre_guest_mode_work(ulong th_flags) -{ - if (th_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL)) - return -EINTR; - - if (th_flags & (_TIF_NEED_RESCHED | _TIF_NEED_RESCHED_LAZY)) - schedule(); - - if (th_flags & _TIF_NOTIFY_RESUME) - resume_user_mode_work(NULL); - - return 0; -} -EXPORT_SYMBOL_GPL(mshv_do_pre_guest_mode_work); base-commit: 3786d7d6b3c0a412ebe4439ba4a7d4b0e27d9a12 -- _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv