lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 20 Aug 2018 16:30:39 -0700 (PDT)
From:   Palmer Dabbelt <palmer@...ive.com>
To:     Christoph Hellwig <hch@...radead.org>
CC:     Christoph Hellwig <hch@...radead.org>, linux@...ck-us.net,
        aou@...s.berkeley.edu, Andrew Waterman <andrew@...ive.com>,
        Arnd Bergmann <arnd@...db.de>, linux-kernel@...r.kernel.org,
        linux@...inikbrodowski.net, tklauser@...tanz.ch,
        linux-riscv@...ts.infradead.org, dan.carpenter@...cle.com
Subject:     Re: [PATCH v3 1/2] RISC-V: Define sys_riscv_flush_icache when SMP=n

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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ