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 5167D394797 for ; Fri, 10 Apr 2026 23:58:56 +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=1775865538; cv=none; b=V8wQWVuQUT00xmaebJHj/gEJNiF8ZS20r+2g3aTXS0n6hcjuRLmcRrvMDGfCQO5gtO4I7gXU/DlMAGIlcyasx3v1UJqS3/RmrpywgzkNsj3qOc4iZ54eSaNhD3kHMQ/eVNRaRtLP9tBceg0SwfjGGgUB/115slCDrnuEc5F0hfo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775865538; c=relaxed/simple; bh=n53sTQFuaKkPn7LgxmZfFIhgvTw2UGzZsf99/9tK8Ao=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=tanMwYYeOOFTB7FAYiJ6gFdgU5+3jyhdHojEmfc/LmR8F8a56/2w+2KX1P8K4stfWDlm/WWG6bB4ZBNDWt/GYDf9QdpFb+YE/+9jUfuAbF2kJPI/Q9BfcLcBxPLBNZVveBoMCPe5kMeqWGEXF0oR7HDyCSh7pIrh9rbDPTn3UoI= 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=QiDbVsQ2; 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="QiDbVsQ2" Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-2b250d3699aso54861205ad.2 for ; Fri, 10 Apr 2026 16:58:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1775865536; x=1776470336; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=qts7/CRLTnbH8sAI2gtWB18MaVwGG3b//bnp/wNIqFs=; b=QiDbVsQ2iCyYQfI18FmCaU8t9fc27DzCI2p0TxF8UyTBHgmMInshr9E5FQ3VtQd5va UDvbFyg2QRjsJ9vbMV6sdYVM2Y/H94iThnRaNvFFJ/FqzlqfpTIh+jeaak8U4xWe0J4W ZphMij3JtjE/9NVGdUuvEF8MGkDHrjaP4gYMQG/vK+aDUXvIgG3bQ2rqsOCHcAU0GyT0 CU5zFAXAVaHmPtFk0uksU72BucxIseWucHcj7/ZLYg4JMRdRY0dlAugARfIdvLZkFnlq wyrUY4mMgPrbMYA3VMbDkQWwME6eoojoRy3DmwzCMU730xFjdyX9ZXMfF4qHuPqIvcP9 8Gzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775865536; x=1776470336; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=qts7/CRLTnbH8sAI2gtWB18MaVwGG3b//bnp/wNIqFs=; b=AfiaRrx3Vv0K6CQt9VtuggIO8556mmSviFf87zRq1sylyKwIasCAMG0i3lMrlBTvXJ srQPKeu72LOzYC0ANsR45LU3GkdKWvuy5ne95WKqKEQUNDFSygEYOfi2gxmeH56OXaIs eZ1KAdtF7FeycvH+hB1GOiJfhsL2Ri4e6kpPSJIzqvMBgD3VZ38K3GbaLISNx5KCP54+ +fxp40fPen5nh1yCnSqmSDy/SBIEd5M12lsIjZbxgL/6HLUPl4EJcAJ5FJNuo1iFLnZd +6ZyHXSoRywoOcl0r563xnIpAtsvgEWgIzWyOPthfq/ZzNu71ECBD1rXWu5FuZrhWNbq oxIQ== X-Forwarded-Encrypted: i=1; AJvYcCWt+IYeiDvWq2H2oJCPx5vZy9uZP1MGdlCTskWshjzI6jtOo5zXIX9oCh9C+fYIrz6sYTnRP5j3fQWVlb8=@vger.kernel.org X-Gm-Message-State: AOJu0YyZBoDAv1ryu4aY3DOaPtHB+fZpM7EwGXZ2w57SxOq4CBQlsx/L kszJJtG3W/ic+eTFpNMgf8mJf9ZZyu3Hq2B3b1lZiVrktPO6/fdsgjfbwQrpFxQUCIZ2N9FbEU4 HI2xrAQ== X-Received: from pfbhu21.prod.google.com ([2002:a05:6a00:6995:b0:82a:69ed:da7f]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:9188:b0:399:196:1430 with SMTP id adf61e73a8af0-39fe3d82535mr5913893637.20.1775865535473; Fri, 10 Apr 2026 16:58:55 -0700 (PDT) Reply-To: Sean Christopherson Date: Fri, 10 Apr 2026 16:58:28 -0700 In-Reply-To: <20260410235832.2312342-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: <20260410235832.2312342-1-seanjc@google.com> X-Mailer: git-send-email 2.53.0.1213.gd9a14994de-goog Message-ID: <20260410235832.2312342-10-seanjc@google.com> Subject: [GIT PULL] KVM: x86: SVM changes for 7.1 (short version) From: Sean Christopherson To: Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Sean Christopherson Content-Type: text/plain; charset="UTF-8" This is (obviously) the partial version of the SVM changes. The highlight is here is the AVIC IRQ window fixes and optimizations. The OSVW changes aren't motivated by anything beyond a "someone is wrong on the internet!" type reaction. The following changes since commit 11439c4635edd669ae435eec308f4ab8a0804808: Linux 7.0-rc2 (2026-03-01 15:39:31 -0800) are available in the Git repository at: https://github.com/kvm-x86/linux.git tags/kvm-x86-svm-partial-7.1 for you to fetch changes up to a56444d5e7387effbc61d6b98fe5d68897017fc9: KVM: SVM: Skip OSVW MSR reads if current CPU doesn't support the feature (2026-03-03 12:23:26 -0800) ---------------------------------------------------------------- KVM SVM changes for 7.1 (short version) - Fix and optimize IRQ window inhibit handling for AVIC (the tracking needs to be per-vCPU, e.g. so that KVM doesn't prematurely re-enable AVIC if multiple vCPUs have to-be-injected IRQs). - Fix an undefined behavior warning where a crafty userspace can read the "avic" module param before it's fully initialized. - Fix a (likely benign) bug in the "OS-visible workarounds" handling, where KVM could clobber state when enabling virtualization on multiple CPUs in parallel, and clean up and optimize the code. ---------------------------------------------------------------- Gal Pressman (1): KVM: SVM: Fix UBSAN warning when reading avic parameter Li RongQing (1): KVM: SVM: Mark module parameters as __ro_after_init for security and performance Sean Christopherson (9): KVM: SVM: Fix clearing IRQ window inhibit with nested guests KVM: SVM: Fix IRQ window inhibit handling across multiple vCPUs KVM: SVM: Optimize IRQ window inhibit handling KVM: Isolate apicv_update_lock and apicv_nr_irq_window_req in a cacheline KVM: SVM: Serialize updates to global OS-Visible Workarounds variables KVM: SVM: Skip OSVW MSR reads if KVM is treating all errata as present KVM: SVM: Extract OS-visible workarounds setup to helper function KVM: SVM: Skip OSVW variable updates if current CPU's errata are a subset KVM: SVM: Skip OSVW MSR reads if current CPU doesn't support the feature arch/x86/include/asm/kvm_host.h | 29 ++++++- arch/x86/kvm/svm/avic.c | 17 ++++- arch/x86/kvm/svm/sev.c | 8 +- arch/x86/kvm/svm/svm.c | 164 ++++++++++++++++++++++++---------------- arch/x86/kvm/svm/svm.h | 1 + arch/x86/kvm/x86.c | 45 ++++++++++- 6 files changed, 188 insertions(+), 76 deletions(-)