From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f74.google.com (mail-pj1-f74.google.com [209.85.216.74]) (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 E498E15CD7E for ; Wed, 4 Feb 2026 01:16:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770167794; cv=none; b=Rhimdik5CCtYkTtEqxKWVE4Qt9vHleZXLO4tIlZg3CNFyybvzB61XpybGZFVyoSdoZNFD2l0em8TZl2g1abSNdA7YlMWQnK7CpY3wu4VeVdZR5Ua1WxorZhRFuwov/Y1yto37iytrncbVklzsSPPV6yqu6ZJr1CKC6gNuJzaCt4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770167794; c=relaxed/simple; bh=ChG3/8B1IJ9YT6VcPtOFh51Ez1qY+VBv1xR91btVjlQ=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=eJJVEWPw7+88TrZysk2fcNy+1Hd+2RpguSiMG7OlYORBh5oHfgQqIGXjnmEIh2XA9ECznh851q1YqW/O/c4FYNOfUzYCfX4OXID9MtCyHTGYyh4L+41Ahj3vefFJ7nlPL7w+B6mxnY+fOsReM4qnYoEwotCA1bw2QYrQnffu4rI= 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=ew+HJTEz; arc=none smtp.client-ip=209.85.216.74 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="ew+HJTEz" Received: by mail-pj1-f74.google.com with SMTP id 98e67ed59e1d1-34ab8693a2cso14374143a91.0 for ; Tue, 03 Feb 2026 17:16:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1770167792; x=1770772592; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=mEfaDVPh64vLaMwr0r7Iy/qbZqBS6ygDFXVfCEVBmSo=; b=ew+HJTEzAr3yCbKZKM/ey7QB7nz3tlkQatjds68+kgJ3v9P29PEVisZhTii+e5Dj+e hh0PCDsR6+iT+ZP+V0bVup/ficMLXvjyT1WPEs31HDKqCiZrcrMSR4X0o2hL8SYYCCZC 17d12SwVetKlS7lrfS/UkU2DBmAl5aVtYGyJaWucoB/XHqUqDkvIf8Waa27M/K26ku0w oasutRzbhOq0wjXfB8bhkSo3vf8Rbag/n/dHzkUDnYtCb94vZQH/VZ4WT1vlnzgGs2yi sdrGh0r2m6TPkuiIzqHOmgBKHNfB9WA50dcARpM4J5qZm7gp+qpZrIiK8soa5xTwcmJG U/JA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770167792; x=1770772592; h=content-transfer-encoding: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=mEfaDVPh64vLaMwr0r7Iy/qbZqBS6ygDFXVfCEVBmSo=; b=foSM4g7EjyE4D8WJ2k2BFZGUNZPF9Aqj1Xk2BvCijREEBwil2yTSyr8GkUBMpF1SOp of8eXMgLjUrM40SLYG/rnxQfyQz2HBWtYcYyo9WL84iE+n7LOvIgK+q6sVJON90jFUc+ 0EzU+miAD0rgnPa1ePwvNKkC8P+uOvXlpfaWGQzrcB670q/vPU3pVeDT2VDaRD5rCWQE Z5bmoqBZ9OlItn+EChWuxCa2psnp52z3rKNiwlcDaVYJi/ROGiS5YcwRBjR8Nl+eh508 +iUufdC7bAeP+DAxZjwbFYJtyJyL5hGRMjKJlTQRmuSTSO5ow/ktOObXaBp+iM29S2Nb bOIg== X-Forwarded-Encrypted: i=1; AJvYcCUiPNUqF2YdSooSj11svdRQixgEsFs43OrWvyLo+AsyNsJ2hS9SBubaKxIpdWybphFx22wOLCtol23nyq0=@vger.kernel.org X-Gm-Message-State: AOJu0Ywrbw9f3Dt3hB3PKxQV2YzKUd8KCXxUdQdx9ft9lwxh3XR6X5e3 1rOQOXOu/FD0jVynoxGFxdon/Pvk5GbajIy13TQwCJvfMbzp9Dhyj+cBuUwnSoqrRlWnsWVe0lf yNO85rA== X-Received: from pjro9.prod.google.com ([2002:a17:90a:b889:b0:34c:567d:ede4]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:270d:b0:34e:808c:95eb with SMTP id 98e67ed59e1d1-354871bef6bmr1029972a91.32.1770167792234; Tue, 03 Feb 2026 17:16:32 -0800 (PST) Date: Tue, 3 Feb 2026 17:16:30 -0800 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260129011517.3545883-1-seanjc@google.com> <20260129011517.3545883-5-seanjc@google.com> Message-ID: Subject: Re: [RFC PATCH v5 04/45] KVM: x86: Make "external SPTE" ops that can fail RET0 static calls From: Sean Christopherson To: Rick P Edgecombe Cc: "kvm@vger.kernel.org" , "linux-coco@lists.linux.dev" , Kai Huang , Xiaoyao Li , Yan Y Zhao , "dave.hansen@linux.intel.com" , "linux-kernel@vger.kernel.org" , "kas@kernel.org" , "mingo@redhat.com" , "pbonzini@redhat.com" , "binbin.wu@linux.intel.com" , "ackerleytng@google.com" , Isaku Yamahata , "sagis@google.com" , "tglx@kernel.org" , "bp@alien8.de" , Vishal Annapurve , "x86@kernel.org" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Fri, Jan 30, 2026, Rick P Edgecombe wrote: > On Thu, 2026-01-29 at 17:28 -0800, Sean Christopherson wrote: > >=20 > > Hmm, that's probably doable, but definitely in a separate patch.=C2=A0 > > E.g. something > > like: >=20 > I think it would be a good change. But after more consideration, I > think the original patch is good on its own. Better to turn a bug into > a deterministic thing, than an opportunity to consume stack. Seems to > be what you intended. >=20 > Another idea would be to have a variant that returns an error instead > of 0 so the callers can have there error logic triggered, but it's all > incremental value on top of this. I don't like that idea, at all. First and foremost, I don't want to litter= KVM with WARNs for things that simply can't happen. I'm fine adding infrastruc= ture that hides the sanity checks, but I don't want to bleed that into callers. The other aspect I dislike is that returning a specific errno could lead to= all sorts of weirdness and hidden dependencies. All in all, I think we'd be increasing the chances of creating bugs just to= harden against issues that in all likelihood will never happen.