Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1481522ybp; Wed, 9 Oct 2019 15:02:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqzK2fZ1pBrZnzWsiYox2tygeyPGabpZ06hXIUlDrfIYg6mUfTMwbUt6yFbwX01j3RN8XpSE X-Received: by 2002:a17:906:2cd4:: with SMTP id r20mr4912278ejr.307.1570658550594; Wed, 09 Oct 2019 15:02:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570658550; cv=none; d=google.com; s=arc-20160816; b=wG59+Zm/QNC4XuQAHUFfKn/tgI4iKNDBIVuir59WAtKf7nIP6MQiH/kDFoxB4rEETo sbUp2AAk+dLWORB1khLhls58iJCEdag0x7YBY9gdCD3ClrXQawmW17q/VAOvdpFLmW1V 9/wHSljA3OyruVaVKUtvu7XvOZguuAiEMrMyr+h+stGRFBys4jOJ9UKSpSJr7QFeOzb9 PTf6p1w5+0ujJFbv3bGx5N9890UHb2p0ovgVjiDyAcLmCPTKfMGOk7OHnIRB+uE5WH2q Qq8lvma65gZvEhVPrk3FgwY9+uWk30YG4bKWpAScLzUAovtx6jgJfCgZdnCsAgfENikk wb6g== 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=WMIRC/ETOU4QV41EmMwlwRZ2x4FvsFd3e3vx5Mckhoc=; b=okiw4jdpvYyKZ77TulP8fEoRcvcXunazhX89C+2WeZ4VjiblACiOBOOOzbVZFonRea LkQ0fhQ+IYP2E/mTvjWMVtyGokKWz0+8UbxY0JhFv912/yALOgbshHBvWDRD3gWVRePC 7Bbo2J67/cCBy/VNBYsTcmlH4U7wC8UMgwIifaT9ahmyXN3H5F50pXr/wCtDSoW80ODP Nw5yeg48t9XpPySKOeeu+4fBCKZ2Gu/z5m5mHnkTpjDQg9dzCI6wg1WwZ4bomhIuBrlb MQgWCU+ojHXvetOvcrODsxw1icJXkbz5dBTb6zPk9gXMEOi+EavKCleKzM6UiWViBY8Q P7MQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=B1Js9JjI; 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 i12si1977457ejj.119.2019.10.09.15.02.06; Wed, 09 Oct 2019 15:02:30 -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=B1Js9JjI; 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 S1732041AbfJIWBa (ORCPT + 99 others); Wed, 9 Oct 2019 18:01:30 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:58909 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730815AbfJIWB3 (ORCPT ); Wed, 9 Oct 2019 18:01:29 -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=1570658490; x=1602194490; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=lbd+AIGQrRoThAxs3oEN+bBjg5z+KPSZ65JKtN5StOg=; b=B1Js9JjIXX3891OnbKoTNZDxu/59ux7Yqm5nL0O2OcF7Z7bYdVtQQYig F1OPwWWLHOwUn/629HZ/DJxUwO02TSVRKkDiuo1AnJIbLw7MmI94tHipp 3iZUOdwnFLCa9N4AcXcaT8btVSzIpOQt2H8dEBl774ZQktlqEkpYZJmSR nTsAjYqXSUXMZmoqMI+I4XshsQo4Nn03IjYSer96tczQay1/ndH50R4ln TMiSOmSAIjCUy8QF1uogKQUIMChr0OZz09VdeRYafYW7qsL3+Dne4QoRF 5nzCORM3RA8SZ+0pKQAWN0jWG1SRbh4HwsoStCD0bEtsgA+ajZKSnhY2u g==; IronPort-SDR: +3fmK3aVMPG6Hkp4GGHLodzHTmV2nsapiMR/xG5BzrPre+CTtqn48srXc4n/rhhvJkBUL1X8PM ALF02qUMBco7yIpC3K4dUdgPeqJPbuajvj2+A9wDhDmMLQhgmdPEeOrF1vFShm9pVEqDaFLeku +6IlF6/73SGLRn6MeHg7I6H5/tRMbqQopGGxBPLclYH35Lv6yBK9TL6x8IMLzKt9fIA8k2Be0u rllORs73tcl08oXEarM9uHwpoCp+0hUmUJqdOixh+k5KeI/B+nkdAdhZ8Z/7CLFCf8KYHLuMg4 tlE= X-IronPort-AV: E=Sophos;i="5.67,277,1566835200"; d="scan'208";a="121776284" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 10 Oct 2019 06:01:30 +0800 IronPort-SDR: AohxBxgZJlpUlwMwToqjXjaIDz/wQvJY5MGuVqa7FxDdUSfqwH5S7JHPjpRVnGxy1weiChmH9T rDv20BVWFpXtBGJ+JpkeULQPkFNcb3DqreCU5kWy/Qz+LDI209t2Xgxq2ZWD2H8NQFANWAH4E9 cACuiJriABiFkf46RIvW/cpCYmzZ6hicvNgHxtHejUzq/IZJ2NuQpqCj2kDCcVkQAnxbDyRGNO deHc0YqeN3HbDhHTVfZV9Zgs+u2F++ojck83JI/JAbQEQxf/i8GRr+fwlBg1LKt6/vTuv5QIzK kOpGekbGjjgowoqH7/VRTsI7 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; 09 Oct 2019 14:57:28 -0700 IronPort-SDR: OSfHRalZnckQ+CMwFJuI9c2cHFJ5980REgWsO9HlLdWYOA9e/Xnja3lHpA/bBzYMh3y+14r+vX jFPL34GtuhDEtYwD4Z1KDUgRqboAKwulDmx7HlJm48/04ZQ7rVb3/T84nTshQt9MrX/KCCgZXQ q//5RaXrtYFF9k3Zm4rRjtw3axETY+J2XeAph1wjymWL9mQjmWEJi8crXOVQz6s1S0cNMqZWA2 ePWMktMmAyTO2iv41PIvKd5EL3O7Mhu3dqC2bWcQkMg3bsRWn2D7H2c8Ui/iq1IzhJ9n8acYgs xh4= 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; 09 Oct 2019 15:01:29 -0700 From: Atish Patra To: linux-kernel@vger.kernel.org Cc: Atish Patra , Christoph Hellwig , Albert Ou , Allison Randal , Anup Patel , Enrico Weigelt , Greg Kroah-Hartman , Johan Hovold , linux-riscv@lists.infradead.org, Palmer Dabbelt , Paul Walmsley , Richard Fontana , Thomas Gleixner Subject: [PATCH v2 1/2] RISC-V: Remove unsupported isa string info print Date: Wed, 9 Oct 2019 15:00:57 -0700 Message-Id: <20191009220058.24964-2-atish.patra@wdc.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191009220058.24964-1-atish.patra@wdc.com> References: <20191009220058.24964-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 Reviewed-by: Christoph Hellwig --- 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