From owner-freebsd-bugs@freebsd.org Thu Dec 14 22:29:28 2017 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F87DE92105 for ; Thu, 14 Dec 2017 22:29:28 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D1517C8E5 for ; Thu, 14 Dec 2017 22:29:28 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id vBEMTRnu030288 for ; Thu, 14 Dec 2017 22:29:27 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 224350] [PATCH] powerpc64: Add handler for Facility Unavailable Date: Thu, 14 Dec 2017 22:29:28 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: gromero@br.ibm.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status keywords bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Dec 2017 22:29:28 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D224350 Bug ID: 224350 Summary: [PATCH] powerpc64: Add handler for Facility Unavailable Product: Base System Version: CURRENT Hardware: powerpc OS: Any Status: New Keywords: patch Severity: Affects Some People Priority: --- Component: kern Assignee: freebsd-bugs@FreeBSD.org Reporter: gromero@br.ibm.com Keywords: patch Created attachment 188843 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D188843&action= =3Dedit Patch for this bug Currently Facility Unavailable is absent and once an application tries to use or access a register from a feature disabled in the CPU it causes a kernel panic.=20 A simple test-case is: #include int main() { asm volatile ("tbegin.;"); } which will use TM (Hardware Transactional Memory) feature which is not supported by the kernel and so I'll trigger the following panic: fatal user trap: exception =3D 0xf60 (unknown) srr0 =3D 0x10000890 srr1 =3D 0x800000000000f032 lr =3D 0x100004e4 curthread =3D 0x5f93000 pid =3D 1021, comm =3D htm panic: unknown trap cpuid =3D 40 KDB: stack backtrace: #0 0x59d1c8 at ??+0 #1 0x59d264 at ??+0 #2 0x959490 at ??+0 #3 0x95a94c at ??+0 #4 0x94ea4c at ??+0 Uptime: 3m18s Dumping 10 MB (3 chunks) chunk 0: 11MB (2648 pages) ... ok chunk 1: 1MB (24 pages) ... ok chunk 2: 1MB (2 pages)panic: IOMMU mapping error: -4 cpuid =3D 40 Uptime: 3m18s This commit fixes that state by adding a handler for Facility Unavailable exception (0xF60), treating the instruction that trigged the exception as an illegal instruction. --=20 You are receiving this mail because: You are the assignee for the bug.=