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 smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.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 5457FC25B07 for ; Tue, 9 Aug 2022 14:07:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id A6A68409EC; Tue, 9 Aug 2022 14:07:40 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org A6A68409EC Authentication-Results: smtp2.osuosl.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20210112 header.b=oDtJsLEQ X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cVjyxbS-25MK; Tue, 9 Aug 2022 14:07:38 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp2.osuosl.org (Postfix) with ESMTPS id 391B54091A; Tue, 9 Aug 2022 14:07:38 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 391B54091A Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 0D51DC0033; Tue, 9 Aug 2022 14:07:38 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 1D813C002D for ; Tue, 9 Aug 2022 14:07:37 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id EC31C605D8 for ; Tue, 9 Aug 2022 14:07:36 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org EC31C605D8 Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20210112 header.b=oDtJsLEQ X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5bfTYYoNteu5 for ; Tue, 9 Aug 2022 14:07:36 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 0C4DC605A6 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by smtp3.osuosl.org (Postfix) with ESMTPS id 0C4DC605A6 for ; Tue, 9 Aug 2022 14:07:35 +0000 (UTC) Received: by mail-pl1-x62c.google.com with SMTP id w14so11422569plp.9 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=xVGhC66w0/jzPQsbwEyiY9FOFlusKa3tBXYHQe1d1Y5magk98Xp38Syqp7OiClj0d7 BTPI3gtPPlxfLkWvGNo9aRzJmPjfS7SijVtHtfFJ8n7Y+ej7wYG5tuJSm+ZSe6lbh1gD W0EqdlWeR+hwjkWs4bDLKeSApXDesvwe/g3z6qdcIP+uxTdCT+y07Y4SpkiLTN2qXNKi BmGCsdRcO6qrzwJeypfKVQTZKAzTDzIv6Vrb+xYKZXSykebzPjkuyDHvtBFVFa86lPke egCM+xUUk/+t32R0nGXO7cWD50lW6i3OCuydFGnh5DYl8nqPLf+Kfbluil3XV5Bd+uiO vB+Q== X-Gm-Message-State: ACgBeo00wzGeT5BQLNC1uHMjd9HIlC8FBD03nwuOTtc4xqalR+Mf/vuy 0LB+rxWxE35wUO5jaCP4moR9Wg== 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 To: David Woodhouse 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-Disposition: inline In-Reply-To: <4fc1371b83001b4eed1617c37bec6b9d007e45c2.camel@infradead.org> Cc: x86@kernel.org, kvm@vger.kernel.org, Pavel Skripkin , Dave Hansen , linux-kernel@vger.kernel.org, stable@vger.kernel.org, syzbot+e54f930ed78eb0f85281@syzkaller.appspotmail.com, Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , Paolo Bonzini , Thomas Gleixner , linux-kernel-mentees@lists.linuxfoundation.org X-BeenThere: linux-kernel-mentees@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sean Christopherson via Linux-kernel-mentees Reply-To: Sean Christopherson Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-kernel-mentees-bounces@lists.linuxfoundation.org Sender: "Linux-kernel-mentees" 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). _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees 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 21609C19F2D for ; Tue, 9 Aug 2022 14:07:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235991AbiHIOHi (ORCPT ); Tue, 9 Aug 2022 10:07:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234672AbiHIOHh (ORCPT ); Tue, 9 Aug 2022 10:07:37 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF2B412AA0 for ; Tue, 9 Aug 2022 07:07:35 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id x10so11449925plb.3 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=tj8bw/jUSuL4CmvmURZVhP7/gKCBm+NtYhbTQAL0KjqjCxogJFgND8xt/FzOZ7nWk6 JBEtamFOTswWJnlTSfuOaw5VroWdRJ+5YJKxJYY6KqcvmX5DTar7q2Ui4EYUtzf5F88d yLv9wu2f3a5Xk5yiOesSdjzOH3X6ub45miJQtwAB3aQ8LWUE7xXlKNw3UtHjMI9m4c02 73LWM3JSGWNkAE1z3qSx01NsW9iRDd6eRGR7G1xnPq+Dvn49j0KeWDkFqURjBQemA2RP wa6hu0iyuzJ8xfTbgMMaRDdPMN4JV9LB5HOY+cAx+o15EvKw+2rlh+F8d1ggRmsVGkj0 wGGQ== X-Gm-Message-State: ACgBeo2U5vyzAJ0Drbfy+V4eWnc5VNjJA/Gpe87B/nlSmJ1AahAgztIi lKsghqywwYKOeaVlOaYKvLZmmQ== 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: stable@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).