From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f201.google.com (mail-pl1-f201.google.com [209.85.214.201]) (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 AA55B29D268 for ; Mon, 17 Nov 2025 18:35:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763404505; cv=none; b=cJyltx4/cTqhmpTgMXsXiV7po9mvFUFZkJzK/RVwcCFlL4Kr502crPKmoA7X02IiLr2ZFe0xfRoTY2CrL78OfCABOsSrq+DnIB+5I/e53PtFQHnOnRjGlDVMy6FQU5ShK0JMelyi3ccdMk+2D3z3yqbu8ypyS/OOUcFDTrBTaYE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763404505; c=relaxed/simple; bh=vUii/Zjd0EOYd9XofJayFPbD87AGj7mAEd1nALCQxkc=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=RcKdULibdILpOWQ9tyzKjlfDBLu6flrst3TH3MGgbZ206notyz1p/a/SKEyfwJYWTzEyB9R+yh9yRMjRYK9qMnLpII+OAw58azHdZpWRyM3nG5xPskkWxPceO5DFs+YzgVvsMJFPmxAYVSJSQi+dJUe9RuOsaKJdp5fsQwyel18= 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=pqUvZRa4; arc=none smtp.client-ip=209.85.214.201 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="pqUvZRa4" Received: by mail-pl1-f201.google.com with SMTP id d9443c01a7336-2956cdcdc17so55099745ad.3 for ; Mon, 17 Nov 2025 10:35:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1763404502; x=1764009302; 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=+tWsc2Xr4SAZkzREfxWG5yQF2KiQKxMP5ZVYXfBNuLo=; b=pqUvZRa48F2Ykze+od3CSf+wa0zjsZD+PRcTe/s6dm5NzoTqhCg9RjiyCl8A3HfGXT DIuKaqy1hDuM0sfPYa0RtoG7ZyaqCH5dHb8zFPU+nSbXsEaSiWKhcss/XAtiguFpW2pM LgRFxq6Posm22RukSRbHnlb3pOSnO3ytnwuml7hE6sBLoz/LSDlFX4n+NNy8KirqJAjo 2ByjmSEw7LP9nxIrq5XwsX9NJlKOqO0KGRY74XeJl4Hpre+1BDlpdSt+urh38CYpp54Z KjDpZxwdXhCsRe/3llLfcmabwzC6KB8F84o2tbuqbQJtjl+5N1x1KMSVCfIaZ5v9bG3f mpKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763404502; x=1764009302; 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=+tWsc2Xr4SAZkzREfxWG5yQF2KiQKxMP5ZVYXfBNuLo=; b=qgLMctqiLY3LwTwsGXxJ5wIVpzry0dhiZ/Ecx54Ehtp+dBCpHFjzGlWzMpXSKFlV7z /dcXF8Qzrse3EWOSB9OvkspgLMTA7csjJ4NSiaOQ7wbog4dt20YZoC7ZPYauU32jyow/ gz8jl8Z6HQqzfnwxqHEkRS7Y4L96hb1CYG36S7St9SW08olM/UMLOZ7bWc7kc5humg3n dskJqqaSyBep9o93tbF3CfJ9YHzMChcpgES9Rpl9SL0aEn3HM1AyrQuQTSMhYw/EQshG RIzfTM+e1eERxG4+ck5oo59erGisucI1ZtjKBV5+6X/4cUhy7Ki561uRYgr7/OH4prRI M0DQ== X-Forwarded-Encrypted: i=1; AJvYcCV6JE1pY0tqzunGQorFi7wfbwmtkOBppv9wkIRHVzw0bW7t/mAP8nVf8R66yefTIOxTpKge4uRsoBltziU=@vger.kernel.org X-Gm-Message-State: AOJu0Yygc/rJrIJAYKzHg3M8L0RBsmHhI/PDLmcespEMNp8lISlyLXdw 3bulnMWFJEXl1m6q1VPUaVI0UWzM502LMhwF1EJ9dISsHbg5rSj7OWlU2hl6JSxKBaLnH7LwnvY keDUyeA== X-Google-Smtp-Source: AGHT+IEVPv++CcNWV2sW0QiDjD2p2AvLdb5RBh0+M72kaH92cSzSHfGJK9aCnIfjTTtPv8O3gsPnENjpCNc= X-Received: from plkq3.prod.google.com ([2002:a17:902:edc3:b0:298:321b:1fa8]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:d60d:b0:27d:c542:fe25 with SMTP id d9443c01a7336-2986a7509eamr129818835ad.41.1763404501920; Mon, 17 Nov 2025 10:35:01 -0800 (PST) Date: Mon, 17 Nov 2025 10:35:00 -0800 In-Reply-To: <176254658743.821204.2042588290407024138.b4-ty@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20251030224246.3456492-1-seanjc@google.com> <176254658743.821204.2042588290407024138.b4-ty@google.com> Message-ID: Subject: Re: [PATCH 0/4] KVM: x86: Cleanup #MC and XCR0/XSS/PKRU handling From: Sean Christopherson To: Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Jon Kohler Content-Type: text/plain; charset="us-ascii" On Mon, Nov 10, 2025, Sean Christopherson wrote: > On Thu, 30 Oct 2025 15:42:42 -0700, Sean Christopherson wrote: > > This series is the result of the recent PUCK discussion[*] on optimizing the > > XCR0/XSS loads that are currently done on every VM-Enter and VM-Exit. My > > initial thought that swapping XCR0/XSS outside of the fastpath was spot on; > > turns out the only reason they're swapped in the fastpath is because of a > > hack-a-fix that papered over an egregious #MC handling bug where the kernel #MC > > handler would call schedule() from an atomic context. The resulting #GP due to > > trying to swap FPU state with a guest XCR0/XSS was "fixed" by loading the host > > values before handling #MCs from the guest. > > > > [...] > > Applied to kvm-x86 misc, thanks! > > [1/4] KVM: SVM: Handle #MCs in guest outside of fastpath > https://github.com/kvm-x86/linux/commit/6e640bb5caab > [2/4] KVM: VMX: Handle #MCs on VM-Enter/TD-Enter outside of the fastpath > https://github.com/kvm-x86/linux/commit/8934c592bcbf > [3/4] KVM: x86: Load guest/host XCR0 and XSS outside of the fastpath run loop > https://github.com/kvm-x86/linux/commit/3377a9233d30 > [4/4] KVM: x86: Load guest/host PKRU outside of the fastpath run loop > https://github.com/kvm-x86/linux/commit/7df3021b622f I've dropped these for now as patch 2 broke TDX. I'll send a v2 shortly.