From nobody Mon Feb 9 21:18:57 2026 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 B9402326927 for ; Thu, 29 Jan 2026 01:15:35 +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=1769649337; cv=none; b=psh9SPPXWxEcU2a/LBDg2KIhDvhK0ggnxy2421vWBbCjHXuNQD1RNJRezUBEqA1203PqyBf9DLhf7u6ICExN5sE0lhYJLMMd9vrEwIhpAYGwBmQ5v0rq9XllIMiq9HbALFojQWXj8wjxkcUd7TLcuj2aH74e9qVSplGp0nOfwJg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769649337; c=relaxed/simple; bh=i+BaQipwcwIk83xd9q3EaqDNGVAGV/ShuF7c8g62crA=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=SrS7XnFMCJ6xSvx8IgqK5LsLTcvS4h71NssEVbgOS4Z0x4TnzQ8MdtQb/1+K8GWTRqUaO3AwfFwGQy7aHteQ+fcTDC5mBuho34xu4ggYZPZuMsLPicPLkI1d8a++DGn+es20XSB07bq4KD0UEXpVwWiKOcMV/+q249plOR5C9Q8= 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=0UsIwRae; 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="0UsIwRae" Received: by mail-pj1-f74.google.com with SMTP id 98e67ed59e1d1-352c7924ebcso380771a91.3 for ; Wed, 28 Jan 2026 17:15:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1769649335; x=1770254135; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=7CglUg76d+5MQRtd6QcMDKkRS3BGZoZjOLZ6NJir0yk=; b=0UsIwRaeBsjtSch/Ppnq8Y9B2FLg+XUcIqJJhbAD280Uv7WFo2iePwEAlL/KNW1Hch 0x5mC+UACTra/Ja2iglZxoveEa9DWoL+TB/10HXJQ2v6pMdEA/3XqxMxcdzjkjOhyBhT yxKB0TpMUgC990yN99Pc/sKy5ZCnuD5jtnIrW4smXPt6DwiJtMK4EdqOH684LqyF5oF2 AKd2KjP3El4q6nPzlY0VhQuV0K67mwyhaC33r4JQdm5QxuorRlh1NmYwpRxvBEcsvlUb byVuFpIhhjfSZO2+pBF//bRhPZt3HvOgldEC8+jFhVg7MG8nBXICx8RgZ3IKYadlyK+W jUBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769649335; x=1770254135; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7CglUg76d+5MQRtd6QcMDKkRS3BGZoZjOLZ6NJir0yk=; b=LEwwNueSxxj7GR58RE8u1nFwBnAsZSXnvpcPEKbj+W7GXjphg796lOBMSD2JxvjYiH jeOGGGYb5HSI+H8BdC/H5mFrRVj9NPJPnGZlXdTjaYlAzUPFpoSd9rVJe3YKuGUGe47J GHyXhPhdbzsCSFrFGTSOCSvhPR8aRBrPwTue3SFpsZmr9OPJc8jhcbWP/yUuFfhKfLT7 CWzCzhpSmaJErPVK6cwsDQTluwO9K6sn3w0ciRArxwAlw+AerIEXR/+4AYsw+hDZLa5F d6Gqai1Flz/vTE23CHgW4pWwWPauo3Wt4ai/KCy7uU8+JJWFHNvdD/2GUj46VvOaYTPd O5NQ== X-Gm-Message-State: AOJu0YxuiL6jJUTuFaupi+dImYF56pvcZkUES8xDeHvla90R0sgLbMKT qXETwXtPCuk0cIXQ3dFoVTp736ae9mePAYRb7p1Ih9O9zxfIlB+pFNWDsIPu2l3zP7lBnzYIJD+ LIZfOtQ== X-Received: from pjbft8.prod.google.com ([2002:a17:90b:f88:b0:352:bd7e:99e7]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:314d:b0:340:ecad:414 with SMTP id 98e67ed59e1d1-353fed8797emr5977548a91.27.1769649335221; Wed, 28 Jan 2026 17:15:35 -0800 (PST) Reply-To: Sean Christopherson Date: Wed, 28 Jan 2026 17:14:36 -0800 In-Reply-To: <20260129011517.3545883-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: <20260129011517.3545883-1-seanjc@google.com> X-Mailer: git-send-email 2.53.0.rc1.217.geba53bf80e-goog Message-ID: <20260129011517.3545883-5-seanjc@google.com> Subject: [RFC PATCH v5 04/45] KVM: x86: Make "external SPTE" ops that can fail RET0 static calls From: Sean Christopherson To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Kiryl Shutsemau , Sean Christopherson , Paolo Bonzini Cc: linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, kvm@vger.kernel.org, Kai Huang , Rick Edgecombe , Yan Zhao , Vishal Annapurve , Ackerley Tng , Sagi Shahar , Binbin Wu , Xiaoyao Li , Isaku Yamahata Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Define kvm_x86_ops .link_external_spt(), .set_external_spte(), and .free_external_spt() as RET0 static calls so that an unexpected call to a a default operation doesn't consume garbage. Fixes: 77ac7079e66d ("KVM: x86/tdp_mmu: Propagate building mirror page tabl= es") Fixes: 94faba8999b9 ("KVM: x86/tdp_mmu: Propagate tearing down mirror page = tables") Signed-off-by: Sean Christopherson Reviewed-by: Kai Huang Reviewed-by: Rick Edgecombe --- arch/x86/include/asm/kvm-x86-ops.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/include/asm/kvm-x86-ops.h b/arch/x86/include/asm/kvm-= x86-ops.h index de709fb5bd76..c18a033bee7e 100644 --- a/arch/x86/include/asm/kvm-x86-ops.h +++ b/arch/x86/include/asm/kvm-x86-ops.h @@ -94,9 +94,9 @@ KVM_X86_OP_OPTIONAL_RET0(set_tss_addr) KVM_X86_OP_OPTIONAL_RET0(set_identity_map_addr) KVM_X86_OP_OPTIONAL_RET0(get_mt_mask) KVM_X86_OP(load_mmu_pgd) -KVM_X86_OP_OPTIONAL(link_external_spt) -KVM_X86_OP_OPTIONAL(set_external_spte) -KVM_X86_OP_OPTIONAL(free_external_spt) +KVM_X86_OP_OPTIONAL_RET0(link_external_spt) +KVM_X86_OP_OPTIONAL_RET0(set_external_spte) +KVM_X86_OP_OPTIONAL_RET0(free_external_spt) KVM_X86_OP_OPTIONAL(remove_external_spte) KVM_X86_OP(has_wbinvd_exit) KVM_X86_OP(get_l2_tsc_offset) --=20 2.53.0.rc1.217.geba53bf80e-goog