Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2999415imm; Tue, 4 Sep 2018 13:36:45 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZsntbvlwu4SZIiMRn7XlnQgTPcKIQU27ZpIndPnNeHhwDsPsdcavmu3qSJ+gJZpIvgYOMe X-Received: by 2002:a17:902:7009:: with SMTP id y9-v6mr34914387plk.249.1536093405645; Tue, 04 Sep 2018 13:36:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536093405; cv=none; d=google.com; s=arc-20160816; b=h3vSsd50EptjVnI0PHqzrON2mI9xll1LNCYuzrSzjL9apiWxIKRSRX/QI2MgsmGz8d M0+uIroSKFpekVZz0G72K7P6zpbAulejDFvvIo8n/fnwBOjtU7RdLuUbIDFwKACwdHoR mfKaiGrMH8LDqMQEp/rtP6cP292f7yoOvw0/HBgTU+aefY7lJ4qN41Q5TFRHBOSIB8iO 6D3OCpsBUvuAFZu/3vSnindEMRYvgBqQAzLF1lIAatvZnN/EhgSX95TlsJHMf9F3BqBV V22CPY4Hwh5myEZMA92XY07MeHtUIlJwdurJhRLJHcZPbRoC2sr8dnNX3RlTRN2LAf/y E2zg== 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:subject:from:dkim-signature :arc-authentication-results; bh=LEdtnnqXCROqx5MEfcIEh1FyCBKN8aZpNBqMtGPNC78=; b=SFy+ctQcGox9NPNGUmnWbH2Tt4U9UtAlOWNkhmv9WWd90STDfGAJNnYh83iUIeY4eA Zv5kIWPY6OJfVX9rZQnqmKE+fo7KWMdFgSLFdlz31V1cStS9vV5XCix4iy2HaCVbSLTM 5IgKbdYzSxZtvLAUDIvTD3AGwHinfGkxHsL6AW9TpmL7SoAJNx+GuJp43MCes+0kbvst i7jn3CWueQ/W+YCAgCYn1Qm9FLHmwcM9gU3quDXfrNSp/3afH3Mkhc2GXglmyrciC8/H KvIdTNyw6hyL0kqJwpLODVvM6oxpXQJNSHnj4Nb7RjNG3DLzA7qsVaNW3isK2+fNzlr+ jYhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=r4ugSk1P; 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 o20-v6si9939745pgd.58.2018.09.04.13.36.29; Tue, 04 Sep 2018 13:36:45 -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=r4ugSk1P; 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 S1727765AbeIEBB5 (ORCPT + 99 others); Tue, 4 Sep 2018 21:01:57 -0400 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:37721 "EHLO esa5.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725825AbeIEBB5 (ORCPT ); Tue, 4 Sep 2018 21:01:57 -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=1536093312; x=1567629312; h=from:subject:to:cc:references:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=RXijzOu18ihbaLhEOq+p9ovKv+df55+NCvlqoCK6Ee4=; b=r4ugSk1PBt2e+itByj/JQv2PpLItKN0Wbm/kRllktL6hfZJ2P+DIbWRp 7hOn1w91s4asEx9daZeJ9wP10ttaO8DEw9bN0Wdy5qAxUN1kOAt8WTFrf har1REXztzLsF8+axIOuEN5iW2+Prp2VwMm6YZUC/aQDmlAWXS8SjEZV0 PPZ7bOopIlS+rXsFVThD6QgrG8G8yatY9etGQxYg3ORLodJz0+tyLYW2j ZZ39RKPCrnmPsMq/A1HqC3d5IykMKBU6wI21NAetu7CU0Wmi1Pf++buMq noOdQl99lKD+KyVsUxju2jrc4EspNPhBhhNKot0mO1lQjY7cvFtBt64QW A==; X-IronPort-AV: E=Sophos;i="5.53,330,1531756800"; d="scan'208";a="89986994" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 05 Sep 2018 04:35:11 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 04 Sep 2018 13:21:53 -0700 Received: from use204589.ad.shared (HELO [10.86.59.178]) ([10.86.59.178]) by uls-op-cesaip02.wdc.com with ESMTP; 04 Sep 2018 13:35:11 -0700 From: Atish Patra Subject: Re: [PATCH v2 2/3] RISC-V: Use Linux logical cpu number instead of hartid To: Christoph Hellwig Cc: "palmer@sifive.com" , "linux-riscv@lists.infradead.org" , "mark.rutland@arm.com" , "anup@brainfault.org" , "tglx@linutronix.de" , "linux-kernel@vger.kernel.org" , "damein@vger.kernel.org" References: <1535445370-19004-1-git-send-email-atish.patra@wdc.com> <1535445370-19004-3-git-send-email-atish.patra@wdc.com> <20180831061104.GB19292@infradead.org> Message-ID: Date: Tue, 4 Sep 2018 13:35:10 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180831061104.GB19292@infradead.org> 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 8/30/18 11:11 PM, Christoph Hellwig wrote: >> -#define flush_tlb_all() sbi_remote_sfence_vma(NULL, 0, -1) >> +static inline void remote_sfence_vma(struct cpumask *cmask, unsigned long start, >> + unsigned long size) >> +{ >> + struct cpumask hmask; >> + >> + riscv_cpuid_to_hartid_mask(cmask, &hmask); >> + sbi_remote_sfence_vma(hmask.bits, start, size); >> +} >> + >> +#define flush_tlb_all() remote_sfence_vma(NULL, 0, -1) > > flush_tlb_all passed NULL to sbi_remote_sfence_vma before, so this > changes what we pass. I think we should keep the existing behavior. > sure. How about this ? --- a/arch/riscv/include/asm/tlbflush.h +++ b/arch/riscv/include/asm/tlbflush.h @@ -55,8 +55,13 @@ static inline void remote_sfence_vma(struct cpumask *cmask, unsigned long start, { struct cpumask hmask; - riscv_cpuid_to_hartid_mask(cmask, &hmask); - sbi_remote_sfence_vma(hmask.bits, start, size); + if (cmask == NULL) { + sbi_remote_sfence_vma(NULL, start, size); + } else { + cpumask_clear(&hmask); + riscv_cpuid_to_hartid_mask(cmask, &hmask); + sbi_remote_sfence_vma(hmask.bits, start, size); + } } >> @@ -93,10 +94,11 @@ static inline void plic_toggle(int ctxid, int hwirq, int enable) >> static inline void plic_irq_toggle(struct irq_data *d, int enable) >> { >> int cpu; >> + struct plic_handler *handler; >> >> writel(enable, plic_regs + PRIORITY_BASE + d->hwirq * PRIORITY_PER_ID); >> for_each_cpu(cpu, irq_data_get_affinity_mask(d)) { >> - struct plic_handler *handler = per_cpu_ptr(&plic_handlers, cpu); >> + handler = per_cpu_ptr(&plic_handlers, cpu); > > This looks like a spurious change. > I think I did this to avoid possible compiler warnings. Will revert it. Regards, Atish