Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp699774imu; Fri, 16 Nov 2018 08:53:10 -0800 (PST) X-Google-Smtp-Source: AFSGD/U/94/aq7QR6tYmhTUZiKlJ9Qcd7BN0jUAT0idCLGEt8BsO47RdmUXAgLkGt6wOUZt/KUcZ X-Received: by 2002:a17:902:6f09:: with SMTP id w9mr323534plk.309.1542387190585; Fri, 16 Nov 2018 08:53:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542387190; cv=none; d=google.com; s=arc-20160816; b=pPzHc9M5RskVXOGCHCXMuElBiTPMFw0mAcWQ2jjjr7tCXkbylQfmZtLyAF+yHcp82z uCncJQ8Xu0xQIv892hp90SxQryK4dj2AIgq7krbRSRxivOgUJTa1SYK8GyLPbqoPlflj 81l9IMkDwpcvJLqTWsyQMpm2AnYLpZpPpYTsJ5U+O8AXtv++pJU5UCn1MSRIi9yGyP1w 6xxiRUXVbwvJVjpVQQLgTrPaKfzKj+99K2calJHQU+J9u0W9Xt5rFbseBYv2dXxBtZNv a9Pnktzw6YdeY6zUh2SF/YKns6CvkCNIJC2SpyDxJiKswUVnMqW89af+ZzFUrN4Nztkk 1vQg== 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 :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=kpBoHgmOhN3LkMqkGpPGOvm/Fnxa3FRWSSY+xh/aFy4=; b=xJpU73cLOrOJ5eMdyVjsUyBx25Xz/N3tHJai+xh3eYp5JmUg8ST9ewGrkCZoGbDMXB zHIckm2ckpPjTX6Ra4Wke7j13UZm7q/uLg4UATAtUyrUw/zblnZAHdKXxIClvFjclIKg LQ5KUwJsuJnplcPl/bg4qxaRJImSw3zjCu42ZMkU2ZulMPzmfAh2LYYqzvGxdr/VW/K0 4PAxn4PtJnqjYQc5ry8CZ7qa25qpjvdBYGqHEJLstsUL4SJQ4T4HmdEVjZyDZg+i/l2y JPEhyuK6tHSzbfGBR3cj8kig7dfJMMVq6K1wJBUhr653yXheITiycbtU80zlXrcXJwIC dP9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=G9WNBz1V; 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 22si29847963pgt.216.2018.11.16.08.52.55; Fri, 16 Nov 2018 08:53:10 -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; dkim=pass header.i=@sifive.com header.s=google header.b=G9WNBz1V; 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 S2390108AbeKQDF1 (ORCPT + 99 others); Fri, 16 Nov 2018 22:05:27 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:39048 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728684AbeKQDF0 (ORCPT ); Fri, 16 Nov 2018 22:05:26 -0500 Received: by mail-pf1-f196.google.com with SMTP id c72so6984835pfc.6 for ; Fri, 16 Nov 2018 08:52:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=kpBoHgmOhN3LkMqkGpPGOvm/Fnxa3FRWSSY+xh/aFy4=; b=G9WNBz1VWb2+bpSH7A2MRusy3Khc031pTt2+5QbO+SInYhQfcM7XusBbXbdQF57Kep jUiSCn71t6bBhRX9kLvmJbMLmGoY0XJ04XngwZbkEG6zD58HDnp6PTAixynyknWKz9Pz zYAGq3AoNxs90CJAvTV1t7Z5qFa7FQnXfgHkTSumk5aJ0wH+r8oWHkl7myu8RrdM2M0U 26vTp1RMqTo7J4HiHijGD0BjPA9r9rFvzEJziYxoGeP5NJJDB9vM+Guq3Iasw6GN7xxV +XgaUcd09IIPfz8lwevJ8JLaFA8BypVIkxUof3itA0EtslFfh79wH+0vdwNGhYPg8pHS vnpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=kpBoHgmOhN3LkMqkGpPGOvm/Fnxa3FRWSSY+xh/aFy4=; b=iBTwTLiy9+TxrRzuuN4gRDuPOpLUQlpTmGSTRVH+hWFZXPyrehyGaIKNdFW41G3/Z0 gcq//0gJGQVSsoGcswa4MFiDIa4Qj3Cgr4of2HTUYS2o8Qkg5/G6BnEN1tKXRkKrSD+M 09jVkpbM3Qc6Tj5MlWPoWmjbQa5Ey1ycHk3KcGBJ3WSOKOdZPV4t+K07hrxwoAOTPMq2 xEBonLrOeiKbDIa+P0RIvrTQ5rh9vS9pUUqD6trigD3HDCOyIGDZD4VfTBfbLgk3Tmx0 fmA++ncnTUTrsYZXr2eAqthFVcrSAiFHXr/aAzWXk3cOxs5n5KPgFqerypYqJinWQljz KJgA== X-Gm-Message-State: AGRZ1gKGfdwx+yarqjtEcYN5g87ZtbqtbYNRWl5uIeMGAxGgb8NJl6nj l0tziN3dmLKnGIggoXEDjoiCxg== X-Received: by 2002:a63:e615:: with SMTP id g21mr10841155pgh.290.1542387137227; Fri, 16 Nov 2018 08:52:17 -0800 (PST) Received: from localhost ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id z83-v6sm37608428pfi.4.2018.11.16.08.52.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 08:52:16 -0800 (PST) Date: Fri, 16 Nov 2018 08:52:16 -0800 (PST) X-Google-Original-Date: Fri, 16 Nov 2018 07:01:12 PST (-0800) Subject: Re: [PATCH v2] RISC-V: recognize S/U mode bits in print_isa In-Reply-To: <20181109214217.27494-1-me@packi.ch> CC: linux-riscv@lists.infradead.org, me@packi.ch, aou@eecs.berkeley.edu, atish.patra@wdc.com, anup@brainfault.org, linux-kernel@vger.kernel.org From: Palmer Dabbelt To: me@packi.ch Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 09 Nov 2018 13:42:16 PST (-0800), me@packi.ch wrote: > 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++; > } > } This looks good to me. I'll target it for the RCs, as it's fairly small and that warning fires too often. Thanks!