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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3B0BC19F2D for ; Tue, 9 Aug 2022 14:07:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243275AbiHIOHl (ORCPT ); Tue, 9 Aug 2022 10:07:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238333AbiHIOHi (ORCPT ); Tue, 9 Aug 2022 10:07:38 -0400 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E905112AC0 for ; Tue, 9 Aug 2022 07:07:35 -0700 (PDT) Received: by mail-pj1-x102c.google.com with SMTP id t2-20020a17090a4e4200b001f21572f3a4so12342765pjl.0 for ; Tue, 09 Aug 2022 07:07:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc; bh=NnEsu78UdgWUFfbUzx2FaqG+fLzRYJgztuHCMcvogJA=; b=oDtJsLEQQYL30wcvIv5F3ooBK0Zf/9c8h4+kW5/jz5Nl67dgnb73eDU7C8tmnt4nYY cCMyJmMxEiHiWPNM5WQB2io2rxq9bgmB+TaseJV90fL2r3xfh5kJ6m5B6y7/BiuHZEc2 xde5cBI2o6E657tDSS6U8BOe2jW6sBWiX9XXvh65MlJJUS7AaWOV4KvFfxIIfmZCuNwc oOoe0EJLXJhc0M3MGpwUWJQ1cAhegx+jjeoZ433VUWG15wBgZfP+Bpz4F5TPaAVFcv1G xIwBkATQVJVHWkK6kqQjZYTL5Jpf+PTD6HmUUJaV9clHvHt2RUqA3nIziuDGmoL3H5PH aSCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=NnEsu78UdgWUFfbUzx2FaqG+fLzRYJgztuHCMcvogJA=; b=EGJ1LAMdqUVUdKUJn+5273YRu1Y45X2SiPq9TswVe3ps52NmGOFvTxXd2snrCUx5U+ OzvIziqMLY6RF7WPVvoH1IZnCqLH/XiNB4SV1s4zgL4rTB22R19LrVpDzlarfS1LNjEN Gl5yCNd06nXoFP6MDTWNYq+fExYJmRJdiaQjsFdp3HOC9dC2Z0UeCxhAja9yWmqXtADX lhXys/0Zcpsa97q0pjSdbJKNJxVwrfBoHQZAAivxSp+xL9WdYICY9Bx9u8sXWVdobQqf 8fIK/VPRc/fwzFYiDZco20pgAWNFzHgCncv5HDROGPKRnwFNVwE7lub+x1TPXJVTHeyY QJ/w== X-Gm-Message-State: ACgBeo2XftrYoKMsMJYwLt+xKVC9VESkdhi908SFox0bz6cqUv8KFSj/ PeS6OJ3IGtqgrxvwCihQvIFdcA== X-Google-Smtp-Source: AA6agR4aiTL+Daci9AK1TqyyNVqT0wIL4ZZnOZ8/yvhfKaMJTNse+c98EGQik7SdrsdREq1iYR++YQ== X-Received: by 2002:a17:902:b903:b0:170:9964:b47b with SMTP id bf3-20020a170902b90300b001709964b47bmr12764209plb.83.1660054055288; Tue, 09 Aug 2022 07:07:35 -0700 (PDT) Received: from google.com (7.104.168.34.bc.googleusercontent.com. [34.168.104.7]) by smtp.gmail.com with ESMTPSA id c14-20020a170902d48e00b0017086b082c1sm8154199plg.173.2022.08.09.07.07.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Aug 2022 07:07:34 -0700 (PDT) Date: Tue, 9 Aug 2022 14:07:30 +0000 From: Sean Christopherson To: David Woodhouse Cc: Paolo Bonzini , Coleman Dietsch , kvm@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H . Peter Anvin" , linux-kernel@vger.kernel.org, skhan@linuxfoundation.org, Pavel Skripkin , linux-kernel-mentees@lists.linuxfoundation.org, stable@vger.kernel.org, syzbot+e54f930ed78eb0f85281@syzkaller.appspotmail.com Subject: Re: [PATCH v3 2/2] KVM: x86/xen: Stop Xen timer before changing IRQ Message-ID: References: <20220808190607.323899-2-dietschc@csp.edu> <20220808190607.323899-3-dietschc@csp.edu> <43e258cc-71ac-bde4-d1f8-9eb9519928d3@redhat.com> <4fc1371b83001b4eed1617c37bec6b9d007e45c2.camel@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4fc1371b83001b4eed1617c37bec6b9d007e45c2.camel@infradead.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 09, 2022, David Woodhouse wrote: > On Tue, 2022-08-09 at 14:59 +0200, Paolo Bonzini wrote: > > On 8/9/22 11:22, David Woodhouse wrote: > > > On Mon, 2022-08-08 at 14:06 -0500, Coleman Dietsch wrote: > > > > Stop Xen timer (if it's running) prior to changing the IRQ vector and > > > > potentially (re)starting the timer. Changing the IRQ vector while the > > > > timer is still running can result in KVM injecting a garbage event, e.g. > > > > vm_xen_inject_timer_irqs() could see a non-zero xen.timer_pending from > > > > a previous timer but inject the new xen.timer_virq. > > > > > > Hm, wasn't that already addressed in the first patch I saw, which just > > > called kvm_xen_stop_timer() unconditionally before (possibly) setting > > > it up again? > > > > Which patch is that? > > The one I acked in > https://lore.kernel.org/all/9bad724858b6a06c25ead865b2b3d9dfc216d01c.camel@infradead.org/ It's effectively the same patch. I had asked Coleman to split it into two separate patches: (1) fix the re-initialization of an active timer bug and (2) stop the active timer before changing the vector (this patch).