Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5367936imm; Sun, 26 Aug 2018 18:09:34 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYDngPHtg742YoXG2hmohZ9yfjdPre5c4sw91pO/cdIQfDOktswP9SsylETK3BbYJJwQY53 X-Received: by 2002:a63:24c3:: with SMTP id k186-v6mr10279537pgk.162.1535332174441; Sun, 26 Aug 2018 18:09:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535332174; cv=none; d=google.com; s=arc-20160816; b=q50rSM5/U1zIGT9xFZhwnnlCDaatKWUdubjfuGhlCFLUDKkAdUh8gX5oyNlnMZPx/U EnQIPS4OOQjkG2P3ildxzJO7tc4gh4DZRu1kvDaDzAdNvINIgD0SudPhZ+QDXT43ZaQd NtvFXr5uYz7nTP4Nev+lgpVZV+QeLreRhaCZqLflscryGBFiBq5rSI84okO6+agnJctH +0y5I/gvqyJnRObYdLB2W0cSEDvF1bQYF++So5PdgLPHfdlvHo2GIM+lLUQh3c4fNzcq LKJzRQLe2Ex/PIdEjE86ERK8WMDbk88b/JzsDQr3qyhyy/Tl0hii+Lms8cmN/HaJ/Q03 MFvg== 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:arc-authentication-results; bh=LQhIXkyLctqpkzxky+cIJOImokRXenw6JapRRkln3K0=; b=th6dHozg0qioLmOC4j1XxODfs5W8yQpSqgkdxMsrwaHUEWaai65K8BB24ko3V8Hs6y 8eyH4r9aIp8konqUy145gmaNX/Ddokfm22ueVWz5G1B2Fr228z3xSbsT4qrpd6Ur7rFa hengtIQJ/0lVoxYaPOitUcwh3XVzyy6GH2/tvYW6X6Yi0W3zmnnURbScre+vXJvmRa10 KR4OsvAsnpaYUd4kj0ozeO5lZVrntl4t7ohM+fhr0wY5s1B4gDXGo8g1Vdtt+2tzTcKx /5LavXSIJgmH8SMYWQwlQyXb2hFh30u+uXN1Ox6OIatVPXUY882+E327YM4hJyGxHLDS ALsg== 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 j21-v6si12696492pgl.8.2018.08.26.18.09.18; Sun, 26 Aug 2018 18:09:34 -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 S1726968AbeH0Ewb (ORCPT + 99 others); Mon, 27 Aug 2018 00:52:31 -0400 Received: from exmail.andestech.com ([59.124.169.137]:42841 "EHLO ATCSQR.andestech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726825AbeH0Ewb (ORCPT ); Mon, 27 Aug 2018 00:52:31 -0400 Received: from mail.andestech.com (atcpcs16.andestech.com [10.0.1.222]) by ATCSQR.andestech.com with ESMTP id w7R15dgd025304; Mon, 27 Aug 2018 09:05:39 +0800 (GMT-8) (envelope-from alankao@andestech.com) Received: from atcsqa06.andestech.com (10.0.1.85) by ATCPCS16.andestech.com (10.0.1.222) with Microsoft SMTP Server id 14.3.123.3; Mon, 27 Aug 2018 09:08:01 +0800 From: Alan Kao To: , , "Palmer Dabbelt" , Albert Ou , Christoph Hellwig , Andrew Waterman , Arnd Bergmann , Darius Rad CC: , , , , Alan Kao Subject: [PATCH v7 0/5] riscv: Add support to no-FPU systems Date: Mon, 27 Aug 2018 09:07:50 +0800 Message-ID: <1535332075-5727-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.1.85] X-DNSRBL: X-MAIL: ATCSQR.andestech.com w7R15dgd025304 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 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.18.0