Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2639132rdg; Mon, 16 Oct 2023 10:07:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGBYJuwVzz6zpSHcJ7vgxvZNxPT3+gSsIu7FVcDZ+FkOxA8B+Pdcu6reYXdkafDHq171RnQ X-Received: by 2002:a05:6358:3a0e:b0:13a:d269:bd22 with SMTP id g14-20020a0563583a0e00b0013ad269bd22mr65101rwe.25.1697476034029; Mon, 16 Oct 2023 10:07:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697476033; cv=none; d=google.com; s=arc-20160816; b=p69Apo7vrEj1H1LaWfHCN+tGroWacIRhlplH10xETG4dNbPNL8kwEGGJboVLuQnbcb tGIttQF6d4LL1moBwbQixyf3EXliJXN5rx9gFKwnN1JKJeRU3tPbBWd0UWqH4OaJd4ln sV9wtsa4tY0g/8P72mZkUNiOKIZe6VLYpTTUV02l2F7l8GJr9Ajxa9wW/ODt0hb8rTIK vRXwVH+yhTpu13Pbz3cJ5IgLH44CMfVUSDOio9R4VPdPfnzVS7bNHx7H4+qpkmrNeivm TvFwl5E7KC9ce1iVLeeoJoGooHXOJnCuhi+j4zDarPckAxQrsPq7nIFTpPi6A+qqnrhV WlfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:references:cc:to:from:subject :message-id:date:content-transfer-encoding:mime-version :dkim-signature; bh=W+ZgtLRLZp9tFB/6xJaTS6rzYwR2W/IqBEpak7Hkkp4=; fh=IQcLAD+V2BlZJXKIIrxONhS/4o96TEVuA68x2uqKfgc=; b=rXWK7mSL95VaeO8kKMyY5NDwChJ0rTV8W/C4fYNkwdYHJOjYkHBwKfiejqltgeTS8Q gw+UTBY+6m/kx92dSFolLMgy6E+tAMsVNaBoSX6VbrlWvrak+H+9xmDN2dkgZjx/TG77 6z9qh99UDbT/aOcmDhKrjXKXY4qZ7PUAqx4k0eQla9Xqd++zw5A6dK+Mxiw36+JzAt9g SMBmwKaAVHQi4IlTT15PRtybfwcZ94OgpEEYUxm+OzzX8fyTgUgOmIINoCXBvlQCljF6 pDy/AcsY9o1/WYI80C/35F82RWVkiMVh/4+bOI9I2DW1fLHQktLwh2e7GryTCW/vi+C/ v2Eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=eyNmY55G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id d12-20020a056a00198c00b006901a8f5dadsi205347pfl.289.2023.10.16.10.07.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 10:07:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=eyNmY55G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 34CE8806AFD0; Mon, 16 Oct 2023 10:07:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343489AbjJPRGn (ORCPT + 99 others); Mon, 16 Oct 2023 13:06:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234226AbjJPRGS (ORCPT ); Mon, 16 Oct 2023 13:06:18 -0400 Received: from smtp-fw-52002.amazon.com (smtp-fw-52002.amazon.com [52.119.213.150]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBF03D60; Mon, 16 Oct 2023 10:04:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1697475868; x=1729011868; h=mime-version:content-transfer-encoding:date:message-id: subject:from:to:cc:references:in-reply-to; bh=W+ZgtLRLZp9tFB/6xJaTS6rzYwR2W/IqBEpak7Hkkp4=; b=eyNmY55GlUS1HpBJhkXa/KYeqMfx54pJ18er+V9CN+kO2VD6YZ7DyRrz CnjWXrWQohq1EUrZ0ALfH98tJIKG3io9ztZP+SPqaDBdsh7OLm12YQy3/ qkzG8PYB6174W87uv0NzL99jAzamlw+aPXgwqATuuBGVuTS/6CVXp0zo1 Q=; X-IronPort-AV: E=Sophos;i="6.03,229,1694736000"; d="scan'208";a="589284223" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-pdx-2a-m6i4x-8a14c045.us-west-2.amazon.com) ([10.43.8.6]) by smtp-border-fw-52002.iad7.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Oct 2023 17:04:25 +0000 Received: from smtpout.prod.us-east-1.prod.farcaster.email.amazon.dev (pdx2-ws-svc-p26-lb5-vlan3.pdx.amazon.com [10.39.38.70]) by email-inbound-relay-pdx-2a-m6i4x-8a14c045.us-west-2.amazon.com (Postfix) with ESMTPS id DB7E287A20; Mon, 16 Oct 2023 17:04:23 +0000 (UTC) Received: from EX19MTAEUA001.ant.amazon.com [10.0.10.100:37033] by smtpin.naws.eu-west-1.prod.farcaster.email.amazon.dev [10.0.2.76:2525] with esmtp (Farcaster) id aa7b6734-43cd-490b-9074-3d36053d0fd1; Mon, 16 Oct 2023 17:04:22 +0000 (UTC) X-Farcaster-Flow-ID: aa7b6734-43cd-490b-9074-3d36053d0fd1 Received: from EX19D004EUC001.ant.amazon.com (10.252.51.190) by EX19MTAEUA001.ant.amazon.com (10.252.50.50) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.37; Mon, 16 Oct 2023 17:04:22 +0000 Received: from localhost (10.13.235.138) by EX19D004EUC001.ant.amazon.com (10.252.51.190) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.37; Mon, 16 Oct 2023 17:04:18 +0000 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" Date: Mon, 16 Oct 2023 17:04:15 +0000 Message-ID: Subject: Re: [PATCH] KVM: x86: hyper-v: Don't auto-enable stimer during deserialization From: Nicolas Saenz Julienne To: Sean Christopherson CC: Vitaly Kuznetsov , , , , , , , , , , , X-Mailer: aerc 0.15.2-182-g389d89a9362e-dirty References: <20231016095217.37574-1-nsaenz@amazon.com> <87sf6a9335.fsf@redhat.com> In-Reply-To: X-Originating-IP: [10.13.235.138] X-ClientProxiedBy: EX19D042UWA004.ant.amazon.com (10.13.139.16) To EX19D004EUC001.ant.amazon.com (10.252.51.190) X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 16 Oct 2023 10:07:11 -0700 (PDT) Hi Sean, On Mon Oct 16, 2023 at 4:27 PM UTC, Sean Christopherson wrote: > I'd prefer the shortlog be more explicit about the write coming from user= space, e.g. > > KVM: x86: hyper-v: Don't auto-enable stimer on write from userspace > > A non-zero number of KVM's "deserialization" ioctls are used to stuff sta= te > without a paired "serialization". I doubt anyone is doing that with the = Hyper-V > ioctls, but keeping things consistent is helpful for readers. > > On Mon, Oct 16, 2023, Nicolas Saenz Julienne wrote: > > Hi Vitaly, > > > > On Mon Oct 16, 2023 at 12:14 PM UTC, Vitaly Kuznetsov wrote: > > > Nicolas Saenz Julienne writes: > > > > > > > By not honoring the 'stimer->config.enable' state during stimer > > > > deserialization we might introduce spurious timer interrupts. For > > Avoid pronouns please. > > > > > example through the following events: > > > > - The stimer is configured in auto-enable mode. > > > > - The stimer's count is set and the timer enabled. > > > > - The stimer expires, an interrupt is injected. > > > > - We live migrate the VM. > > Same here. "We" is already ambiguous, because the first usage is largely= about > KVM, and the second usage here is much more about userspace and/or the ac= tual > user. > > > > > - The stimer config and count are deserialized, auto-enable is ON,= the > > > > stimer is re-enabled. > > > > - The stimer expires right away, and injects an unwarranted interr= upt. > > > > > > > > So let's not change the stimer's enable state if the MSR write come= s > > > > from user-space. > > Don't hedge, firmly state what the patch does and why the change is neces= sary > and correct. If it turns out the change is wrong, then the follow-up pat= ch can > explain the situation. But in the happy case where the change is correct= , using > language that isn't assertive can result in > > > > > Fixes: 1f4b34f825e8 ("kvm/x86: Hyper-V SynIC timers") > > Does this need a? > > Cc: stable@vger.kernel Your reply raced with my v2. I'll rework the commit message, and send a third revision. Nicolas