Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp5682543rwe; Tue, 18 Apr 2023 09:59:07 -0700 (PDT) X-Google-Smtp-Source: AKy350bSLsS68FsNXG7OnJS4xZRKKtP2EApdpV3SEVU41asjlj/p/NupmZoKkdEiWNkgeFtXEm7x X-Received: by 2002:a17:902:c410:b0:1a1:f0ad:8657 with SMTP id k16-20020a170902c41000b001a1f0ad8657mr3683251plk.37.1681837146929; Tue, 18 Apr 2023 09:59:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681837146; cv=none; d=google.com; s=arc-20160816; b=ok6MYY7LkanIC7S1TsTlZi/hO18+RGtm0lc8xYDdE2hpoiE8JDBIxCN5AbmT8F/tGG xcbTuEup2iOCGCOlGhHlR6LFT+qlAOqYpNxw1pW74WF3jS692hvHiTMLMv6n64KhUyYA 4Jjy0X7Nj88sBYVnricLDEkS81SwZOPV1YUMGAzE6m9VE7J1BdqxS4GZAbTrg37YWQYx tCX1gF9BVtdIlRt/AxtyDPcHHTQ5OGmrTr0iJV9yaW8+3+L+COi+VhKXN18GaFGyAUHK S6KGyHwm3V7fkM8YvVyBQ4yT01WpHKjZWdkzPsWqRsdDwYDaqVE+vz+qih2hvlVKnIrb ZPGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=qPhxtAgQ/bMNA5WHF5uw25eom2+Kj3BS0BdTTjEj1+Q=; b=G7/cD2EYxIO/9RT5FVDKQBWl7yEJPcG0/bC7nXsRwvLwzQsYTXBaKtfMVFHCtN24qg 0Es1y9Xx0GxM6BZQwlC3/Z6eweWb+zEadFL/i+gygm7GTj5qcWyRoBAVe9hToI++dFUi Podr0MNNC7DBUiaMXWZuOLEhB2DTxVxooIERsf6epU/p5+bZnBkEJsE2o2ocQOgK1zf0 P/y+I2h5Gk3ZwGugQtDeohPIX1Aj33exNKh0Kx8yWeQBmqjuE2PAf/kELIgCglzOqtTJ aAXe90U/D30k0a3SFU+3v7SMTQQBTAbr5rPDPcsgvZGlLlMJpC/Phe6YpR1F21tLnEGC 5gwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=HUHKq9sZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q185-20020a632ac2000000b0051b9a71329fsi6870176pgq.360.2023.04.18.09.58.53; Tue, 18 Apr 2023 09:59:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=HUHKq9sZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231566AbjDRQ6d (ORCPT + 99 others); Tue, 18 Apr 2023 12:58:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230311AbjDRQ6b (ORCPT ); Tue, 18 Apr 2023 12:58:31 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B62F710CA; Tue, 18 Apr 2023 09:58:29 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id he11-20020a05600c540b00b003ef6d684102so185746wmb.3; Tue, 18 Apr 2023 09:58:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681837108; x=1684429108; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=qPhxtAgQ/bMNA5WHF5uw25eom2+Kj3BS0BdTTjEj1+Q=; b=HUHKq9sZ1yGyf2mc1IPIqTKFjj9Hi+aTiYJAq4k8fZ/4GeHAXqZv+fuTNKJk11LsTD pzqfn16ceVx0bbfO/bDZEH7PoEPRFXBLjMbfqF0pSlZK3PfWH/Mwe2FiVK/R5WIeukd9 ZnU+LYlmJsd5XVXlNTLxs+dB+6yM4yGedue+ra5M5RABibNCsI+CWhjWmj0U7c0UBlRK SAnI81t1UEoNvT5TFykfWFysEWExXoaOsAqLhOsmpeg342tF4luJ8vSZX5SpStRNMKVw zy3ledFUAH48uXWxPYeWLASu8Gdie+rm1LSld1hsy2fMw1Eh66OtMMRZo8sGFTgdGWMA oTpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681837108; x=1684429108; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=qPhxtAgQ/bMNA5WHF5uw25eom2+Kj3BS0BdTTjEj1+Q=; b=hXTuNosGZKzbbRbCcaR2h1l8uWUGI3IQVKtzGrTpzc10ntU5U4dBwgl93jDufOHDMr yWkIvtBPBd3l8ohi1EoTBE1VHLfWZfrGeRwx9IlnR3/gL0/PZFw7x7AvmLIOcALKTT+5 l3n3lzc08+/B6fXjBCTxIHCdqWEBpcUs/FZiSW0d3zpKvkMZUkoEx/Cc6SAx7bRTSKzL zKl9z/ig5KTwilcLFyv0r0iJ2dhdJ+GbvebAOd03a86WmmrV1y+f4Vh7GVs175OK2GyD GUzzjj7CgMF7I/i3Lmk7xsirjUhC1s2exo56i99x7C9vSRpM2nM0p0Zq0+4BVbvKCTzu Dqgg== X-Gm-Message-State: AAQBX9cBl0To2hqZmlTt9tA9vJfrpRtFwtz2MHwOeb2loNPPShhGIssm p5C4XudLpGqC/AKuXlgHORdC1QDIJEY= X-Received: by 2002:a7b:ce07:0:b0:3f0:373d:c32b with SMTP id m7-20020a7bce07000000b003f0373dc32bmr14276017wmc.30.1681837107552; Tue, 18 Apr 2023 09:58:27 -0700 (PDT) Received: from localhost (cpc1-brnt4-2-0-cust862.4-2.cable.virginm.net. [86.9.131.95]) by smtp.gmail.com with ESMTPSA id v22-20020a7bcb56000000b003f049a42689sm15501732wmj.25.2023.04.18.09.58.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Apr 2023 09:58:27 -0700 (PDT) From: Stafford Horne To: LKML Cc: Linux OpenRISC , Stafford Horne Subject: [PATCH 0/4] OpenRISC floating point context support Date: Tue, 18 Apr 2023 17:58:09 +0100 Message-Id: <20230418165813.1900991-1-shorne@gmail.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series adds support for storing and restoring the OpenRISC floating point context as well as user space API's and regsets. To support these patches an architecture change had to be made. The OpenRISC fpu status and control register FPCSR is now read/writeable by user space as of architecture spec revision 1.4: - https://openrisc.io/revisions/r1.4 Previous to this FPCSR reads and writes from user-mode would just be ignored, reads and writes to non permissioned special purpose registers (SPR's) are no-ops. The patch is split into 3 main parts, the first patch being a cleanup to handling exceptions noticed while working on this. 1. Add support to context saving and switching 2. Add support for SIGFPE and sigcontext 3. Add regset for ptrace register reading/writing The series has been tested with the glibc test suite and all math tests are passing. Patched projects include: - GCC - patches upstream to fix issue with resetting exceptions in libgcc - glibc - https://github.com/stffrdhrn/or1k-glibc/commits/or1k-hard-float - qemu - https://github.com/stffrdhrn/qemu/commits/or1k-user-fpcsr I have not worked on binutils-gdb patches yet. Stafford Horne (4): openrisc: Properly store r31 to pt_regs on unhandled exceptions openrisc: Support storing and restoring fpu state openrisc: Support floating point user api openrisc: Add floating point regset arch/openrisc/include/asm/ptrace.h | 4 +-- arch/openrisc/include/uapi/asm/elf.h | 3 +- arch/openrisc/include/uapi/asm/ptrace.h | 4 +++ arch/openrisc/include/uapi/asm/sigcontext.h | 1 + arch/openrisc/kernel/entry.S | 31 +++++++++++++---- arch/openrisc/kernel/head.S | 4 +-- arch/openrisc/kernel/ptrace.c | 37 +++++++++++++++++++++ arch/openrisc/kernel/signal.c | 2 ++ arch/openrisc/kernel/traps.c | 27 +++++++++++++-- 9 files changed, 99 insertions(+), 14 deletions(-) -- 2.39.1