Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp6390249imm; Mon, 27 Aug 2018 15:09:01 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZbttWjGKX3l1QB4yzZUmGKuIR8EpYH+Vrw6TD1+BdFruMtba+UEVfVxKJyiAvTB1LmIuVS X-Received: by 2002:a17:902:a983:: with SMTP id bh3-v6mr14643292plb.245.1535407741748; Mon, 27 Aug 2018 15:09:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535407741; cv=none; d=google.com; s=arc-20160816; b=xg8rsXc9mZFCsXvkJh+WiV3djs8BPptFG7Bh4GftHJgGE5KsvuWqa5ViDJlF2vFIoo NhlG9qBEIk5Y+Sz94Nu6FAKLWElFUfz9fjkvweNFLXSXaNqkVpu7GWDQpohAHhH2T6Bs TrtQNMcy10XPXaE1gavqLdwisjCvLzeGG4FDa/ZXRbtRmARkEWrIWRDfn+sn0hazrMf+ rZ4lvkkHzNKIxLhEOD+m0j6e6En1x/qXG5GUTDnaJK0Sax9bViwFzOucHCvdcDtrPh0T USLcTbRpvjQSW5CrfGBVwP8bmHtmnx8WChEmu0R2ZrWvB5jNCYgnFgU6/7IsENcHgcyy aI+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:from:cc:message-id:date:subject :dkim-signature:arc-authentication-results; bh=4+j93ubzSw8/7uEpxIXksyrwXNuz6dUb6W/WXMpeW9s=; b=nkXf5XOzrgs0VBN1SBaSUJAwkJtmze7kPx4Hm+hh5XcJb23+1+gOuZCvuvQ0EdS/jS YO2TkNtdkSh7vF4N2Np5iX4vpuDO3FtDSD6CAt5cPmrnSY3k4xCneqrI6YRV0yU+J+QR K8/Ppc0oq93uGz5UEtdxCguPyJPbpWXDKTck/3vGWEQepWh3FJ1asflrBujS2rDu+PLM /u0NDeTbn3uh2TEwUS08SXzslMK2AdSJvbjnfA3nZMtQELtJ7ictu5ajHgn9sYDVTo+i CLmZuxktf96AKZtdzxspPXiRZpo6r8getgtE4xaEbiFg4UYA5RIC9goK0TpMOw3J/CyO n9yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=OWQxarkL; 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 h8-v6si351712pgd.449.2018.08.27.15.08.32; Mon, 27 Aug 2018 15:09:01 -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; dkim=pass header.i=@sifive.com header.s=google header.b=OWQxarkL; 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 S1727130AbeH1Bzn (ORCPT + 99 others); Mon, 27 Aug 2018 21:55:43 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:38194 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726994AbeH1Bzn (ORCPT ); Mon, 27 Aug 2018 21:55:43 -0400 Received: by mail-pl1-f195.google.com with SMTP id u11-v6so204853plq.5 for ; Mon, 27 Aug 2018 15:07:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=subject:date:message-id:cc:from:to; bh=4+j93ubzSw8/7uEpxIXksyrwXNuz6dUb6W/WXMpeW9s=; b=OWQxarkLdToiTGrMfdF33s/98uvwHY3kaSaGML/g61KRT2C429q/hGf7u2HJnC9X+L GYO9AUL86kznW1WArXVQhZ/mRi5KVx+0VlxhzJ7wNTo9QuOqRJvoRkAtUFy2UpXp3KVS XpBysb0zJq4FWmy7mnJ9eQVegTJfdq+P/rLDhn4tk7WEXHVfiQMb9tWaIuaeBkHztIhi jLdVZByCeDASSvMKPxp4fUGUq7zhW7QJEuVN8mi4PlxqUdebsaKQikY1O0Fejd7U56E+ z5fGAxuPs+v5ujaufe1Mu3PLWLcGGUw/QMSQFFUqU+pqM+qZ4+4TRjmlUfizB2SFQcYx UHSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:date:message-id:cc:from:to; bh=4+j93ubzSw8/7uEpxIXksyrwXNuz6dUb6W/WXMpeW9s=; b=H9CuOZ6DDWucoqBjKW0QvIwvAcdz6TZXz8tSlfZBkepum8mSBd+6QxUQlUsgdNOKEj e1fqcMHw9MSRsbn6ehg54ykXcVGzd8Lj9E4Ib5gkvKhecjZfrULztkTeiZvX95ut3eqe 8z8Dhi2GKg2D20fdQ29HuqMjjkz7r10pvUme5zID5Ol+JfZaNPnppMXl5UIa2EsONlQ0 a841oJfID3P7mL5aDLagyigxrqOa5KCd+OUWYftyvMNH0aes8ZUUbY1NZ6VPNCc69x0w 5ozVJsao30BiyYoQohMwPQfmUBHIK0q7ouRbXxWeb9AjF8PD1xaWYL8r/NXcmukkPdgc JJFg== X-Gm-Message-State: APzg51Cn6rruUU+eSDVrr5qKlRcnkdTh1mUsX9Ht97jGUKiq3WKGLx3o K+jKpi/mBrXy6sXWljwnhCTOEw== X-Received: by 2002:a17:902:704b:: with SMTP id h11-v6mr14544533plt.116.1535407631691; Mon, 27 Aug 2018 15:07:11 -0700 (PDT) Received: from localhost ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id r1-v6sm391874pfi.17.2018.08.27.15.07.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Aug 2018 15:07:10 -0700 (PDT) Subject: [PATCH] RISC-V: Mask out the F extension on systems without D Date: Mon, 27 Aug 2018 15:03:52 -0700 Message-Id: <20180827220352.24301-1-palmer@sifive.com> X-Mailer: git-send-email 2.16.4 Cc: Palmer Dabbelt , aou@eecs.berkeley.edu, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Alan Kao From: Palmer Dabbelt To: linux-riscv@lists.infradead.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The RISC-V Linux port doesn't support systems that have the F extension but don't have the D extension -- we actually don't support systems without D either, but Alan's patch set is rectifying that soon. For now I think we can leave this in a semi-broken state and just wait for Alan's patch set to get merged for proper non-FPU support -- the patch set is starting to look good, so doing something in-between doesn't seem like it's worth the work. I don't think it's worth fretting about support for systems with F but not D for now: our glibc ABIs are IMAC and IMAFDC so they probably won't end up being popular. We can always extend this in the future. CC: Alan Kao Signed-off-by: Palmer Dabbelt --- arch/riscv/kernel/cpufeature.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index 17011a870044..652d102ffa06 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -57,5 +57,12 @@ void riscv_fill_hwcap(void) for (i = 0; i < strlen(isa); ++i) elf_hwcap |= isa2hwcap[(unsigned char)(isa[i])]; + /* We don't support systems with F but without D, so mask those out + * here. */ + if ((elf_hwcap & COMPAT_HWCAP_ISA_F) && !(elf_hwcap & COMPAT_HWCAP_ISA_D)) { + pr_info("This kernel does not support systems with F but not D"); + elf_hwcap &= ~COMPAT_HWCAP_ISA_F; + } + pr_info("elf_hwcap is 0x%lx", elf_hwcap); } -- 2.16.4