Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4574421imu; Tue, 8 Jan 2019 02:35:45 -0800 (PST) X-Google-Smtp-Source: ALg8bN6REVTnEsHxxmBf5pfZZkIO4huzJIJjdBkdqPHFmdpRZwjRRUwWbe4YNre/FmcaA+hDeVXo X-Received: by 2002:a62:5003:: with SMTP id e3mr1218228pfb.23.1546943745419; Tue, 08 Jan 2019 02:35:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546943745; cv=none; d=google.com; s=arc-20160816; b=sSVDgb12horgQuRiw6jQlGTToZDXEzr8RvHGny3SsAc4QuK15XUDXq/0P9M2Q2Qg2E UaqEVL79A7F/XPgDgnheut6NTrKzFa40aOlrY6aWDX1ukDa4LiwAwkRP1XOB3XxBw0pe yHo8iarjttQu9ZTMkPUpECOPLXEscT+45RxI2hlS0TL6m2VTxidLUHK+NViYoSfUxge4 ILsISFGR6zwwMTbdMHtM98UNzR4sXTGUfhCmVso1MvQ17MsFl3ZMahzzZ7hdfsB9ttrO ZGp4kiL84z6jAhqF68FV/Zu7B+00KOK4b/jWFpoXvPnZ9DKky4bPe6tUg7MDQBnu58rD bAlw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject:dkim-signature; bh=rpe8HYk+Y3piSYfXDWVgF4L7eQ96iCUF6XLJJSEnu5I=; b=sMetElgacMtZ8/vHoygjRaMjWVOSRyHoKeRakw+1zA7oHFLLbf2hLk9ZouApvX8mw7 ubYrBiOnBKoV+iJIHYwEj/tCRwyBlQaNkt3iYkUYMkHCd6xfPuibuiH0/RK7youiRnGT yWBWOHUxHCwkCOFypa8x+UM4hctazxKN3L51tgQbOhzpw/qNjGdS7yvp6vScLWGrzvy6 D6kDxJzW1leXnBQAqvgpI+k9yEQTb/dBD2nxvqf7w2341fN9bMOwmvpQ02ZV51a6zdZM rLFQNqfaUM+L/87mkKAI70wbpAgxYuoIwRJu+eOznKD1eUW+BPsqs7fZQ91JQxTXfK5R YLNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=qihHki2h; 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 s5si6527006pgl.481.2019.01.08.02.35.29; Tue, 08 Jan 2019 02:35:45 -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=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=qihHki2h; 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 S1728651AbfAHKdG (ORCPT + 99 others); Tue, 8 Jan 2019 05:33:06 -0500 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:44551 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728118AbfAHKdF (ORCPT ); Tue, 8 Jan 2019 05:33:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1546943586; x=1578479586; h=subject:from:to:cc:references:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=hq5oGPu07KlC+0CLOCmKx2M1enW77+L+m4qZ8+kveQA=; b=qihHki2h5enXPTB0JlGpfOaFvW4BlZVYy/VBaI8Em1/VQyQlCuU01ki9 C3KA2zMXV/Qnp23DmY0Q04dADBAu+E8zImN1d7SxMmOvYdx7Q85kEr+7O Cvw+NIY8tMIUQpWmAjXYP0GQQ0LzkfGYyTwSmzr1FZwlFinaGbKz+hDzV LI8Fs8NfkVo/f6ouhI9OSWOJdPuGWOBCrAdMn29gQBU9YkdsEdBZuoIzP 4QtIF/fZbZjLx7fip3GSaOGN9VCdbwKTGV3VkugLt5OrTCiShrWLxo/iG 4pLtxyYU2jWJttL7ZxZk72ZQkzqm3ppY7BHXEHGDGmtPc/3URmid0asdL A==; X-IronPort-AV: E=Sophos;i="5.56,453,1539619200"; d="scan'208";a="100003278" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 08 Jan 2019 18:33:06 +0800 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP; 08 Jan 2019 02:14:39 -0800 Received: from usa003532.ad.shared (HELO [10.86.59.202]) ([10.86.59.202]) by uls-op-cesaip01.wdc.com with ESMTP; 08 Jan 2019 02:33:04 -0800 Subject: Re: [PATCH v2 8/8] RISC-V: Assign hwcap only according to current cpu. From: Atish Patra To: "linux-riscv@lists.infradead.org" Cc: Alan Kao , Albert Ou , Andreas Schwab , Anup Patel , Daniel Lezcano , Dmitriy Cherkasov , Jason Cooper , "linux-kernel@vger.kernel.org" , Marc Zyngier , Michael Clark , Palmer Dabbelt , =?UTF-8?Q?Patrick_St=c3=a4hlin?= , Thomas Gleixner , Zong Li References: <1546940318-9752-1-git-send-email-atish.patra@wdc.com> <1546940318-9752-9-git-send-email-atish.patra@wdc.com> Message-ID: <5445186f-db34-d319-5081-37ee1fc58273@wdc.com> Date: Tue, 8 Jan 2019 02:33:03 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.3.3 MIME-Version: 1.0 In-Reply-To: <1546940318-9752-9-git-send-email-atish.patra@wdc.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/8/19 1:38 AM, Atish Patra wrote: > Currently, we set hwcap based on first valid cpu from > DT. This may not be correct always as that CPU might not > be current booting cpu. > > Set hwcap based on the current cpu instead of first > valid CPU from DT. > > Signed-off-by: Atish Patra > --- > arch/riscv/kernel/cpufeature.c | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c > index a6e369ed..ed6122ff 100644 > --- a/arch/riscv/kernel/cpufeature.c > +++ b/arch/riscv/kernel/cpufeature.c > @@ -43,12 +43,15 @@ void riscv_fill_hwcap(void) > elf_hwcap = 0; > > /* > - * We don't support running Linux on hertergenous ISA systems. For > - * now, we just check the ISA of the first "okay" processor. > + * We don't support running Linux on hertergenous ISA systems. > + * But first "okay" processor might not be the boot cpu. > + * Check the ISA of boot cpu. > */ > - while ((node = of_find_node_by_type(node, "cpu"))) > - if (riscv_of_processor_hartid(node) >= 0) > + while ((node = of_find_node_by_type(node, "cpu"))) { > + if (riscv_of_processor_hartid(node) == boot_cpu_hartid) > break; > + } > + > if (!node) { > pr_warning("Unable to find \"cpu\" devicetree entry"); > return; > Argh..Missed an include while rebasing. Following edit is required for non SMP config. I will fix it in v2. diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index ed6122ff..78379ea3 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -20,6 +20,7 @@ #include #include #include +#include Regards, Atish