From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) (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 6032219346A for ; Wed, 10 Jul 2024 15:51:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720626714; cv=none; b=cn2EJ85fW55qUarSEkPpzBr6h5l02MfFD01u7c4ILz/lVokV6MjfcVX2FpTpoFqw/Bxe65Ugr9mZT06DUt7geJbUMO3PwNQcYyoC6K6r9Q4YV3UVuDIlbNlbswoFNzX3Dtd0TpIihvr9T6h2U5haA70lsPXxUhJ76mX9WTYlt3c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720626714; c=relaxed/simple; bh=Yd7wN4MEwb/4Ych5ZfYI8ZDswiwmmeax1EQOB34ZhJk=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=OV6NMkMByKFIPNVh782CbD/9pkAG6o1Eji9yibVCkSNyc/cT0+7iObukijC+U44XRvhvzzBRruiA6ftwbeHWXGqAonLHNrBeZHnJos9O/tE06OqVaaaiRDfYe9wpOJLfuZ5hBh+r2KehSIDuiTIPrSbelcmtvQiSo6lPX++yVTc= 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=JhbcPp9X; arc=none smtp.client-ip=209.85.214.202 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="JhbcPp9X" Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-1faf6103680so32431075ad.1 for ; Wed, 10 Jul 2024 08:51:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1720626713; x=1721231513; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=2S/Ws8T8aRzTnaLMwEZxjsu7iN6mSUkQ05y/iw/B/rc=; b=JhbcPp9X5fROXiRJpjfZ0mTQ03VjyXK7pGgWskvMAElOy0XU1wY7FW8pnmf31TUW+5 IJE5TVBX6p6aMR3DMQCuoK2xWjf2cc2gfY5YzDvfnk8eLuaEDi3zKkqJHCSlY49p85PE kBiDvGCsOnONVXq76F3+DncpaMz5vVEvZmII1jNLiud3xbeUdZsUSWay20lZRI5dhZ/x zydhk13mynnlSzmb6CstIOU6IZkHLVw6WAIYzflqCQjLlsvApD6LLULYeEJBVJIpfa4u vgAFmX81ngYINnV6yuWPEtU5WdHvWcoOxCWRJ6VvguHWm5XmYStbm2BvlsMwYiBTXnKj atlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720626713; x=1721231513; h=content-transfer-encoding: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=2S/Ws8T8aRzTnaLMwEZxjsu7iN6mSUkQ05y/iw/B/rc=; b=oi555ayoTGTZvbtsY7vTuJGzP/u+QqYDZoaN32UZFBFL/PTpMV/Z0J5/n3JXpYANYh Q/5nxFLDVsJ4yjhww3rsVpVWsUO0XZiihyxwx7Z2T9kkxqPfVBv0VlAVJETMPHLGR39K tMQGKjHyrawnxgImjl1QmMAqJn6aAr7b7wnkjOGcaHv1MXyPxKWVaCydn9h+1PxyXoJx f2gra1vJH4rszAq5n10rHtdfRCTZzYowoj1N2MCh7YcGqlKSkep8kS0EWmZGsjhfYV07 hmkV99XURKOXzDBjkFLO9VfOGpBw1AEEvgfrEIVAfU5D8/QX10wFpnynJQlOYrr6ZNBk Yr+w== X-Forwarded-Encrypted: i=1; AJvYcCWUmHGUqyzTEHjA93VTrsjsEAi0soEejIx9vBigSQs5mydEFkyKJZa25+Gc+qaw4dvW121otQdrBelgzDH1WsbJENgH X-Gm-Message-State: AOJu0YwTXwWbsMSguSoINdRiQhxWEcRVETZJq/AN9MZQPCi4kaUOEeRO 1CbHcOo9RerPGm+u+dOS21NZM0APobv0EPMflWWbcXaHy/zb4Pen5xjo3zPCq00NHakjM7qt60J 74Q== X-Google-Smtp-Source: AGHT+IGFDWyL4oVIv+kd3eR4ozKAgHx5u/arXUHJsTVnFMVwi1+9LesGIr7Enb4S0IMxOwQQwYsx6SyO0KU= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:902:dad2:b0:1f7:175a:69ab with SMTP id d9443c01a7336-1fbb6ce3e7dmr4023085ad.4.1720626712651; Wed, 10 Jul 2024 08:51:52 -0700 (PDT) Date: Wed, 10 Jul 2024 08:51:51 -0700 In-Reply-To: Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240503181734.1467938-1-dmatlack@google.com> <171874683295.1901599.10170158200177384059.b4-ty@google.com> Message-ID: Subject: Re: [PATCH v3 0/3] KVM: Set vcpu->preempted/ready iff scheduled out while running From: Sean Christopherson To: David Matlack Cc: Paolo Bonzini , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Tianrui Zhao , Bibo Mao , Huacai Chen , Michael Ellerman , Nicholas Piggin , Anup Patel , Atish Patra , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , David Hildenbrand , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvm@vger.kernel.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Mon, Jul 01, 2024, David Matlack wrote: > On Tue, Jun 18, 2024 at 2:41=E2=80=AFPM Sean Christopherson wrote: > > > > On Fri, 03 May 2024 11:17:31 -0700, David Matlack wrote: > > > This series changes KVM to mark a vCPU as preempted/ready if-and-only= -if > > > it's scheduled out while running. i.e. Do not mark a vCPU > > > preempted/ready if it's scheduled out during a non-KVM_RUN ioctl() or > > > when userspace is doing KVM_RUN with immediate_exit=3Dtrue. > > > > > > This is a logical extension of commit 54aa83c90198 ("KVM: x86: do not > > > set st->preempted when going back to user space"), which stopped > > > marking a vCPU as preempted when returning to userspace. But if users= pace > > > invokes a KVM vCPU ioctl() that gets preempted, the vCPU will be mark= ed > > > preempted/ready. This is arguably incorrect behavior since the vCPU w= as > > > not actually preempted while the guest was running, it was preempted > > > while doing something on behalf of userspace. > > > > > > [...] > > > > Applied to kvm-x86 generic, with minor changelog tweaks (me thinks you'= ve been > > away from upstream too long ;-) ). Thanks! >=20 > Thanks for the cleanups. Looks like you replaced "[Tt]his commit" > throughout. Anything else (so I can avoid the same mistakes in the > future)? I don't think so? The "This commit" stuff is the only thing that I remembe= r, so any other tweaks can't be that important :-)