Received: by 2002:a17:90a:37e8:0:0:0:0 with SMTP id v95csp380391pjb; Fri, 4 Oct 2019 00:47:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqy7bavy6Oh/QdGLShVdOqnTNyYBZ27IFfwMFszgLFpBr+MT4Pft80bQpjqaIcHsUyy29gfi X-Received: by 2002:a17:906:199a:: with SMTP id g26mr11154438ejd.92.1570175249183; Fri, 04 Oct 2019 00:47:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570175249; cv=none; d=google.com; s=arc-20160816; b=m8DlGUW5kcINYd9knfaAclZV684c8a8nBOX1TRs5Vu2cLoXmtcaNfAtLaIQegXoGic tk/v4R0Shnyqhw7amQvmxcGAenpL/EJ2++pD/UftFZEkGdf0GA93nNm8k1VY6x30qJ76 Fg27u8H1JVwoSK5BmRo6J/+QKrakI++jaqE3jNN4Zzf/GREL+FjNnDpwpjdo7glzckdk +iOVN7RywFSm3dbl00B50Cqstk4bzCQ0gWiCx8GJNjvJ29zcCwI7IO+v2bdsiROJy8mW AcEyISBRQn5z1E06R6FfbJBcR9g3eD/UgpDScAkZQ3SoXuFnyTHFYr2dKxji/3ngKqwJ hfLA== 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 :wdcironportexception:ironport-sdr:ironport-sdr:ironport-sdr :dkim-signature; bh=d6ALuUIb7acfNfApgxPemgoK/gsCAHvTVjPDzOj3RjA=; b=ePiHdKiGhtcf3Hf8193U+jxn5jzdZh44fq8h012pdIZIoGPma5KJebit7/wBbWO1M0 GxoYYam/ouLLJoOcHpyJBou3M9xcLOeylBIt7gPPgt8Kz6c1U3kcD0AzV66MIwaUvwNw sP/eeWMAI/3kGAjGuWxYX7X2nI+eebVJo1Zs8XCggHCXgaYv0+Ttpd5s//ebByej0ueu ZHdbR3BUI4yNtF4JwLNbXTd+/NDbl84+Ttr/1GrKZTjjRocz5DO94H+AH/hbWF/NA+es +VBnEPWJN1Esl8Cg4r5IZM7VwDaIiFS94yfRgX2F9pOH5GIQPYHtQ7wrR0FoYrkTXkbR RQBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b="B0mJ/UHZ"; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h2si2854657edw.29.2019.10.04.00.47.05; Fri, 04 Oct 2019 00:47:29 -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=fail header.i=@wdc.com header.s=dkim.wdc.com header.b="B0mJ/UHZ"; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731451AbfJDBUE (ORCPT + 99 others); Thu, 3 Oct 2019 21:20:04 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:33208 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730325AbfJDBUE (ORCPT ); Thu, 3 Oct 2019 21:20:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1570152003; x=1601688003; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=lvQhkdg9mYtc/RKe847gIG8//uYicCwg807haVRxHDE=; b=B0mJ/UHZKIv3aoW4hIE2lhxjBveSMVZvhWus3sxH2LhWCHAURlmfVdGD Y45c1ZN2tNBLXPeiUHDoUO2yHXayod/o3wd+INSGUpZZRDz1KROV1YL/1 tDHRus19xoCjlK6l0JV3frmTvciOvByD/QV6Y6zplBerV9trVr+w37aMo QCKzTiwIx0XtPCd38KvZJeaOQwPXI9RCc+aMzcM3dHRBn/HLL2Xr/W6VN Hj6qr6g3tj4Jzdc6DM07QZBybnhDhKzPYe2p1bqgqH+Ty6+8hINumttzn BKPkYIm3/s+nRixqCNioUOMjdcz+hCrA66sIwB7sboCzhSWCJ0PaLoHMX Q==; IronPort-SDR: cafncHLmRgpJ9NW6BDrsAUzAthIzrL4jzxctKQZTtPxjWnYnVyUIqd0YVDibhtpDanygwf7oCP aLiPY/or2FjTg7qAFE/OaMT5C3NXHv3oySSjhJ9lNspVcjYxqrWQ8Pttcrkqp86KAPlsayDg/d qnI8SESsD3jEFaweqfhBBQ1XPcVIdbLAe6iLSV8QXMT9k4QYZet8OneOzCXRwr47Y4kB0ZwIbY nH/xeWbjcc8nQ+kVn+xvhDs/uWTelKslHn2b+pXFFySbozrujhOorbhHvvuO/cdKw6BFB136vl yGc= X-IronPort-AV: E=Sophos;i="5.67,254,1566835200"; d="scan'208";a="119765640" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 04 Oct 2019 09:20:02 +0800 IronPort-SDR: BRQGfsMNCWVM9RCkiB6lyp90itPcttBRJgWs61J7RlS6VSFggJpE/rSHC2Rzimpi/wCZyZpU+7 YnS5uQVehJBwneTTuqsRUGeM9AiBn2PMq54XJ3ZjhMilr7m6yDo2T05XQde8ph1uOqzUJwh+RN HAYcaERlsEnN3idt/HJeYa17ILnhcm7eJg50+hGeGN9etqDtHPXi8k6zx1EKPUo/wjCN2Ay/re Hxi3GFy0qtBQ+AML4xQqt9DWmgOWhJhOH6iguTV+SuYe/ztkJ2DrXcooateYHhhDCV67iWWPL6 f+dmbOFzWljVay9L0d5Flx7l Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2019 18:16:11 -0700 IronPort-SDR: qKeZmEpKTEzSQldkunuCDSObARUFEHemYXMJy0fLs8vX3FTw8wVQI9evPWDF+kEbIkPFPamW/U //+xq2haZX6adORa+igaX42fIvmmBOu79Mj3i2nAZrAYMvkuE3VFBoRbAHwV58FzvEXmWf+JIt fb94+Pq0OFFedR10EnzbhjzwcPtGu61jyeQdMJ6AK5qOXaqcEjPLZyAJSWjC1RyXkXIjMLJsbx mBy84UX7KzP0GpO5Cb4SNIlZRpRN7w7Q46xegvYi9NaPV736UHyL8f4dJnQaq6NYVo5fTvHcKA G+I= WDCIronportException: Internal Received: from jedi-01.sdcorp.global.sandisk.com (HELO jedi-01.int.fusionio.com) ([10.11.143.218]) by uls-op-cesaip02.wdc.com with ESMTP; 03 Oct 2019 18:20:02 -0700 From: Atish Patra To: linux-kernel@vger.kernel.org Cc: Atish Patra , Albert Ou , Alexandre Ghiti , Andrew Morton , Anup Patel , Greg Kroah-Hartman , Johan Hovold , linux-riscv@lists.infradead.org, Palmer Dabbelt , Paul Walmsley , Richard Fontana , Thomas Gleixner Subject: [v1 PATCH 1/2] RISC-V: Remove unsupported isa string info print Date: Thu, 3 Oct 2019 18:19:59 -0700 Message-Id: <20191004012000.2661-2-atish.patra@wdc.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191004012000.2661-1-atish.patra@wdc.com> References: <20191004012000.2661-1-atish.patra@wdc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org /proc/cpuinfo should just print all the isa string as an information instead of determining what is supported or not. ELF hwcap can be used by the userspace to figure out that. Simplify the isa string printing by removing the unsupported isa string print and all related code. The relevant discussion can be found at http://lists.infradead.org/pipermail/linux-riscv/2019-September/006702.html Signed-off-by: Atish Patra --- arch/riscv/kernel/cpu.c | 45 +++-------------------------------------- 1 file changed, 3 insertions(+), 42 deletions(-) diff --git a/arch/riscv/kernel/cpu.c b/arch/riscv/kernel/cpu.c index 7da3c6a93abd..40a3c442ac5f 100644 --- a/arch/riscv/kernel/cpu.c +++ b/arch/riscv/kernel/cpu.c @@ -46,51 +46,12 @@ int riscv_of_processor_hartid(struct device_node *node) #ifdef CONFIG_PROC_FS -static void print_isa(struct seq_file *f, const char *orig_isa) +static void print_isa(struct seq_file *f, const char *isa) { - static const char *ext = "mafdcsu"; - const char *isa = orig_isa; - const char *e; - - /* - * Linux doesn't support rv32e or rv128i, and we only support booting - * kernels on harts with the same ISA that the kernel is compiled for. - */ -#if defined(CONFIG_32BIT) - if (strncmp(isa, "rv32i", 5) != 0) - return; -#elif defined(CONFIG_64BIT) - if (strncmp(isa, "rv64i", 5) != 0) - return; -#endif - - /* Print the base ISA, as we already know it's legal. */ + /* Print the entire ISA as it is */ seq_puts(f, "isa\t\t: "); - seq_write(f, isa, 5); - isa += 5; - - /* - * 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. 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]) { - if (isa[0] != 's') - seq_write(f, isa, 1); - - isa++; - } - } + seq_write(f, isa, strlen(isa)); seq_puts(f, "\n"); - - /* - * If we were given an unsupported ISA in the device tree then print - * a bit of info describing what went wrong. - */ - if (isa[0] != '\0') - pr_info("unsupported ISA \"%s\" in device tree\n", orig_isa); } static void print_mmu(struct seq_file *f, const char *mmu_type) -- 2.21.0