Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp77210imm; Fri, 10 Aug 2018 07:54:13 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzZ8jXOGSDTnO/fI1biHWhY0ySgdOu9QNGi6wZ/diEbbs3EAeVXyLJBzYLLbfNYLpusZ0Ak X-Received: by 2002:a63:8f03:: with SMTP id n3-v6mr6898877pgd.166.1533912853523; Fri, 10 Aug 2018 07:54:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533912853; cv=none; d=google.com; s=arc-20160816; b=e+aEgQJal87M4CE74VksnVazczRblNTSGlizlAsYuiNsJS2QR0gERJPfuNVTVQvgq9 Z0Hz0yO9FA0AhUTKnZbNz8EqNUp2kw3YsfoyH+LHKQLQoQC//6OYlpZtnoEk/o8U2B44 QFOfjcYyERlVbb6Xq1G/1gQS0Cn5aYFRCCSVSBTy0OVkGqGlUH2t/e4Qa+8uenuvHUv9 vMMFnPklqEIOT5U44WrihFCjSWfvnOsOVVXweaIYj9MyBsf8gvhc1JjH3Qd4aXSND+6j qnjPYJa9DFNv4HC5ciF0DZbiDKgiaqUJp4sk/u1PoNQVurZgwB9x7WfQ/tnC+KQXPcak HBbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=HVt7FW19u8tMo6vfrtI8/3GLIdrPIeba9/QiqzhT/oQ=; b=FtdaHuzjx6Wr9l4bfow54sFeVgALEap2gQjOaghAcM/D0/FjAHgN0uE2yQ5f3pEX6p qZI1AZNcRggn2bpzbiqTxcH+PBmegNISz7GDHpA22x4yQzDIyPqFcKcs7xmWglsbMnh7 /1jF0FQ8Z6VtAZHeFC0fSa48m45w2NY0bexaLx4kbwL320peaytl84az+miKV5DXch2o TIK2xX/nAPtoppjJWn2haDTMtbez1lf9zvfUZly+QOFhNTvUyGuESM7bAv3PADbLieoC E/sxLAmi9eiFhoQFf1/zP3e0sEvPYmv5BtlwMHYk8pjwVcOTdBRqSWh7QDLu2lTBWOSJ L8Gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=HJ3VAtuM; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 88-v6si9864350plc.515.2018.08.10.07.53.58; Fri, 10 Aug 2018 07:54:13 -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=@gmail.com header.s=20161025 header.b=HJ3VAtuM; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728226AbeHJQhm (ORCPT + 99 others); Fri, 10 Aug 2018 12:37:42 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:35009 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727209AbeHJQhm (ORCPT ); Fri, 10 Aug 2018 12:37:42 -0400 Received: by mail-pg1-f193.google.com with SMTP id w10-v6so4472618pgv.2 for ; Fri, 10 Aug 2018 07:07:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=HVt7FW19u8tMo6vfrtI8/3GLIdrPIeba9/QiqzhT/oQ=; b=HJ3VAtuMafU621wINd9xmQTToStSPoR5V9hrZZAVM0ir3vSXLNxNFIyyrFwCRJISCM +0hN968bzG83E2U71tr8PkrUr5fNlihoG0pBq56C7sk8BYclOe1gjfaCLZLpz0EZVLDS /RnLezS245RgtzAPhbu7qf+MClugRReDcwI1q7qYLwrccdtferT3nE3Uq1Axmb1bSKDB SvpV7IQtvJdP2hsnpU8Dq/p35XiOOnpIgBV7YSSzrZv2ykbWCR2t+iUiQQ1QKHBBtCdM Ezq9GklBIiMO7HSHjblMrBVBefM74o1YEh7ehsWv4SnAHfZWolI9CBBEDUXSaToEqTsz 3vvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=HVt7FW19u8tMo6vfrtI8/3GLIdrPIeba9/QiqzhT/oQ=; b=TRfsoucAbFvTGzC7DWtuU1hM9bo5Iy1fFpXS5Vofv+nO0bjAjolIBe7oSR6mEmYeHD Hgi2QWxvmoW19d2qMglj880VBYQ9skr/5SikvplICagA1g1+VBWyIiGnRw/6xdqJunJb nLeLVeFp7fvdKKqbQobKFkQ3f7Z3+aqYvEpcc2T2wipEFQhKk86890MFuzVSfT87nlT2 nRdYtIDZppDpbNFWpqHI0LMFj5eC19pw+98U8wp8gOhWYLaOFmPPUI/MLRWCBABm97MK 4Atemll6ePe3yyKgh5Ui7F5xxVzL88o0acLNJ/Djp1BHxz27e0nRHtsb4YV5+F0mVlWP cxIQ== X-Gm-Message-State: AOUpUlFTljci4ZjYt0QSnkV8Nq2Loqi0W69ZOt52SP+Js1WGODmp+hph 3cE8U8rs4z9o2R6+ucver54= X-Received: by 2002:a65:46ca:: with SMTP id n10-v6mr6744976pgr.345.1533910058376; Fri, 10 Aug 2018 07:07:38 -0700 (PDT) Received: from localhost (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by smtp.gmail.com with ESMTPSA id x80-v6sm24726209pfe.129.2018.08.10.07.07.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 07:07:37 -0700 (PDT) Date: Fri, 10 Aug 2018 07:07:36 -0700 From: Guenter Roeck To: Palmer Dabbelt Cc: Christoph Hellwig , aou@eecs.berkeley.edu, tklauser@distanz.ch, Arnd Bergmann , Andrew Waterman , linux@dominikbrodowski.net, dan.carpenter@oracle.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/2] RISC-V: Define sys_riscv_flush_icache when SMP=n Message-ID: <20180810140736.GA13061@roeck-us.net> References: <20180809221952.24260-1-palmer@sifive.com> <20180809221952.24260-2-palmer@sifive.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180809221952.24260-2-palmer@sifive.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 09, 2018 at 03:19:51PM -0700, Palmer Dabbelt wrote: > This would be necessary to make non-SMP builds work, but there is > another error in the implementation of our syscall linkage that actually > just causes sys_riscv_flush_icache to never build. I've build tested > this on allnoconfig and allnoconfig+SMP=y, as well as defconfig like > normal. > > CC: Christoph Hellwig > CC: Guenter Roeck > In-Reply-To: <20180809055830.GA17533@infradead.org> > In-Reply-To: <20180809132612.GA31058@roeck-us.net> > Signed-off-by: Palmer Dabbelt Tested-by: Guenter Roeck > --- > arch/riscv/include/asm/vdso.h | 2 -- > arch/riscv/kernel/sys_riscv.c | 12 ++++++++++-- > 2 files changed, 10 insertions(+), 4 deletions(-) > > diff --git a/arch/riscv/include/asm/vdso.h b/arch/riscv/include/asm/vdso.h > index 541544d64c33..ec6180a4b55d 100644 > --- a/arch/riscv/include/asm/vdso.h > +++ b/arch/riscv/include/asm/vdso.h > @@ -38,8 +38,6 @@ struct vdso_data { > (void __user *)((unsigned long)(base) + __vdso_##name); \ > }) > > -#ifdef CONFIG_SMP > asmlinkage long sys_riscv_flush_icache(uintptr_t, uintptr_t, uintptr_t); > -#endif > > #endif /* _ASM_RISCV_VDSO_H */ > diff --git a/arch/riscv/kernel/sys_riscv.c b/arch/riscv/kernel/sys_riscv.c > index f7181ed8aafc..568026ccf6e8 100644 > --- a/arch/riscv/kernel/sys_riscv.c > +++ b/arch/riscv/kernel/sys_riscv.c > @@ -48,7 +48,6 @@ SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len, > } > #endif /* !CONFIG_64BIT */ > > -#ifdef CONFIG_SMP > /* > * Allows the instruction cache to be flushed from userspace. Despite RISC-V > * having a direct 'fence.i' instruction available to userspace (which we > @@ -66,15 +65,24 @@ SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len, > 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 > > return 0; > } > -#endif > -- > 2.16.4 >