From nobody Fri Dec 19 19:16:42 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 180881AC891 for ; Mon, 26 May 2025 20:45:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748292337; cv=none; b=rZbhpxqw03tq0N8X0j+KO8OxbsUrLorLUAuDgOw/OcDUSNX/AdBy81BkPp5mHf/w+QjS7mGTwgBZeDze4t23lqUM740kggmY1VLvu2nYIgIzFT5IMbC4g6NVKlC0wmqBiyBz6P28jhHoRUVxCyNqKCqpwZ0NcucGzuh0X4G6MxU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748292337; c=relaxed/simple; bh=YzVfqM7isCpur9lKuyl8+MnXjqPSAYoEufr181o/ojU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=VRsXxHpfc5XWJ3vKHA2bG/VQcCJcpuwq1qAI9GWClbOiXV3/Z8Sz45x0INIWGgYGm8h0/WbFsZG8pdzfs5aG2X3P7fqUl0xZomdxORqQ2TqAT6EhfYijwuOUUA8IwuM5rSuZBFXXKVZFj7LsYQ5woiqk9NbdBX9/agw7qSFr6/s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=JHYMzsmu; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="JHYMzsmu" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748292332; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hwbp3hCpje483Sa0qCp5UGHnKUUud+4LtTTy2eYUPhE=; b=JHYMzsmuxCX/pa296sTMQYOWAak8Yz5Xs1rUssH2cgnJ2Gm/J9IyrnqejANm/Ca96crEfv X1SrvI1nAb5DpKlVOq8McxlGCZWV4E+sWsrN5p14ydOydTfQBjnAxRbMdBvWsg2bFFLaGT bw6aXhpid56Bv+cQ2TPPELNGwyFw1+k= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-153-CRjVJVarN0S7xBTdGm2FGA-1; Mon, 26 May 2025 16:45:26 -0400 X-MC-Unique: CRjVJVarN0S7xBTdGm2FGA-1 X-Mimecast-MFC-AGG-ID: CRjVJVarN0S7xBTdGm2FGA_1748292325 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 022C319560B1; Mon, 26 May 2025 20:45:25 +0000 (UTC) Received: from virtlab1023.lab.eng.rdu2.redhat.com (virtlab1023.lab.eng.rdu2.redhat.com [10.8.1.187]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 33F9A19560A3; Mon, 26 May 2025 20:45:24 +0000 (UTC) From: Paolo Bonzini To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: kernel test robot , Xiaoyao Li Subject: [PATCH] x86/tdx: mark tdh_vp_enter() as __flatten Date: Mon, 26 May 2025 16:45:23 -0400 Message-ID: <20250526204523.562665-1-pbonzini@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 Content-Type: text/plain; charset="utf-8" In some cases tdx_tdvpr_pa() is not fully inlined into tdh_vp_enter(), which causes the following warning: vmlinux.o: warning: objtool: tdh_vp_enter+0x8: call to tdx_tdvpr_pa() lea= ves .noinstr.text section This happens if the compiler considers tdx_tdvpr_pa() to be "large", for ex= ample because CONFIG_SPARSEMEM adds two function calls to page_to_section() and __section_mem_map_addr(): ({ const struct page *__pg =3D (pg); \ int __sec =3D page_to_section(__pg); \ (unsigned long)(__pg - __section_mem_map_addr(__nr_to_section(__sec= ))); \ }) Because exiting the noinstr section is a no-no, just mark tdh_vp_enter() for full inlining. Reported-by: kernel test robot Analyzed-by: Xiaoyao Li Closes: https://lore.kernel.org/oe-kbuild-all/202505240530.5KktQ5mX-lkp@int= el.com/ Signed-off-by: Paolo Bonzini Acked-by: Kai Huang Tested-by: Kai Huang --- arch/x86/virt/vmx/tdx/tdx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/virt/vmx/tdx/tdx.c b/arch/x86/virt/vmx/tdx/tdx.c index f5e2a937c1e7..2457d13c3f9e 100644 --- a/arch/x86/virt/vmx/tdx/tdx.c +++ b/arch/x86/virt/vmx/tdx/tdx.c @@ -1517,7 +1517,7 @@ static void tdx_clflush_page(struct page *page) clflush_cache_range(page_to_virt(page), PAGE_SIZE); } =20 -noinstr u64 tdh_vp_enter(struct tdx_vp *td, struct tdx_module_args *args) +noinstr __flatten u64 tdh_vp_enter(struct tdx_vp *td, struct tdx_module_ar= gs *args) { args->rcx =3D tdx_tdvpr_pa(td); =20 --=20 2.43.5