Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp341535imm; Tue, 7 Aug 2018 20:26:17 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzKiBmZ93vY6BtYz377bH+l4vNo/aJxaCU4Agoy0b7dHagFSjzawMhQ3EN1hlqYTPaQFuIB X-Received: by 2002:a17:902:b58e:: with SMTP id a14-v6mr916435pls.22.1533698777743; Tue, 07 Aug 2018 20:26:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533698777; cv=none; d=google.com; s=arc-20160816; b=uql8WZ2E2PKWJvkvKbiaMD2MljYQLB0S21rhA4gKrl2cqLF4zO0ZqTMmw57OHTH5TW MPrdordTVzGNzpbcX2PxMWExPtEUDfg0UyZe8UczewaizpI+gHR2L6/8MV6f3aQiwVEF CqfQGom8PCpXZgq5v0t4IoMNhLOObEAXT4ySLPpSJEz9ufEjDxIh4DcWp3LxqkiG+sQx gIKrBLIQUm800GFsbodkWFkjSEH8BqBEV0KaZReHPo0ftU0VtBePBI661/SAlfNRDzf7 mM94B9v5tYylLSBFlxDIqEryDtNbE5OLiDKxQUB2/5O7T57o+68kMhnK8wVigxXYxg8R F/Yg== 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=ofrI/5KtjPgPpWF+L1WnL/mTza7myzJjw/6BocXObgs=; b=sJ0V9QHq3vM0FHcw0P7zY+PRePB3e7DDQDeqiVXjLGLxWsp+pIi/z46OEAdITNd86a xdyO+egf9P9UO1Wnw65oLAQSnReePEHlQjAv5WQIQUmn/AWJDQQQbk5/nOPYFO90+lL8 GrzXFbzJDZa+jr1Laa3pcsu1aq1jBREoutsImORL8lKpL0dqWO6Pptd0HDx3bxtT5Bzt NmgHBig7Rkzq2BsWg6U3+2gxcM9VPk1PyYowH4ceqQJMltpwt4qxcKp4G8n73d067FeR 7N5cV4mN1MK70uRLKE0QUgllR9MrOfrCH+p+wWMpKSNSOvOjspf42/tKBKS9x7UN8hx2 BYsw== 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 t19-v6si2730148plj.334.2018.08.07.20.26.02; Tue, 07 Aug 2018 20:26:17 -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 S1726834AbeHHFmg (ORCPT + 99 others); Wed, 8 Aug 2018 01:42:36 -0400 Received: from exmail.andestech.com ([59.124.169.137]:60795 "EHLO ATCSQR.andestech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726258AbeHHFmf (ORCPT ); Wed, 8 Aug 2018 01:42:35 -0400 Received: from mail.andestech.com (atcpcs16.andestech.com [10.0.1.222]) by ATCSQR.andestech.com with ESMTP id w783O420083296; Wed, 8 Aug 2018 11:24:04 +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; Wed, 8 Aug 2018 11:24:52 +0800 From: Alan Kao To: , , "Palmer Dabbelt" , Albert Ou , Christoph Hellwig , Andrew Waterman , Arnd Bergmann , Darius Rad CC: Alan Kao Subject: [PATCH v4 0/5] riscv: Add support to no-FPU systems Date: Wed, 8 Aug 2018 11:24:40 +0800 Message-ID: <1533698685-18022-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 w783O420083296 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 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/hwcap.h | 3 + arch/riscv/include/asm/switch_to.h | 21 ++++++ arch/riscv/kernel/Makefile | 1 + arch/riscv/kernel/cpufeature.c | 11 +++ arch/riscv/kernel/entry.S | 87 ----------------------- arch/riscv/kernel/fpu.S | 106 +++++++++++++++++++++++++++++ arch/riscv/kernel/process.c | 4 +- arch/riscv/kernel/signal.c | 79 +++++++++++++-------- 10 files changed, 214 insertions(+), 126 deletions(-) create mode 100644 arch/riscv/kernel/fpu.S -- 2.18.0