Message ID | 20231004174628.2073263-1-paul@xen.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp301695vqb; Wed, 4 Oct 2023 10:46:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH4hvPtesGG5EDGt6UlYROOknv1Fwj73AuK4goevGXRMUooSWi/HgLfch1bJ5CCMbZSg9K6 X-Received: by 2002:a17:90b:4f8c:b0:26f:f272:144c with SMTP id qe12-20020a17090b4f8c00b0026ff272144cmr2592748pjb.27.1696441610352; Wed, 04 Oct 2023 10:46:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696441610; cv=none; d=google.com; s=arc-20160816; b=QlFCiaHgJrrpK/hyBODwDnNTRtM6/UyyFwfvXm1Aw5icA2LAlQ9my5vkQX+WulDxSM vMTWJ5Zih5yXgAaXfaqRn934BBNbNvF0GGL4CCFSllmaXpbQpPbI2lJK4PhYpbZ1b0nY Cl3kfFYbzTQWek5262Xp1W1dB9uSYMkWHJx2JdxQU/BgS/EU7+GUhDByvuxjxcPQnw+O jOQSOZ2QgyrGRT9lBIkGmZ6TIzG18lV33/3qQUIblyzpmSH1hQYSSrM2uG25eLBFyvg6 n0wwTSCi47vl4NFyOku1GLa/XvsFof9Mw2jYi4w7JLTDQAW7O6k6ltzUZhyIk+fWf84t fWqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=9gqPmyTqMnaI5p/Yo2lWX8v6irfTkiQJyeLI3Y/+zIE=; fh=8AvbwpPKF0Qe5WwS5eyABOVDUChKGxIrkPaOnjrOqKo=; b=S3R+0A7GTn14jZb5EfIzmbmuVA8ooiB3AtlngFNjJcTWvMfdw1MW9n0NZ3nXTLRnI1 MaZXHw0Yvllld+XnJnlZkj6BEvc11izlpLF2/lB7v/l1Gob5pajzM3kU0HEL43nldFlX GiEa+iLlctpG58xAUkuel0mKLBKodvp9FUEInNgSdz5XNEOkKZJQHa3QC8pngd4sjPKw ii01CIo2/vS3eISvX5GtDC9jzEeZihNv32iK4WCYj4/q0+b2lXP9vtXpkNCtD5OP4z/u fCa4JmV0tzqy4ZH62pvVtqfO8/pz+W4okWfWds2EapYpRJKo8od91xY7yMVGbDDS09kH BNPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xen.org header.s=20200302mail header.b=THUEtcun; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id f8-20020a17090a120800b00278f819d43asi1867408pja.109.2023.10.04.10.46.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 10:46:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@xen.org header.s=20200302mail header.b=THUEtcun; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 824E583743A2; Wed, 4 Oct 2023 10:46:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243433AbjJDRqp (ORCPT <rfc822;ezelljr.billy@gmail.com> + 19 others); Wed, 4 Oct 2023 13:46:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233497AbjJDRqo (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 4 Oct 2023 13:46:44 -0400 Received: from mail.xenproject.org (mail.xenproject.org [104.130.215.37]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 889BF9E; Wed, 4 Oct 2023 10:46:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date: Subject:Cc:To:From; bh=9gqPmyTqMnaI5p/Yo2lWX8v6irfTkiQJyeLI3Y/+zIE=; b=THUEtc unQCDvOdaaGMv//tZS+KnFKrjVgqVmY1Oz4phjWFwdFVFTpf8/tgOSvx7ptevmVImLFQv6sMrm5+l gx/dQCoi+DH2YtY2UJQK54HKlLwcwKTOa9ZiDNfX5WiksD2v6bdmeuKtfwrCnGAlUAPqDLNbP+pB2 Gvs2CZjh53Y=; Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from <paul@xen.org>) id 1qo5xA-0001tA-NQ; Wed, 04 Oct 2023 17:46:32 +0000 Received: from ec2-63-33-11-17.eu-west-1.compute.amazonaws.com ([63.33.11.17] helo=REM-PW02S00X.ant.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <paul@xen.org>) id 1qo5xA-0003xm-CC; Wed, 04 Oct 2023 17:46:32 +0000 From: Paul Durrant <paul@xen.org> To: kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Paul Durrant <pdurrant@amazon.com>, David Woodhouse <dwmw@amazon.co.uk>, David Woodhouse <dwmw2@infradead.org>, Sean Christopherson <seanjc@google.com>, Paolo Bonzini <pbonzini@redhat.com>, Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>, "H. Peter Anvin" <hpa@zytor.com>, x86@kernel.org Subject: [PATCH v2] KVM: x86/xen: ignore the VCPU_SSHOTTMR_future flag Date: Wed, 4 Oct 2023 17:46:28 +0000 Message-Id: <20231004174628.2073263-1-paul@xen.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 10:46:49 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778847958216965057 X-GMAIL-MSGID: 1778847958216965057 |
Series |
[v2] KVM: x86/xen: ignore the VCPU_SSHOTTMR_future flag
|
|
Commit Message
Paul Durrant
Oct. 4, 2023, 5:46 p.m. UTC
From: Paul Durrant <pdurrant@amazon.com> Upstream Xen now ignores this flag [1], since the only guest kernel ever to use it was buggy. By ignoring the flag the guest will always get a callback if it sets a negative timeout which upstream Xen has determined not to cause problems for any guest setting the flag. [1] https://xenbits.xen.org/gitweb/?p=xen.git;a=commitdiff;h=19c6cbd909 Signed-off-by: Paul Durrant <pdurrant@amazon.com> Reviewed-by: David Woodhouse <dwmw@amazon.co.uk> --- Cc: David Woodhouse <dwmw2@infradead.org> Cc: Sean Christopherson <seanjc@google.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Cc: Borislav Petkov <bp@alien8.de> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: x86@kernel.org v2: - Amend the patch subject line --- arch/x86/kvm/xen.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
Comments
On Wed, Oct 04, 2023, Paul Durrant wrote: > From: Paul Durrant <pdurrant@amazon.com> > > Upstream Xen now ignores this flag [1], since the only guest kernel ever to > use it was buggy. By ignoring the flag the guest will always get a callback > if it sets a negative timeout which upstream Xen has determined not to > cause problems for any guest setting the flag. > > [1] https://xenbits.xen.org/gitweb/?p=xen.git;a=commitdiff;h=19c6cbd909 > > Signed-off-by: Paul Durrant <pdurrant@amazon.com> > Reviewed-by: David Woodhouse <dwmw@amazon.co.uk> > --- > Cc: David Woodhouse <dwmw2@infradead.org> > Cc: Sean Christopherson <seanjc@google.com> > Cc: Paolo Bonzini <pbonzini@redhat.com> > Cc: Thomas Gleixner <tglx@linutronix.de> > Cc: Ingo Molnar <mingo@redhat.com> > Cc: Borislav Petkov <bp@alien8.de> > Cc: Dave Hansen <dave.hansen@linux.intel.com> > Cc: "H. Peter Anvin" <hpa@zytor.com> > Cc: x86@kernel.org If you're going to manually Cc folks, put the Cc's in the changelog proper so that there's a record of who was Cc'd on the patch. Or even better, just use scripts/get_maintainers.pl and only manually Cc people when necessary.
On Wed, 04 Oct 2023 17:46:28 +0000, Paul Durrant wrote: > Upstream Xen now ignores this flag [1], since the only guest kernel ever to > use it was buggy. By ignoring the flag the guest will always get a callback > if it sets a negative timeout which upstream Xen has determined not to > cause problems for any guest setting the flag. > > [1] https://xenbits.xen.org/gitweb/?p=xen.git;a=commitdiff;h=19c6cbd909 > > [...] Applied to kvm-x86 xen, thanks! [1/1] KVM: x86/xen: ignore the VCPU_SSHOTTMR_future flag https://github.com/kvm-x86/linux/commit/409f2e92a27a -- https://github.com/kvm-x86/linux/tree/next
On 04/10/2023 19:30, Sean Christopherson wrote: > On Wed, Oct 04, 2023, Paul Durrant wrote: >> From: Paul Durrant <pdurrant@amazon.com> >> >> Upstream Xen now ignores this flag [1], since the only guest kernel ever to >> use it was buggy. By ignoring the flag the guest will always get a callback >> if it sets a negative timeout which upstream Xen has determined not to >> cause problems for any guest setting the flag. >> >> [1] https://xenbits.xen.org/gitweb/?p=xen.git;a=commitdiff;h=19c6cbd909 >> >> Signed-off-by: Paul Durrant <pdurrant@amazon.com> >> Reviewed-by: David Woodhouse <dwmw@amazon.co.uk> >> --- >> Cc: David Woodhouse <dwmw2@infradead.org> >> Cc: Sean Christopherson <seanjc@google.com> >> Cc: Paolo Bonzini <pbonzini@redhat.com> >> Cc: Thomas Gleixner <tglx@linutronix.de> >> Cc: Ingo Molnar <mingo@redhat.com> >> Cc: Borislav Petkov <bp@alien8.de> >> Cc: Dave Hansen <dave.hansen@linux.intel.com> >> Cc: "H. Peter Anvin" <hpa@zytor.com> >> Cc: x86@kernel.org > > If you're going to manually Cc folks, put the Cc's in the changelog proper so that > there's a record of who was Cc'd on the patch. > FTR, the basic list was generated: ./scripts/get_maintainer.pl --no-rolestats 0001-KVM-xen-ignore-the-VCPU_SSHOTTMR_future-flag.patch | while read line; do echo Cc: $line; done and then lightly hacked put x86 at the end and remove my own name... so not really manual. Also not entirely sure why you'd want the Cc list making it into the actual commit. > Or even better, just use scripts/get_maintainers.pl and only manually Cc people > when necessary. I guess this must be some other way of using get_maintainers.pl that you are expecting?
On Thu, Oct 05, 2023, Paul Durrant wrote: > On 04/10/2023 19:30, Sean Christopherson wrote: > > On Wed, Oct 04, 2023, Paul Durrant wrote: > > > --- > > > Cc: David Woodhouse <dwmw2@infradead.org> > > > Cc: Sean Christopherson <seanjc@google.com> > > > Cc: Paolo Bonzini <pbonzini@redhat.com> > > > Cc: Thomas Gleixner <tglx@linutronix.de> > > > Cc: Ingo Molnar <mingo@redhat.com> > > > Cc: Borislav Petkov <bp@alien8.de> > > > Cc: Dave Hansen <dave.hansen@linux.intel.com> > > > Cc: "H. Peter Anvin" <hpa@zytor.com> > > > Cc: x86@kernel.org > > > > If you're going to manually Cc folks, put the Cc's in the changelog proper so that > > there's a record of who was Cc'd on the patch. > > > > FTR, the basic list was generated: > > ./scripts/get_maintainer.pl --no-rolestats > 0001-KVM-xen-ignore-the-VCPU_SSHOTTMR_future-flag.patch | while read line; > do echo Cc: $line; done > > and then lightly hacked put x86 at the end and remove my own name... so not > really manual. > Also not entirely sure why you'd want the Cc list making it into the actual > commit. It's useful for Cc's that *don't* come from get_maintainers, as it provides a record in the commit of who was Cc'd on a patch. E.g. if someone encounters an issue with a commit, the Cc records provide additional contacts that might be able to help sort things out. Or if a maintainer further up the stream has questions or concerns about a pull request, they can use the Cc list to grab the right audience for a discussion, or be more confident in merging the request because the maintainer knows that the "right" people at least saw the patch. Lore links provide much of that functionality, but following a link is almost always slower, and some maintainers are allergic to web browsers :-) > > Or even better, just use scripts/get_maintainers.pl and only manually Cc people > > when necessary. > > I guess this must be some other way of using get_maintainers.pl that you are > expecting? Ah, I was just assuming that you were handcoding the Cc "list", but it sounds like you're piping the results into each patch. That's fine, just a bit noisy and uncommon. FWIW, my scripts gather the To/Cc for all patches in a series, and then use the results for the entire series, e.g. git send-email --confirm=always --suppress-cc=all $to $bcc $cc ... That way everyone that gets sent mail gets all patches in a series. Most contributors, myself included, don't like to receive bits and pieces of a series, e.g. it makes doing quick triage/reviews annoying, especially if the patches I didn't receive weren't sent to any of the mailing list to which I'm subscribed.
On 06/10/2023 02:48, Sean Christopherson wrote: > On Thu, Oct 05, 2023, Paul Durrant wrote: >> On 04/10/2023 19:30, Sean Christopherson wrote: >>> On Wed, Oct 04, 2023, Paul Durrant wrote: >>>> --- >>>> Cc: David Woodhouse <dwmw2@infradead.org> >>>> Cc: Sean Christopherson <seanjc@google.com> >>>> Cc: Paolo Bonzini <pbonzini@redhat.com> >>>> Cc: Thomas Gleixner <tglx@linutronix.de> >>>> Cc: Ingo Molnar <mingo@redhat.com> >>>> Cc: Borislav Petkov <bp@alien8.de> >>>> Cc: Dave Hansen <dave.hansen@linux.intel.com> >>>> Cc: "H. Peter Anvin" <hpa@zytor.com> >>>> Cc: x86@kernel.org >>> >>> If you're going to manually Cc folks, put the Cc's in the changelog proper so that >>> there's a record of who was Cc'd on the patch. >>> >> >> FTR, the basic list was generated: >> >> ./scripts/get_maintainer.pl --no-rolestats >> 0001-KVM-xen-ignore-the-VCPU_SSHOTTMR_future-flag.patch | while read line; >> do echo Cc: $line; done >> >> and then lightly hacked put x86 at the end and remove my own name... so not >> really manual. >> Also not entirely sure why you'd want the Cc list making it into the actual >> commit. > > It's useful for Cc's that *don't* come from get_maintainers, as it provides a > record in the commit of who was Cc'd on a patch. > > E.g. if someone encounters an issue with a commit, the Cc records provide additional > contacts that might be able to help sort things out. > > Or if a maintainer further up the stream has questions or concerns about a pull > request, they can use the Cc list to grab the right audience for a discussion, > or be more confident in merging the request because the maintainer knows that the > "right" people at least saw the patch. > > Lore links provide much of that functionality, but following a link is almost > always slower, and some maintainers are allergic to web browsers :-) > Ok... makes sense. >>> Or even better, just use scripts/get_maintainers.pl and only manually Cc people >>> when necessary. >> >> I guess this must be some other way of using get_maintainers.pl that you are >> expecting? > > Ah, I was just assuming that you were handcoding the Cc "list", but it sounds > like you're piping the results into each patch. That's fine, just a bit noisy > and uncommon. > > FWIW, my scripts gather the To/Cc for all patches in a series, and then use the > results for the entire series, e.g. > > git send-email --confirm=always --suppress-cc=all $to $bcc $cc ... > > That way everyone that gets sent mail gets all patches in a series. Most > contributors, myself included, don't like to receive bits and pieces of a series, > e.g. it makes doing quick triage/reviews annoying, especially if the patches I > didn't receive weren't sent to any of the mailing list to which I'm subscribed. Ok, I'll send stuff that way in future. Thanks, Paul
diff --git a/arch/x86/kvm/xen.c b/arch/x86/kvm/xen.c index 40edf4d1974c..8f1d46df0f3b 100644 --- a/arch/x86/kvm/xen.c +++ b/arch/x86/kvm/xen.c @@ -1374,12 +1374,8 @@ static bool kvm_xen_hcall_vcpu_op(struct kvm_vcpu *vcpu, bool longmode, int cmd, return true; } + /* A delta <= 0 results in an immediate callback, which is what we want */ delta = oneshot.timeout_abs_ns - get_kvmclock_ns(vcpu->kvm); - if ((oneshot.flags & VCPU_SSHOTTMR_future) && delta < 0) { - *r = -ETIME; - return true; - } - kvm_xen_start_timer(vcpu, oneshot.timeout_abs_ns, delta); *r = 0; return true;