From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) (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 A7BF22FB625 for ; Fri, 21 Nov 2025 18:56:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763751389; cv=none; b=fx2Jbdazmtz2ySB6tV4vvyDrsh1UTtNF6SamvyrI6HrF1fN2dK5aOkeQFlktY9+IJbhx1Y7vYjhOTOMSqpFMf9bvPD/Kfe6Vo03uvz5oUuPfVBSxin23EYF1O/oBmAa8/3V0DYUz1oKkJrQmfHO9kWcn/PopXWSDauaImrYNHss= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763751389; c=relaxed/simple; bh=Mam3IaCSYNQIHQjQmaJhgMMCKOY2hqFTzjd1CT1BebM=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=mo4j+wOIsVtU/qAD5tcLgNnitN7zxs4WV2B4iVUFhWdgNM5MfiiKkPS2OUK4lGGLnGksGCW5MTurokYMgRWGhL/eKEEv7KIQaPNmSrFUJD9WrJsszu7qO0GbkqOoxTdYsI4sEdf4w6D74v094bkiqXQStgeniU037NeK4hY42KI= 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=iB1moKmH; arc=none smtp.client-ip=209.85.216.73 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="iB1moKmH" Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-3438744f11bso6540075a91.2 for ; Fri, 21 Nov 2025 10:56:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1763751387; x=1764356187; 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=45zCnBoYmBhO4CIZaEyDRG4f8mKY5mBvoMM1LyIYOfU=; b=iB1moKmH4xqlv9OOJujoJVoacqBLLqEcH4zgijfkhaU+y36VzRRTyHGwCbdIvAAhgZ lNVeoFW0xhuzXV6ZXY0x7Slk/qOmxsKOKUHY6bvgCtD6UnyofHs4NVZFUPgZpRpwkHEI b4opaQZkB6oWBpISEjJmVznpYyoQjC79g/NtALZKj+UaTLI0DKehj/t0seBYC9pFuzZ4 BLkPr5Ue3wj2mkCGkEZ7wVj2jdU/CnsDf1GFonpJaMqF+yBLA3nEPj/ZNU8jpKxzmGzl LaEi58sJwj02E6hhB4SxOgZsc5qgdbOdTpA5lZjfMPuUP3OMSjkYdEcyC4tjYoAI4l7Z Gd5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763751387; x=1764356187; 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=45zCnBoYmBhO4CIZaEyDRG4f8mKY5mBvoMM1LyIYOfU=; b=BAZ8ci45uo1FzAgsC7aIhoh/n0cfHinld+qCK9MwUizw8US71RqoSR/tsZHCC1vBf/ NzQwPUUFlzk/OKmvjDS6nlYPdHyro3LYIhdoWp/HxfPJaalVZhRIxBNwnLji19hbx39T AvoiPlMYixgs2U4zSsxCrXMoo9I5KuS9MfgtHdvTr2GQ0RAyt4mUY1sdq9AiaDcdg6jr 9ny1OvQJVNA/+TO/rlkdTi24SMVlKhy1tgjPJk4EmO7dXutdDfmQAc0wqx4lgFl8GD9z /1uxwNgmjJtL96uD7TK7hoRkyOEPme1u/R+C96L7x93y4V0WVu6wapIlmRADbh3bpk3T bX0Q== X-Forwarded-Encrypted: i=1; AJvYcCWrcHbbQvPRju8f+0UsL4EyYIfzGcaAd2lWo0I+Wu/olMNyuhobdwBkfFWBmvkZOBoBaLh37g/MXsCFAJQ=@vger.kernel.org X-Gm-Message-State: AOJu0YwnMtCgAG4W+LRYkftORM1MghbB3z2hSmmfAEbrSnDwOwpVJ7zm XAyv9krBtyDg2Rr9w//E+AwUMqrIq+Pz9TkCz7NgJJnaIpJFoxJDon14CyTH1VYBFMzyVmClv38 rw15o+w== X-Google-Smtp-Source: AGHT+IGghlbuYkW4ZbMkRVWX5VL6OyPvP4JN4m5PFSB/ZDMZcOV7CESskQGd43ILfS4/p4Y08KJla/xXVeM= X-Received: from pjtz18.prod.google.com ([2002:a17:90a:cb12:b0:343:387b:f2fb]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:3cc3:b0:32e:d600:4fdb with SMTP id 98e67ed59e1d1-34733ef71f2mr3983496a91.18.1763751386921; Fri, 21 Nov 2025 10:56:26 -0800 (PST) Date: Fri, 21 Nov 2025 10:55:33 -0800 In-Reply-To: <20251113233746.1703361-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: <20251113233746.1703361-1-seanjc@google.com> X-Mailer: git-send-email 2.52.0.rc2.455.g230fcf2819-goog Message-ID: <176375130260.290408.7905795529465965518.b4-ty@google.com> Subject: Re: [PATCH v5 0/9] x86/bugs: KVM: L1TF and MMIO Stale Data cleanups From: Sean Christopherson To: Sean Christopherson , Paolo Bonzini , Thomas Gleixner , Borislav Petkov , Peter Zijlstra , Josh Poimboeuf Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Pawan Gupta , Brendan Jackman Content-Type: text/plain; charset="utf-8" On Thu, 13 Nov 2025 15:37:37 -0800, Sean Christopherson wrote: > Clean up KVM's handling of L1TF and MMIO Stale data, as the code has bit > rotted a bit and is harder than it should be to understand, and has a few > warts. > > TL;DR: > > - Unify L1TF flushing under per-CPU variable > - Bury L1TF L1D flushing under CONFIG_CPU_MITIGATIONS=y > - Move MMIO Stale Data into asm, and do VERW at most once per VM-Enter > > [...] Applied to kvm-x86 misc, with fixups for Boris' feedback. [1/9] KVM: VMX: Use on-stack copy of @flags in __vmx_vcpu_run() https://github.com/kvm-x86/linux/commit/844afc1af3a9 [2/9] x86/bugs: Use VM_CLEAR_CPU_BUFFERS in VMX as well https://github.com/kvm-x86/linux/commit/aba7de6088be [3/9] x86/bugs: Decouple ALTERNATIVE usage from VERW macro definition https://github.com/kvm-x86/linux/commit/afb99ffbd582 [4/9] x86/bugs: Use an x86 feature to track the MMIO Stale Data mitigation https://github.com/kvm-x86/linux/commit/f6106d41ec84 [5/9] KVM: VMX: Handle MMIO Stale Data in VM-Enter assembly via ALTERNATIVES_2 https://github.com/kvm-x86/linux/commit/e6ff1d61de51 [6/9] x86/bugs: KVM: Move VM_CLEAR_CPU_BUFFERS into SVM as SVM_CLEAR_CPU_BUFFERS https://github.com/kvm-x86/linux/commit/fc704b578976 [7/9] KVM: VMX: Bundle all L1 data cache flush mitigation code together https://github.com/kvm-x86/linux/commit/0abd9610d6c6 [8/9] KVM: VMX: Disable L1TF L1 data cache flush if CONFIG_CPU_MITIGATIONS=n https://github.com/kvm-x86/linux/commit/05bd63959a9d [9/9] KVM: x86: Unify L1TF flushing under per-CPU variable https://github.com/kvm-x86/linux/commit/38ee66cb1845 -- https://github.com/kvm-x86/linux/tree/next