Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4293163imm; Mon, 8 Oct 2018 19:20:24 -0700 (PDT) X-Google-Smtp-Source: ACcGV63dQgYdVPN8rOb+KyU6a6gq+bl6PZ5IFpweA5KMWr8c89MIMYteUoH41Bgfe0SUTddb+e+4 X-Received: by 2002:a62:1e83:: with SMTP id e125-v6mr27728646pfe.231.1539051624781; Mon, 08 Oct 2018 19:20:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539051624; cv=none; d=google.com; s=arc-20160816; b=mJpxPpO/mcIcbMMHxHCZLnePvRVJ05H4nRSWUxLiWIr/2A8A5KQHS+LrABoMFaosJY odfSVO3obL0Nl4p3LV7rwerIN49e/k9CFj4PxwdoAt7qD5hAkWk2AjkqJX0DmRWGknkL rlFx20fyGAM7Csk9VHw5BMHd0wTVvCgbXHm3ATHwIrxvBaKdNlaKdHUL/J/I0kl7TbQu h7Zt9cmSlyDVYTd5Y3WtR8ApLq8/UlBnyQ3lBFz2Al3rWHXVL+iz0CI/VuH9/QQibrE2 PzSd6y1ipIdU8xQL3dJpNmuoRLvS8jnrcgXonzfwcCRwktY47EZpjJuogeuFWz6SJak9 YT7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=fKmBAMuJlBTSzYgvD/ICpsEwXDwZWSXM80/9uBoSXwY=; b=d7hzZtG6r/loSabTNju/3JdkcsTPjasjFbPdAb1xcFO66SmjYW/YdP2CW4pk5ruROM xufOhPyvGtW4MEZddVuigb9aIeFpUdlVZvSaoZ/bNWxtHsjOxAo0oLyIf7ppT0u6LVF2 1v9WLn8epRETBcyLPHdjKhSPngeyeoaV+iZ5tFuYQgdKJSVP8dKI4vip/oSyZFOc2cGc x7ZlpqDVWSzICwHHYQ+rtTyIe4zBl8Ri4KPC7v5JdpGB/tPG+j2seCnQOoO3qy2fshRD XAz3DRItna3ShoOkAw3w/bIjU/HbmCykUoupmXlgec1DuBqOuCbDSFFF0e6aoDy6KU39 D3nA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o19-v6si19671847pgd.164.2018.10.08.19.20.10; Mon, 08 Oct 2018 19:20:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726799AbeJIJeY (ORCPT + 99 others); Tue, 9 Oct 2018 05:34:24 -0400 Received: from 59-120-53-16.HINET-IP.hinet.net ([59.120.53.16]:58596 "EHLO ATCSQR.andestech.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726452AbeJIJeY (ORCPT ); Tue, 9 Oct 2018 05:34:24 -0400 Received: from mail.andestech.com (atcpcs16.andestech.com [10.0.1.222]) by ATCSQR.andestech.com with ESMTP id w992Lha0032580; Tue, 9 Oct 2018 10:21:43 +0800 (GMT-8) (envelope-from alankao@andestech.com) Received: from atcsqa06.andestech.com (10.0.15.65) by ATCPCS16.andestech.com (10.0.1.222) with Microsoft SMTP Server id 14.3.123.3; Tue, 9 Oct 2018 10:19:01 +0800 From: Alan Kao To: Palmer Dabbelt , , , Christoph Hellwig CC: Greentime Hu , Vincent Chen , Zong Li , Nick Hu , Alan Kao Subject: [PATCH v8 0/5] riscv: Add support to no-FPU systems Date: Tue, 9 Oct 2018 10:18:29 +0800 Message-ID: <1539051514-3658-1-git-send-email-alankao@andestech.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.0.15.65] X-DNSRBL: X-MAIL: ATCSQR.andestech.com w992Lha0032580 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patchset adds an option, CONFIG_FPU, to enable/disable floating- point procedures. Kernel's new behavior will be as follows: * with CONFIG_FPU=y All FPU codes are reserved. If no FPU is found during booting, a global flag will be set, and those functions will be bypassed with condition check to that flag. * with CONFIG_FPU=n No floating-point instructions in kernel and all related settings are excluded. Changes in v8: - Fix a build fail introduced in v7. Changes in v7: - Remove "fd" attribute from KBUILD_CFLAGS. Changes in v6 (PATCH 0005 only): - Make the flag checking neater. Changes in v5: - Invert the polarity of checking flag from no_fpu to has_fpu. Changes in v4: - Append a new patch to detect existence of FPU and followups. - Add SPDX header to newly created fpu.S. - Fix a build error, sorry for that. - Fix wording, style, etc. Changes in v3: - Refactor the whole patch into independent ones. Changes in v2: - Various code cleanups and style fixes. Alan Kao (5): Extract FPU context operations from entry.S Refactor FPU code in signal setup/return procedures Cleanup ISA string setting Allow to disable FPU support Auto-detect whether a FPU exists arch/riscv/Kconfig | 9 ++++ arch/riscv/Makefile | 19 +++---- arch/riscv/include/asm/switch_to.h | 12 ++++- arch/riscv/kernel/Makefile | 1 + arch/riscv/kernel/cpufeature.c | 8 +++ arch/riscv/kernel/entry.S | 87 ------------------------------ arch/riscv/kernel/fpu.S | 106 +++++++++++++++++++++++++++++++++++++ arch/riscv/kernel/process.c | 6 ++- arch/riscv/kernel/signal.c | 75 ++++++++++++++++---------- 9 files changed, 196 insertions(+), 127 deletions(-) create mode 100644 arch/riscv/kernel/fpu.S -- 2.7.4