Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp697786rdb; Thu, 22 Feb 2024 17:38:01 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUXPedaRd7vxNJOqQzYLUVv6njrqEOVxw6vK3l3fWa1TXx7EDZavuvJUeNKJ0P0S+4IKl/2W4us0Z2v4Dn0lV7UjpXTRnbNI3DdMuZYeA== X-Google-Smtp-Source: AGHT+IHXiJOpzP8KJlXE7O264mbBDMW57Fo26c0ScU3h+p505AR2dxt7pW+Z5v5+v741ryK+K8+9 X-Received: by 2002:a0c:e449:0:b0:68f:634d:443b with SMTP id d9-20020a0ce449000000b0068f634d443bmr1141901qvm.2.1708652281431; Thu, 22 Feb 2024 17:38:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708652281; cv=pass; d=google.com; s=arc-20160816; b=lqbDdvWcfB7X5Tm6NEOjFBL00NVWRvOd+opsxyYBrUKgoxw1kmmdoQ80JwBa80meyF AX3N+D4zd09wAXJ2l3fDDMdzaeHsLwiPJ9gM+qU7lmzCoDGyVs/aol1ncOGXNfX2IuZ8 ri4O7g3MmMX6nk2ptzwrM9dMnbyCj90URXa3VItEDhqAWLmW3cweHDCXBZq8RZDwAW2u 3E1oJ1hfWEOn8dRx/+lw3K/8C9FwNE+Q4x7qqalvvFdYutYFA6CQuKbCWe+ZbodAgO5d j7jFKli/hqsjo4wE8bNfUCjAj30lddpXIMti/ryh94uGw9yM4BCv89hNdkDdDTBmWFV9 86fA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :dkim-signature; bh=nZOxtidqnLAab6ncFHZHgfs5e5Ab+wmQ1LWEiG/Eq7o=; fh=qsGMv+3r9nXNteMDvTPm6W/fF3wghXtGjlm2W+TKtsk=; b=sEEVRe8xSAPkg3IwSNVcvDe7LGkooRf7/ttkJW5BpqF2qL4LdiYlGICFd2TRSMrNnv lKFZIF0QH262oNCQ8E+KGhFCetJzixj6EvJk/3nD4nvO6sQcijcwGRjEPj6B7iGtpRIa VAVZaJLJ3YoalCkKGGz68J8e2nk+aqqBPMz8Tu0c4HRyMQ6eBMTkeyf0jR57LsNpgfY3 Cm3jC3GWydgsQXYy61yoDJWIh1RAHPJIcyHojsR/oz/XYIGuB4izGaFT26kP3Et+LeCI P2TNWmAZbYe9+AJAaNGgGt0HxHa7iigf3C8gmuI4SjsJwpPY1fbactmfpODt5Ckml3MW Nq0g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=nmIRYBN6; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-77637-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77637-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id o3-20020a0562140e4300b0068d15511a8dsi14485449qvc.74.2024.02.22.17.38.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 17:38:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77637-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=nmIRYBN6; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-77637-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77637-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 21E4C1C2270E for ; Fri, 23 Feb 2024 01:38:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D574311709; Fri, 23 Feb 2024 01:36:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="nmIRYBN6" Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.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 96783C126 for ; Fri, 23 Feb 2024 01:36:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708652189; cv=none; b=OXEv/vN1/C+J65SIRCP/ap8Wzl8LdYsiTK/UOlZ88o8hNCrnRL7zcgzoRXyoOSIfStQ1XDwtCgIpH+za2qOryzv3I3CBFAfXMFawjO5pX8dgKyLGTrSKakpmSSfzRIlJbnSkodNpm0Q20Fu61PRZ3Kf46qeANl0Ba2Oe9foCgn0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708652189; c=relaxed/simple; bh=wxHfWMq7Lgq0G67zQZ2MnUqa7LLPfz3fmqOUA3OwDDE=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=BFchS/GNO+iRxo2FiPyRoEeGgUYty7uJZ65XXc03HqcxeCfdFBUiqxLxd8S63is7S4nf+GeJ9KuqbHcNmFX4Hz/BWQDxXsbg774e42+tqFZtr4wraDoBS/BOksNF1JrhVwTdEbKRGhL73L7P6uhPNcaYp3QM1CUX7oRxmpKQ49Q= 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=nmIRYBN6; arc=none smtp.client-ip=209.85.219.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 Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-dcc0bcf9256so509776276.3 for ; Thu, 22 Feb 2024 17:36:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1708652186; x=1709256986; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=nZOxtidqnLAab6ncFHZHgfs5e5Ab+wmQ1LWEiG/Eq7o=; b=nmIRYBN6qgptcdqAMatCANBuBCLZ3VH1z5nGK7vGyuHNAxuiIPPORAdGpvnkWXKv1/ jgOm4FI29ePK0iq0lzBsqZY57i441Yv/k13CG5J12xfvp3XmqXx/RCMpJoHLpx4QrwBX 6jFLJ+dFz2lGWVTOI7bmWNoacsR4QUnSot8xNKHR1yOpZ6IejVw59EEM2VTxvwUCvSr8 x0Arp79ezK0d/i9K48PCU3cPs/+2BV80WO4i5TAZkwDwU0Qr8jcyL3VagCwMPI7NSinJ wwSqEvlTEDYuBC+TWyX0Sih4bOuICHMYTffvtX7d/TMripqTZNjRSOLrT130Ci5ISFSK Pziw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708652186; x=1709256986; h=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=nZOxtidqnLAab6ncFHZHgfs5e5Ab+wmQ1LWEiG/Eq7o=; b=NdsV57peIWHk/YSC39E0QkwhhbRPW0B8tuYCxXooJXzC7CM5dIfAF/qZC1KTeS97CD DdURF/anUc6D98Y2jsxoVU212crL/+ZlYVlvuMOHYMCKq0yx95RVtpHIrUD7WUfC5LJa LkEI22FUKB7hdqmlXwB+rVYxf1wYpAxgCYIFdWWaOsP4q8lLruzRNxhAPG+vQG064Dgm dnDLPVgxGlH/4GB3Y1+b10b1bmy/bTlAoSvghNy6CwZ220GTmoUQhv+tmfgNSlpZaReG v4W8AAhLsSLbcUSqAOgg3gI5c3joebG5IMBIeGtS8gLsk1SCf7lPXSOIqUNbSLaI+Ocm vsGQ== X-Forwarded-Encrypted: i=1; AJvYcCUuOXO4y1K91Fha01st8s/bJ+cejKHhmKpRT/aIFV3A3f4XwIXXR/cv83MIAYNv9rSisxUqq4lvrU1xLDDh9R/2irN1D0VWwFmWJJY5 X-Gm-Message-State: AOJu0Yx+qja1OcWpoQld3X2qvPoWLt+sbr0sCy1bZWcPVeEadKHsb853 NCMTpqEx1jEiEAyEWFCplJR4Jkeo6FPZtuzDaWWWipjTGBcjVqCUIN5Dl90oJlACfO3GKCxW0zO 9NQ== X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:6902:1741:b0:dc6:b982:cfa2 with SMTP id bz1-20020a056902174100b00dc6b982cfa2mr24039ybb.8.1708652186598; Thu, 22 Feb 2024 17:36:26 -0800 (PST) Date: Thu, 22 Feb 2024 17:35:42 -0800 In-Reply-To: <20240110003938.490206-1-seanjc@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240110003938.490206-1-seanjc@google.com> X-Mailer: git-send-email 2.44.0.rc0.258.g7320e95886-goog Message-ID: <170864807002.3089764.1263409460793232398.b4-ty@google.com> Subject: Re: [PATCH 0/4] KVM: Clean up "preempted in-kernel" logic From: Sean Christopherson To: Sean Christopherson , Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Like Xu Content-Type: text/plain; charset="utf-8" On Tue, 09 Jan 2024 16:39:34 -0800, Sean Christopherson wrote: > Provide a dedicated helper to query if a *different* vCPU was preempted > in-kernel. x86's VMX is an oddball and can only check if the vCPU is in > kernel (versus userspace) if the vCPU is loaded on the current pCPU. > > The existing kvm_arch_vcpu_in_kernel() "works", but it's an ugly mess as > KVM x86 is forced to check kvm_get_running_vcpu() to effectively undo the > multiplexing. > > [...] Applied to kvm-x86 misc, thanks! [1/4] KVM: Add dedicated arch hook for querying if vCPU was preempted in-kernel https://github.com/kvm-x86/linux/commit/77bcd9e6231a [2/4] KVM: x86: Rely solely on preempted_in_kernel flag for directed yield https://github.com/kvm-x86/linux/commit/9b8615c5d37f [3/4] KVM: x86: Clean up directed yield API for "has pending interrupt" https://github.com/kvm-x86/linux/commit/322d79f1db4b [4/4] KVM: Add a comment explaining the directed yield pending interrupt logic https://github.com/kvm-x86/linux/commit/dafc17dd529a -- https://github.com/kvm-x86/linux/tree/next