From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) (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 BA8374E77FA for ; Mon, 28 Sep 2026 15:46:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790610409; cv=none; b=ZiXihxwTUaRmpB+P8bRZjPu1mRNhTH/2InC3kWfq6fw8jjIcsY1eHqbv8g1VdeqlvQ7OQdERru+XgAmryF8DSgwIffXANBMRHKs1zft9P2ErP3mkxS4uFmXRKtKd1u7zLsZxBonwAyOGnjIch/NKkh91BUZL8fMxw2m1s9rtxMg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790610409; c=relaxed/simple; bh=zUSOTKG7jh36LtiLzwadFBmLGJH1sO8KyInZAeeVpg0=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=uHTezWXCztFYWgQG8V0a8MSwvD9gcSxQRctTrG590xP9FFAy73SrtxVgqsmkE/A8ZjB4LiwKbEVjtEhAhilQzfpCuR78zNdsTf6jaI3ray8pQigy5x+2Mm3qR7sqZcM0OhvCAurt5D4voj2s2JMOq0nnKGSSs6R5itV1QNCoxpA= 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=t7BKdUWh; arc=none smtp.client-ip=209.85.215.199 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="t7BKdUWh" Received: by mail-pg1-f199.google.com with SMTP id 41be03b00d2f7-cc11b5dd54dso4658121a12.3 for ; Mon, 28 Sep 2026 08:46:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1790610407; x=1791215207; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:mime-version:date :reply-to:from:to:cc:subject:date:message-id:reply-to:content-type; bh=zB9SPDkNv+eeFxSmYp4t86BYZ0eykAy0n5tZdc0Mzfc=; b=t7BKdUWhT0EKmrGhiODxIs35cvaGQDvi3N2AqpQsr8l4RO/yfdE0Z8pzQGr0+7nw+w CdwrIFJY7g/ZuZ3FWbUVYD8Yo+l/7xr/mF4LEDcxfbJCVwPbOVNRMyqjnd5dZAJXcL3W wuv9Kl2BGNQ4XA78wOtYfumaE0z8lqvEIBmG1YK6veobhT+vBY5JrNtJ8SrHluWXSdAD UxB6H9V0Gez77hhHZ7gjh70E+daWWW/S+Ke8zOb09Oygq8cveaaHxHZBHyZvXQRGamp7 QGutWvqJTWp0NFiwBk6b7jbI138sKV+tQrl6LjL4em6RVUGp6fL/CzG09k7+F75UuqlO b0/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790610407; x=1791215207; h=content-type:cc:to:from:subject:message-id:mime-version:date :reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=zB9SPDkNv+eeFxSmYp4t86BYZ0eykAy0n5tZdc0Mzfc=; b=eKIEri/IJsU97/M1XNKI/k3rKwo1q/LDEBIuHZATFiAbpVmn4k9nRrPnVUwiklp9hp tI3NZkSdl/kjWNKML2hh1iAKI7N00bToIgNb78x+6GgJBEyMEhYBVt6+inC6crjjtc0k a+lVIPip/xJp6kOjOzctOP1Fz00jB8GftMifKFuB1orlDQGaU6iIWPTtAseicazEy4uG R8+duI33IjqiL2AdZKUwPGInxsiWGk+EL+HaDkpxxQvMKZCMO4HlHR4URAaKLgX5wZ5Z CjddnQAh4byZNRbfViEzOefwh4rKmNrsmZ55uZjL12/tIeYsDEEOcoy13S1iqkYA1Csd dhPw== X-Forwarded-Encrypted: i=1; AKwUvBwacORjaU/rcYfFISxFfX8rhUtg6P7aGhR/BhY1PmeowUIOlFFI0H6/QTcJgikI6TwibZJbwfvnnp+QMeE=@vger.kernel.org X-Gm-Message-State: AFuF++mxUZybBiMmAU/x/cE2NsDse7edRjQzxVeLjStDpzzY7Jio5CSB KsIKq0GGfnVS9UlIFiqFyBZDO5Ex6xqdkcyZNtivnvZ8hEikjTneNQWU4rgrJNkNSro5t2HIKyd /c/w8qA== X-Received: from pgdf20.prod.google.com ([2002:a05:6a02:5154:b0:cc7:9a39:8bde]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:b78a:b0:3d3:afeb:880 with SMTP id adf61e73a8af0-3de0e75e915mr13052663637.28.1790610406739; Mon, 28 Sep 2026 08:46:46 -0700 (PDT) Reply-To: Sean Christopherson Date: Mon, 28 Sep 2026 08:46:42 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.56.0.rc1.315.gc6ed9934b7-goog Message-ID: <20260928154644.2559454-1-seanjc@google.com> Subject: [PATCH 0/2] KVM: SEV: Fixups for the cache maintenance fixes From: Sean Christopherson To: Sean Christopherson , Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Sashiko Bot Content-Type: text/plain; charset="UTF-8" Two fixes, two bugs. I'm batting a 1.000. Fix a double-free and a race pointed out by Sashiko. Regarding fixing the double free, I initially said I'd just move the allocation to avoid having to deal with CPUMASK_OFFSTACK=n[*], but that felt too much like I was leaving trap for someone else. So instead I elected to nullify the pointer with memset(), which has a fairly desirable side effect of clearing the mask when CPUMASK_OFFSTACK=n. [*] https://lore.kernel.org/all/arQMARDUTSjbWpMX@google.com Sean Christopherson (2): KVM: SEV: Nullify "have run CPUs" mask pointer when freeing it KVM: SEV: Do cache maintenance on the source VM *before* clearing SEV state arch/x86/kvm/svm/sev.c | 46 ++++++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 17 deletions(-) base-commit: a4bab1c12fd528ccaafee00360e07463873404a9 -- 2.56.0.rc1.315.gc6ed9934b7-goog