From nobody Thu Feb 19 15:20:40 2026 X-Original-To: virtualization@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 4fGxsP0fB2z6RRWQ for ; Thu, 19 Feb 2026 15:20:41 +0000 (UTC) (envelope-from bugzilla-noreply@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 4fGxsP08NGz3xdf for ; Thu, 19 Feb 2026 15:20:41 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1771514441; 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: in-reply-to:in-reply-to:references:references; bh=6TS2k26tIgWafMLgPVp9jbwt2h00DjNoS1p1IcYHRAc=; b=yB6MMEG/3sjUB/cUwMMGMd2tiX3WDIX61UdsOZQMJr8uBHI6HHK1KnBAhd7NzaJepIhHin QxY9bdV01N9Ut8tkL4JNahdcHx7TQgJDFGuRULAu0d0AXmHSZT0Q4UNyBfSnecarN5bYrs 0Elce2uCwC2LIMXEA4eVy4Ia6KAfHWlQVxlIRt9Rz3w7sL9OupRVN84hFTQcvOIAXRCvQd A1X04ru3T4yOVfqBL3iR6M81yFQ6xHxBimeJ6FXhDw2wYZA5hZlKUhFzjzASUk4AFHKR9E 7vegYEuTzrDllguctKTMtcHi5+sADfit1pBoCVc+nuSwJ4G1osho5316g0K3QA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1771514441; a=rsa-sha256; cv=none; b=Tk3KnBS7sPrldfRsslVvzC6uMEvzVQVpgCYDTB5TAjCZggvJW9nGiOAQDmU03lJKXlLikR YXct3V8XS47lAeHO6bG+A8aZ55GWw2mMO/20l1xKJK1bx7KjFT29v9avJnW4wBvoS2azmV qdBKUpShqehiFUqe/HWx7BNkzdVHPGXvKfEpY1Q+FTudY8/FEV3QSy6hAu3LF6T8U/XJY1 K3Kt0ZdyRVibctyfXGPGkhG25lAycGfZ6bogUywd0GQK1sXgU3UeYLzCt7op/KeCl2sU65 +Ioj/D6VuKK/PWWNXv8b9IEhOsWxgnsoa8P5Ku6kXLclz71BDeLdoakCczHKPg== 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=1771514441; 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: in-reply-to:in-reply-to:references:references; bh=6TS2k26tIgWafMLgPVp9jbwt2h00DjNoS1p1IcYHRAc=; b=ljHeVPSiaRML02yyuZFrMxZ4nGHHV/+moroisUd0fV11ZmgD73AP55Ul3O4VG9XFv45Ylx 2pwcLLLj7+JwTWeux0/qAyxAe5vH4dbJf/nxpW0EIWi2kOzpZN5iFSSO1FRlhjA4PkvJOi iWdERZAH+53qJsuOCGyO+OyGUlk2jMTcS6oYabroY1PEwkAyoD9M1UShK0KlEBOtDPmsdS IbeOzQN2NSqYdCH7Pzy4agyIZb6Mhp3ZoD8rtKnux/M/IPNevbLEmBr/s5TJ1RyiqR9I/B 1Pex/34fCMuNb0YvDVThzun3CE9fSVsvGG8V8ac7SpXfl/vqX/8B57bHmVs3XA== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4fGxsN6nH6znPV for ; Thu, 19 Feb 2026 15:20:40 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 61JFKebh026335 for ; Thu, 19 Feb 2026 15:20:40 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 61JFKexC026334 for virtualization@FreeBSD.org; Thu, 19 Feb 2026 15:20:40 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: virtualization@FreeBSD.org Subject: [Bug 285853] hv_hid: kernel built with -O0 panics in hv_hid_probe() Date: Thu, 19 Feb 2026 15:20:40 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 15.0-CURRENT X-Bugzilla-Keywords: crash X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: zlei@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: virtualization@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Discussion List-Archive: https://lists.freebsd.org/archives/freebsd-virtualization List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-virtualization@freebsd.org Sender: owner-freebsd-virtualization@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D285853 Zhenlei Huang changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |zlei@FreeBSD.org --- Comment #2 from Zhenlei Huang --- (In reply to Lexi Winter from comment #0) > (kgdb) disass hv_hid_probe > Dump of assembler code for function hv_hid_probe: > 0xffffffff83d11000 <+0>: add %al,(%rax) > 0xffffffff83d11002 <+2>: add %al,(%rax) > 0xffffffff83d11004 <+4>: add %al,(%rax) > 0xffffffff83d11006 <+6>: add %al,(%rax) > 0xffffffff83d11008 <+8>: add %al,(%rax) > 0xffffffff83d1100a <+10>: add %al,(%rax) Those disassembly looks weird to me. In x86_64 ABI, the rax register is use= d to stash a return value. Typically a start of a function, say `hv_hid_probe()`= in this case, would like to save registers but not firstly operate on rax. The rax, > rax: ffffffff83d11000 rbx: 000019e97c87cf20 rbp: fffffe0092594790 is the address of the function hv_hid_probe(), but `add %al,(%rax)` want= s to write 1 byte to (%rax) which is absolutely wrong to me. On loading a module, the linker will set write protecting for .text section, hence you got > fault code =3D supervisor write data, protection violation which is a runtime exception. My local kernel config is almost identical with yours, ``` zlei@:~/freebsd-src-releng-15.0 % cat sys/amd64/conf/GENERIC-NOOPT # # GENERIC-NOOPT -- disable compiler optimize # include GENERIC ident GENERIC-NOOPT makeoptions COPTFLAGS=3D"-O0 -fno-strict-aliasing" options KSTACK_PAGES=3D20 ``` And the disassembly looks good to me, ``` zlei@:~ % objdump --disassemble-symbols=3Dhv_hid_probe /usr/obj/usr/home/zlei/freebsd-src-releng-15.0/amd64.amd64/sys/GENERIC-NOOP= T/modules/usr/home/zlei/freebsd-src-releng-15.0/sys/modules/hyperv/hid/hv_h= id.ko /usr/obj/usr/home/zlei/freebsd-src-releng-15.0/amd64.amd64/sys/GENERIC-NOOP= T/modules/usr/home/zlei/freebsd-src-releng-15.0/sys/modules/hyperv/hid/hv_h= id.ko: file format elf64-x86-64 Disassembly of section .text: 0000000000000000 : 0: 55 pushq %rbp 1: 48 89 e5 movq %rsp, %rbp 4: 41 57 pushq %r15 6: 41 56 pushq %r14 8: 53 pushq %rbx 9: 50 pushq %rax a: 48 89 fb movq %rdi, %rbx d: e8 00 00 00 00 callq 0x12 12: 48 89 c7 movq %rax, %rdi 15: 31 f6 xorl %esi, %esi 17: e8 00 00 00 00 callq 0x1c 1c: 41 be 06 00 00 00 movl $0x6, %r14d 22: 85 c0 testl %eax, %eax 24: 75 62 jne 0x88 26: 48 89 df movq %rbx, %rdi 29: e8 00 00 00 00 callq 0x2e 2e: 49 89 c7 movq %rax, %r15 31: 48 8b 08 movq (%rax), %rcx 34: 0f b6 15 00 00 00 00 movzbl (%rip), %edx # 0= x3b 3b: 48 8b 04 d1 movq (%rcx,%rdx,8), %rax 3f: 48 81 38 00 00 00 00 cmpq $0x0, (%rax) 46: 74 17 je 0x5f 48: 48 8d 34 d1 leaq (%rcx,%rdx,8), %rsi 4c: 48 8b b9 00 08 00 00 movq 0x800(%rcx), %rdi 53: 48 c7 c2 00 00 00 00 movq $0x0, %rdx 5a: e8 00 00 00 00 callq 0x5f 5f: 4c 89 ff movq %r15, %rdi 62: 48 89 de movq %rbx, %rsi 65: 48 c7 c2 00 00 00 00 movq $0x0, %rdx 6c: ff 50 08 callq *0x8(%rax) 6f: 85 c0 testl %eax, %eax 71: 75 15 jne 0x88 73: 48 89 df movq %rbx, %rdi 76: 48 c7 c6 00 00 00 00 movq $0x0, %rsi 7d: e8 00 00 00 00 callq 0x82 82: 41 be ec ff ff ff movl $0xffffffec, %r14d # i= mm =3D 0xFFFFFFEC 88: 44 89 f0 movl %r14d, %eax 8b: 48 83 c4 08 addq $0x8, %rsp 8f: 5b popq %rbx 90: 41 5e popq %r14 92: 41 5f popq %r15 94: 5d popq %rbp 95: c3 retq 96: 66 2e 0f 1f 84 00 00 00 00 00 nopw %cs:(%rax,%rax) ``` Can you please also check the disassembly of the module hv_hid.ko ? --=20 You are receiving this mail because: You are the assignee for the bug.=