From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.198 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796412132; b=Cqv9wuXcYcK9NS7oYcrOI94V8C/pKEBlmWq7usa4wCbWG2JGl6YkhVU68tVLEwEDcvs8 /V5RGs4mc8LlQGvpFhDiJPdpPa6Gc91L8PmboGhIu2u04oDH7b/5w14VgcFCfS0uiwJXC yxy126vSa4jPJ5CXbW9AMzPrLnNvxjBFnzZHpROo1sZ11xqQCsWpU6DSx18IQswSRecZw 1/YMFrGgjg2mSgv8rRrFYRotNeLZQFVGIY1HB4kBKsUeeF8SyC85xffpXEE7NjooOPXHZ u87Jj0MISVHPAPAm+B82N8c+m1kEW8aRgGPXuUhThNKVVh22QdR0SHuilHM85SUOJgg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796412132; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Received:Date:In-Reply-To: Mime-Version:References:Message-ID:Subject:From:To:Cc:Content-Type: Content-Transfer-Encoding; bh=C5SIrvVobkuPoTUcFmSRfDFQeuw3TyLoyHmdRe6zrgg=; b=d9phunKuV6lrcl3QBqZhvfPvJ8AIhRa3C22vHS4GrGo4PCJ1roTp4zee3vTMOAYQ47Rc gRiLlwf/rP0MbRbYYb5TDFQ93BPjQkvGbzS7ZokqoHISTmmwzBvvJe6bPAGLh4J1BPZfE thJ+57dEK3/+bj/I3FQHxkM3CWC3IXB1yjxCFP5FEL+nHAZlgV810uaSeoPQj18LLw0yC gzZtmETruIbeUzHTUNJu3+8/C6KQTsGyvPmLrlb+/FdeuN+2g3k7miRCxmvTDKvWyLAbO FpovhyttGDMSks5NkPtL6MpGeiJzZTFv3zOY5GXAOvvNlskkyWiB98U+BHlhrmVipPw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=pl5PnR+o; arc=none smtp.remote-ip=209.85.214.198 Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E8A03606A322 for ; Fri, 4 Dec 2026 19:22:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E8A03606A322 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.a=rsa-sha256 header.s=20260707 header.b=pl5PnR+o Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2f022026e60so13354415ad.0 for ; Fri, 04 Dec 2026 11:22:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796412131; x=1797016931; darn=vger.kernel.org; h=content-transfer-encoding:content-type:cc:to:from:subject :message-id:references:mime-version:in-reply-to:date:from:to:cc :subject:date:message-id:reply-to:content-type; bh=C5SIrvVobkuPoTUcFmSRfDFQeuw3TyLoyHmdRe6zrgg=; b=pl5PnR+omtpcZzE6RNBDGlIb4E04AptwcElLgp4jf2kqJzkM8mnJAj9d7abASsXLZs 8wMyVVzJjAEeUcSLlaG6Bq2LcDDRz/Bg30ZmOmDSVEq0JJ61+vflkWGWtkl3meYyR6sb VA9z92mHyghB2Afo8prpJknKlsbgFZppUVUgNNSqJqt5N/gvmv5yjm3NXyeCl6CxAcpU 2lIpvxhKsxkKvnT5oIOS7S3qSyOmEKx+WkEw3dR385JJfUI63ZyVRqU6N+pLWz//+dbJ CrSfihYR0jm9JrbOq3m067imzIesdeHvAwq9AHxdjU7KGoDp8WqgUavyVHwtgj6+00HM DOoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796412131; x=1797016931; h=content-transfer-encoding:content-type: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 :content-type; bh=C5SIrvVobkuPoTUcFmSRfDFQeuw3TyLoyHmdRe6zrgg=; b=bQLR7NioX/M7r5mhYS+SsF2UxDPJ3YhoK25JurJY6NhPs632LCe6VrlGbHOB2sPHkz UIFZ9BdnpxWxM96SWUeqa9A1ChB9M/3t64xB33FhjxFeu0PnQBa9t1kdFy2UqTpGeSnD JMBn+byZmGBY63U7r1v8Y+r04YOumW0tNL8+ejT3FMzcTVsqO4dkmIm4hv5lXnEHYvMc vJTrXLxmsxvn3lGadZbvD98L+tBPm06xib9r2qFMjRcqsDHylxfbBm+htyWoNiI1tk+v UdKqrj3Q4DnumZPa0qjEOWTyXsQwCvfOn2JmZKfN13X8OyKLQ+D7dFDkIn3cg6pPykUT dljg== X-Forwarded-Encrypted: i=1; AL+hErHxzBpR0PibT6IpotswORNjjpGSsfK5g7PAP08SpRXz3Q/xAn9gYnspu57Q3woOxjyfYxo=@vger.kernel.org X-Gm-Message-State: AB4q+uEM/8pyCQUVgisuq8AsK2VRNEO+vAgtz6SuUwach6VFnInrrOqo FQg+amt2oU22Cwpx8Wrw5dukjIPGqdqBSR4+1BO3p/Me3ShxsIMGcC6AF7jblVwT0UikyLSyBYQ nw4PD6w== X-Received: from plbja12.prod.google.com ([2002:a17:902:efcc:b0:2ef:f5cd:c465]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:cece:b0:2df:b510:cebb with SMTP id d9443c01a7336-2f1ba05959bmr23831915ad.6.1796412131035; Fri, 04 Dec 2026 11:22:11 -0800 (PST) Date: Fri, 4 Dec 2026 11:22:10 -0800 In-Reply-To: X-Mailing-List: kvm@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 References: <20261013231728.883001-1-yosry@kernel.org> Message-ID: Subject: Re: [PATCH 0/4] KVM: x86/mmu: Don't sync cached roots created for a different MMU context From: Sean Christopherson To: Yosry Ahmed Cc: Paolo Bonzini , Jim Mattson , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Thu, Dec 03, 2026, Yosry Ahmed wrote: > On Tue, Oct 13, 2026 at 4:17=E2=80=AFPM Yosry Ahmed wr= ote: > > > > When invalidating an address, KVM walks and syncs cached roots using th= e > > current MMU context, but cached roots may have been created for a > > different context after a nested transition. With TDP disabled, this > > lets a guest trigger a BUG_ON() and crash the host (see patch 3 for > > details). > > > > Patch 1 downgrades the BUG_ON() to a WARN_ON_ONCE(), patch 2 is prep > > work, patch 3 is the fix, and patch 4 drops a TODO that isn't worth > > pursuing. > > > > Sashiko flagged the issue while reviewing the INVLPGA emulation patch i= n > > my nested SVM TLB series [1]. The host crash is easy to reproduce with= an > > AI-generated repro (with TDP disabled), and no longer triggers with thi= s > > series. > > > > [1] https://lore.kernel.org/kvm/sashiko-outbox-163479@kernel.org/ > > > > Yosry Ahmed (4): > > KVM: x86/mmu: WARN, don't BUG, when walking a cached root with a PAE > > MMU > > KVM: x86/mmu: Drop for_each_shadow_entry_using_root() > > KVM: x86/mmu: Don't sync cached roots created for a different MMU > > context > > KVM: nVMX: Drop the TODO to sync only the affected SPTEs for INVVPID >=20 > Do I need to send a new version for this? No, just give me a comment for patch 1 I can squash.