LKML Archive on lore.kernel.org
 help / Atom feed
From: Palmer Dabbelt <palmer@sifive.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Christoph Hellwig <hch@infradead.org>,
	linux@roeck-us.net, aou@eecs.berkeley.edu,
	Andrew Waterman <andrew@sifive.com>,
	Arnd Bergmann <arnd@arndb.de>,
	linux-kernel@vger.kernel.org, linux@dominikbrodowski.net,
	tklauser@distanz.ch, linux-riscv@lists.infradead.org,
	dan.carpenter@oracle.com
Subject: Re: [PATCH v3 1/2] RISC-V: Define sys_riscv_flush_icache when SMP=n
Date: Mon, 20 Aug 2018 16:30:39 -0700 (PDT)
Message-ID: <mhng-32cf9aae-1b8f-42e7-86ce-497ba7a43577@palmer-si-x1c4> (raw)
In-Reply-To: <20180814133922.GC28080@infradead.org>

On Tue, 14 Aug 2018 06:39:23 PDT (-0700), Christoph Hellwig wrote:
>>  SYSCALL_DEFINE3(riscv_flush_icache, uintptr_t, start, uintptr_t, end,
>>  	uintptr_t, flags)
>>  {
>> +#ifdef CONFIG_SMP
>>  	struct mm_struct *mm = current->mm;
>>  	bool local = (flags & SYS_RISCV_FLUSH_ICACHE_LOCAL) != 0;
>> +#endif
>>
>>  	/* Check the reserved flags. */
>>  	if (unlikely(flags & ~SYS_RISCV_FLUSH_ICACHE_ALL))
>>  		return -EINVAL;
>>
>> +	/*
>> +	 * Without CONFIG_SMP flush_icache_mm is a just a flush_icache_all(),
>> +	 * which generates unused variable warnings all over this function.
>> +	 */
>> +#ifdef CONFIG_SMP
>>  	flush_icache_mm(mm, local);
>> +#else
>> +	flush_icache_all();
>> +#endif
>
> Eeek.
>
> Something like an unconditional:
>
> 	flush_icache_mm(current->mm, flags & SYS_RISCV_FLUSH_ICACHE_LOCAL);
>
> should solve those issues.
>
> Also in the longer run we should turn the !SMP flush_icache_mm stub
> into an inline function to solve this problem for all potential
> callers.  Excepte that flush_icache_mm happens to be a RISC-V specific
> API without any other callers.  So for now I think the above is what
> I'd do, but this area has a lot of room for cleanup.

Thanks, that's a lot cleaner.  I missed this for the PR, but I'll submit a 
cleanup patch after RC1.

  reply index

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-09 22:19 RISC-V: Don't use a global include guard for uapi/asm/syscalls Palmer Dabbelt
2018-08-09 22:19 ` [PATCH v3 1/2] RISC-V: Define sys_riscv_flush_icache when SMP=n Palmer Dabbelt
2018-08-10  8:38   ` Christoph Hellwig
2018-08-10 18:27     ` Palmer Dabbelt
2018-08-10 18:47       ` Guenter Roeck
2018-08-10 20:55         ` Palmer Dabbelt
2018-08-14 13:35       ` Christoph Hellwig
2018-08-10 14:07   ` Guenter Roeck
2018-08-14 13:39   ` Christoph Hellwig
2018-08-20 23:30     ` Palmer Dabbelt [this message]
2018-08-09 22:19 ` [PATCH v3 2/2] RISC-V: Don't use a global include guard for uapi/asm/syscalls.h Palmer Dabbelt
2018-08-10 14:07   ` Guenter Roeck
2018-08-14 13:40   ` Christoph Hellwig
2018-08-20 23:30     ` Palmer Dabbelt

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=mhng-32cf9aae-1b8f-42e7-86ce-497ba7a43577@palmer-si-x1c4 \
    --to=palmer@sifive.com \
    --cc=andrew@sifive.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=arnd@arndb.de \
    --cc=dan.carpenter@oracle.com \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux@dominikbrodowski.net \
    --cc=linux@roeck-us.net \
    --cc=tklauser@distanz.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org linux-kernel@archiver.kernel.org
	public-inbox-index lkml


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox