Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1272317imu; Fri, 9 Nov 2018 13:45:23 -0800 (PST) X-Google-Smtp-Source: AJdET5dJ3qMPNNkUuePNgSX1nWg3/vaRwezbvyeM0ZSOIyo1chiRCT5gaotp4eEq1301NhPZ3mT/ X-Received: by 2002:a17:902:7281:: with SMTP id d1-v6mr6704073pll.284.1541799923552; Fri, 09 Nov 2018 13:45:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541799923; cv=none; d=google.com; s=arc-20160816; b=Kfk4vAOsLRJ5VUer1NfwEUzRKGMYGIaXURLYaShKAcMvKwvrUrHzgmv8W5fW1AQH6w icucV+QXFia1n7hi/VrJ5BFphH7ut6ZCWy/0C8dJPR318xzXzgTCab6haJypiU6cji19 uO77brCsOa5msFld/Aw6yjIlVG1JQWG4ShZr5ErxThZMtV6BB8ZocANKVsQZR4H40FrI enc6TfqjR2sqr3Mzwcr08MGMV4WXDn0e+w168c7mdiUHsLo1oxYvZ52Z/f9X7kRry+dm ey6Cf4aujcv7mWs9794WWHg6AqqyLOG0rNVhjGEVyHhW+cqDEp1uuj9nHeeUk7C//yc1 nuvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Zc+MO4hB8tLYeiTL3sPs8My1WCWs3mvPZKLgCIK2fRQ=; b=Z/KKc/iqRAVeVYnvWb48ygEJzwcXJzYAxxYghD5kBsckyp1tKgyZtqO9nZxrhhNqu+ dZOQ6N9V2lEFvk7N6NagI0hWL9mUQAVL7ZzvlyZDdHuJtHGU8ve0nD6iC78hJ7fPj9YW Bc8lYNV+L8l30FKMr3oaCPkHrYd716xQOXj9gfU52RoH9gxKfcb/nZqQu6mJ01CBLz8k NGDl0XlEHqTQ8TVdiFiyXbKdG3ysIOH/0Mwv9fOnRh8MxAnhHVxkACCheZ6cD3bzlMmz jKHnYldHLRkMZ3qPrDnc6/0qAw2+uBf3o3dwTxRgxTwEYfypTNYs3M9srcFf1watA1tK zF+g== 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 c9-v6si9145646plo.270.2018.11.09.13.45.06; Fri, 09 Nov 2018 13:45:23 -0800 (PST) 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 S1728342AbeKJHZx (ORCPT + 99 others); Sat, 10 Nov 2018 02:25:53 -0500 Received: from mail.binarylogic.ch ([88.198.23.72]:45508 "EHLO mail.binarylogic.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728267AbeKJHZw (ORCPT ); Sat, 10 Nov 2018 02:25:52 -0500 Received: from fortknox.localdomain (unknown [192.168.122.1]) by mail.binarylogic.ch (Postfix) with ESMTP id 40681DF386; Fri, 9 Nov 2018 22:43:25 +0100 (CET) From: =?UTF-8?q?Patrick=20St=C3=A4hlin?= To: linux-riscv@lists.infradead.org Cc: =?UTF-8?q?Patrick=20St=C3=A4hlin?= , Palmer Dabbelt , Albert Ou , Atish Patra , Anup Patel , linux-kernel@vger.kernel.org Subject: [PATCH v2] RISC-V: recognize S/U mode bits in print_isa Date: Fri, 9 Nov 2018 22:42:16 +0100 Message-Id: <20181109214217.27494-1-me@packi.ch> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Removes the warning about an unsupported ISA when reading /proc/cpuinfo on QEMU. The "S" extension is not being returned as it is not accessible from userspace. Signed-off-by: Patrick Stählin --- arch/riscv/kernel/cpu.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/riscv/kernel/cpu.c b/arch/riscv/kernel/cpu.c index 3a5a2ee31547..b4a7d4427fbb 100644 --- a/arch/riscv/kernel/cpu.c +++ b/arch/riscv/kernel/cpu.c @@ -64,7 +64,7 @@ int riscv_of_processor_hartid(struct device_node *node) static void print_isa(struct seq_file *f, const char *orig_isa) { - static const char *ext = "mafdc"; + static const char *ext = "mafdcsu"; const char *isa = orig_isa; const char *e; @@ -88,11 +88,14 @@ static void print_isa(struct seq_file *f, const char *orig_isa) /* * Check the rest of the ISA string for valid extensions, printing those * we find. RISC-V ISA strings define an order, so we only print the - * extension bits when they're in order. + * extension bits when they're in order. Hide the supervisor (S) + * extension from userspace as it's not accessible from there. */ for (e = ext; *e != '\0'; ++e) { if (isa[0] == e[0]) { - seq_write(f, isa, 1); + if (isa[0] != 's') + seq_write(f, isa, 1); + isa++; } } -- 2.17.1