From nobody Sat Mar 7 03:59:33 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4fSV0B5gJKz6V1V3 for ; Sat, 07 Mar 2026 03:59:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fSV0B3JLmz3HPJ for ; Sat, 07 Mar 2026 03:59:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1772855978; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4PT7+w3JMpwr04lrxlUZt3Iquk2kK08vkjcXmyZeiIU=; b=cx0fZ2+OqdB/PsLcPVIVVabf/A/TPFFTuU/OXD5dIHDhh+VhbNMZbM8zWoZUn8IeLb4SDl Y+JgD8LnacpPXcMizinD23Z3h5v0Q3bdv3IMXrIZcLB7rltl8SWqlKw1qOAsj6DI2Elwsh PG5kIUPNOx81uL/OqBBSf4l907SqhT7xtC9kri9SPmiyNUgs0S4F7bhwPhJCOTChawzyBx 9OjXkXcx54IycIQV0zqFfpzOvU1+b94TCp0jXNcQ3+7loqo8Tn8i9IIxt9x9ZvvFV5dGlD XKzC2nbIXPLCdQnGtUyXUTs/bO+S77xJQqjBN07xMqglofG3dWUvoR+TGgWvAQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1772855978; a=rsa-sha256; cv=none; b=FGusIvua6CPVpLcB8bYqt/Rfh97QENODdx+z2aT/i8oQ52rB4CPkWvumB7cUINMgbJckWk G4LZdIYPrgwyvcRwvsttBWSBaeRhigtonMZnJxxFUWCbbcFT4TtP7uo+OiSXqsfVwSfKLs 8bclLQx+nKjbASVIC8jNKBausRI0aPmUHH2F04rDdXc/XxovJGV0zZ8LkT8z3l9SjuELgQ t1Yr1in6x5swGyTAbVXLoELXGUHOUBxWfGA9F1eRTmrTovn5IyXvqUcjxTI4wJ2Fh0MavT cEhDlc21ueJK53kiMAEzVAPFcl/A9wK8wngQgCxa2jC9KefOUvbrSpTKm9bw0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1772855978; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4PT7+w3JMpwr04lrxlUZt3Iquk2kK08vkjcXmyZeiIU=; b=nHZzySJacTo4p+QJPEcQPWMyePxruoeFqznU+wp0G3JM2VQzH0CLsoHDJogiz9g9gRsvDF FxwgV++cXA5YL4z6xhCaxazjbXNGccKGP/VvPGAJJA1Fr8VKgFUqMQATpLwf/ZbP3d9izA UT2mv81Q9Aj0ishSCqqSyoI5xc2dbYlX4GRMPuxZYxjX0rkojtVHE0k6Jw5IpdZxpulyQG DfUFw2dxrNj4o0Kf/7MW2hB0qfo/3O3L95yvea9KfTb4reuK0hMo7Wq1uma0poZaOa+yyh zBpbZKXddI0Z4ICR6uFfUM/9h9JsSEohhO1h3dcwrGJZjtP0DdtdubqqqiM/tQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fSV0B2bW5zsYb for ; Sat, 07 Mar 2026 03:59:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3ae2b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 07 Mar 2026 03:59:33 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: fdc1f3450634 - main - x86: change signatures of ipi_{bitmap,swi}_handler() to take pointer List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fdc1f34506346fd26db8bfb80ba69d1af844c53a Auto-Submitted: auto-generated Date: Sat, 07 Mar 2026 03:59:33 +0000 Message-Id: <69aba2a5.3ae2b.2e02c1b5@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=fdc1f34506346fd26db8bfb80ba69d1af844c53a commit fdc1f34506346fd26db8bfb80ba69d1af844c53a Author: Konstantin Belousov AuthorDate: 2026-02-27 03:54:06 +0000 Commit: Konstantin Belousov CommitDate: 2026-03-07 03:58:48 +0000 x86: change signatures of ipi_{bitmap,swi}_handler() to take pointer to the frame instead of the frame itself. It is some stretch of the amd64 ABI, and is not easily fullfilled when handlers are called from C and not asm. In particular, the struct frame is passed by value but is modified by callees, with the expectation that the caller will see the modifications. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D55679 --- sys/amd64/amd64/apic_vector.S | 2 ++ sys/i386/i386/apic_vector.S | 4 ++-- sys/i386/i386/mp_machdep.c | 14 ++++++++++++++ sys/x86/include/x86_smp.h | 4 ++-- sys/x86/x86/mp_x86.c | 10 +++++----- sys/x86/xen/xen_apic.c | 4 ++-- 6 files changed, 27 insertions(+), 11 deletions(-) diff --git a/sys/amd64/amd64/apic_vector.S b/sys/amd64/amd64/apic_vector.S index 8691387a5a8e..c753ddbad9be 100644 --- a/sys/amd64/amd64/apic_vector.S +++ b/sys/amd64/amd64/apic_vector.S @@ -179,6 +179,7 @@ IDTVEC(spuriousint) INTR_HANDLER ipi_intr_bitmap_handler call as_lapic_eoi KMSAN_ENTER + movq %rsp,%rdi call ipi_bitmap_handler KMSAN_LEAVE jmp doreti @@ -220,6 +221,7 @@ IDTVEC(spuriousint) INTR_HANDLER ipi_swi call as_lapic_eoi KMSAN_ENTER + movq %rsp,%rdi call ipi_swi_handler KMSAN_LEAVE jmp doreti diff --git a/sys/i386/i386/apic_vector.S b/sys/i386/i386/apic_vector.S index 5d248409718d..0037f1c968fb 100644 --- a/sys/i386/i386/apic_vector.S +++ b/sys/i386/i386/apic_vector.S @@ -261,7 +261,7 @@ IDTVEC(ipi_intr_bitmap_handler) cld KENTER call as_lapic_eoi - movl $ipi_bitmap_handler, %eax + movl $ipi_bitmap_handler_i386, %eax call *%eax jmp doreti @@ -306,7 +306,7 @@ IDTVEC(ipi_swi) cld KENTER call as_lapic_eoi - movl $ipi_swi_handler, %eax + movl $ipi_swi_handler_i386, %eax call *%eax jmp doreti diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c index 18ec0d83fad3..0913a0f70d14 100644 --- a/sys/i386/i386/mp_machdep.c +++ b/sys/i386/i386/mp_machdep.c @@ -736,3 +736,17 @@ invlcache_handler(void) wbinvd(); PCPU_SET(smp_tlb_done, generation); } + +void ipi_bitmap_handler_i386(struct trapframe frame); +void +ipi_bitmap_handler_i386(struct trapframe frame) +{ + ipi_bitmap_handler(&frame); +} + +void ipi_swi_handler_i386(struct trapframe frame); +void +ipi_swi_handler_i386(struct trapframe frame) +{ + ipi_swi_handler(&frame); +} diff --git a/sys/x86/include/x86_smp.h b/sys/x86/include/x86_smp.h index 045beb3b0f9a..3fa309df1be1 100644 --- a/sys/x86/include/x86_smp.h +++ b/sys/x86/include/x86_smp.h @@ -98,10 +98,10 @@ void init_secondary_tail(void); void init_secondary(void); void ipi_startup(int apic_id, int vector); void ipi_all_but_self(u_int ipi); -void ipi_bitmap_handler(struct trapframe frame); +void ipi_bitmap_handler(struct trapframe *frame); void ipi_cpu(int cpu, u_int ipi); int ipi_nmi_handler(void); -void ipi_swi_handler(struct trapframe frame); +void ipi_swi_handler(struct trapframe *frame); void ipi_selected(cpuset_t cpus, u_int ipi); void ipi_self_from_nmi(u_int vector); void set_interrupt_apic_ids(void); diff --git a/sys/x86/x86/mp_x86.c b/sys/x86/x86/mp_x86.c index 0c32657290a0..66ad23ee957c 100644 --- a/sys/x86/x86/mp_x86.c +++ b/sys/x86/x86/mp_x86.c @@ -1328,14 +1328,14 @@ ipi_send_cpu(int cpu, u_int ipi) } void -ipi_bitmap_handler(struct trapframe frame) +ipi_bitmap_handler(struct trapframe *frame) { struct trapframe *oldframe; struct thread *td; int cpu = PCPU_GET(cpuid); u_int ipi_bitmap; - kasan_mark(&frame, sizeof(frame), sizeof(frame), 0); + kasan_mark(frame, sizeof(*frame), sizeof(*frame), 0); td = curthread; ipi_bitmap = atomic_readandclear_int(&cpuid_to_pcpu[cpu]-> @@ -1353,7 +1353,7 @@ ipi_bitmap_handler(struct trapframe frame) td->td_intr_nesting_level++; oldframe = td->td_intr_frame; - td->td_intr_frame = &frame; + td->td_intr_frame = frame; #if defined(STACK) || defined(DDB) if (ipi_bitmap & (1 << IPI_TRACE)) stack_capture_intr(); @@ -1729,10 +1729,10 @@ cpuoff_handler(void) * Handle an IPI_SWI by waking delayed SWI thread. */ void -ipi_swi_handler(struct trapframe frame) +ipi_swi_handler(struct trapframe *frame) { - intr_event_handle(clk_intr_event, &frame); + intr_event_handle(clk_intr_event, frame); } /* diff --git a/sys/x86/xen/xen_apic.c b/sys/x86/xen/xen_apic.c index 43a253cc2860..c8760545c8e9 100644 --- a/sys/x86/xen/xen_apic.c +++ b/sys/x86/xen/xen_apic.c @@ -217,7 +217,7 @@ static int xen_ipi_bitmap_handler(void *arg) { - ipi_bitmap_handler(*curthread->td_intr_frame); + ipi_bitmap_handler(curthread->td_intr_frame); return (FILTER_HANDLED); } @@ -296,7 +296,7 @@ static int xen_ipi_swi_handler(void *arg) { - ipi_swi_handler(*curthread->td_intr_frame); + ipi_swi_handler(curthread->td_intr_frame); return (FILTER_HANDLED); }