Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp810870imm; Wed, 17 Oct 2018 08:40:04 -0700 (PDT) X-Google-Smtp-Source: ACcGV60LJI2sQIhmbuMMo7cqn/WzjHE6clUuxR9JswW60/wxZY7nql7pfyIIooK4ENeiVvFQSN8S X-Received: by 2002:a63:ed55:: with SMTP id m21-v6mr24995849pgk.147.1539790803923; Wed, 17 Oct 2018 08:40:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539790803; cv=none; d=google.com; s=arc-20160816; b=KjFva5XvgZDadwJcD1LCHZZuOhefCjuiUB8RSEO/+Lsml1pCi7+BVVnxlucVMghgne pXv/KaZSmmemfqZ9niSgvtvCcXFPzjVmlzA8cTl9wSlOMCYBUAZ29HG+4qlflBfaOeyW HvqIeoKeR4s28lGySkMRtk/mNPfGIe1Nq4MLQukWw1Ve+pZxFpaiilLgunoEZgkVmtQe ZbnIsqGsQThq0InOcJOOod/aQTrsFhiPtunZfZ4eUkcw3387mQgLAjQl5WFCTr4i4/B0 Kv4ld2TIKyGBA7rV1iErLV+RFXiHfBBi7XF2iobvn345J7GLW8qJfcHCSDjBpBhBxhj3 E3/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=XtqOi9bO2GYWQ15t2HKZ3ytuZ0JilaZMq8xk0e0v3mk=; b=TkZDFDpr0dRZvNVw9aI/v3G4qbyMBVIX1mzOUZXhkgZhB7QBAFEAIrCGoJNSF5Qlqu RIYvEKswFBD9rqUynF8SwlY2caMtqEN995s6wg4ZWOQaJPkJcG0/qPVkcqqvBhS9deUN wAQonSxmFvbr6BhZ+6kLN/TawNW8vQ7iljYl9F7dlAsIR6JWxvk3EoJ6tLzFwhB4nDkE 00XQkumIcvmPEEp5o4xPchjLFmD625+OGv/of658vXHzshSdpEvqOVozUJBNQN1NahKz qV09dk+PoTN/eYE/7cPQg2Ed2jaP69g/0clr8wZNq+/grHD8YyNVA2m80G3zjwWDmG2g AKvw== ARC-Authentication-Results: i=1; mx.google.com; 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 h9-v6si17754524pll.225.2018.10.17.08.39.47; Wed, 17 Oct 2018 08:40:03 -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; 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 S1727517AbeJQXeK (ORCPT + 99 others); Wed, 17 Oct 2018 19:34:10 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:40058 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727048AbeJQXeK (ORCPT ); Wed, 17 Oct 2018 19:34:10 -0400 Received: by mail-qk1-f196.google.com with SMTP id a13-v6so16736499qkc.7; Wed, 17 Oct 2018 08:37:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XtqOi9bO2GYWQ15t2HKZ3ytuZ0JilaZMq8xk0e0v3mk=; b=AaOMVU8AVJ4CGIPbgD8je9nBcTnG+DwQcwudPK5Iw98TUMioQfaLJLspVufsAHlz+I ScamkAl8ScH0Wr3+Jlno9DWdQM7DMKlOfvTNEIT0ZnKC+pB422Ypj4161DROmjz92fUG V1YOQuDTg0RPjJJtjaAIx0xFMWTcpyaOSmXVTdvpJO1FMqyv9ENh11nPzmQW/ERUNi8/ C0g1OD7acO+QYWhQaEOF82NC2iD4kkQ8nE0zy8HpFyIhju8SCX5dPZN2l1tmo6weqg0G M4gLbDXX+VKEJ6WnTsqGN3kjpmr6THzWCidiEBPNmwHupnnk1sicV06mMISQXDdp0uqZ HP4A== X-Gm-Message-State: ABuFfogOWbiEmC7WtVbyek3EL0Q8Q04CX+gSzFC5LzwqlYQ8slTw9FZX EFEpL9WufeILmuoG3rSvxz82hNpl8Ugi8nZEEPA= X-Received: by 2002:a37:2b66:: with SMTP id r99-v6mr2922212qkh.343.1539790674450; Wed, 17 Oct 2018 08:37:54 -0700 (PDT) MIME-Version: 1.0 References: <1c0d8cddcdf15e5f397b3e42b76461e97d6e34ad.1539655732.git.ren_guo@c-sky.com> In-Reply-To: <1c0d8cddcdf15e5f397b3e42b76461e97d6e34ad.1539655732.git.ren_guo@c-sky.com> From: Arnd Bergmann Date: Wed, 17 Oct 2018 17:37:38 +0200 Message-ID: Subject: Re: [PATCH V9 14/21] csky: User access To: Guo Ren Cc: Andrew Morton , Daniel Lezcano , David Miller , gregkh , Christoph Hellwig , Marc Zyngier , Mark Rutland , Peter Zijlstra , Rob Herring , Thomas Gleixner , Linux Kernel Mailing List , linux-arch , DTML , Rob Herring , c-sky_gcc_upstream@c-sky.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 16, 2018 at 5:05 AM Guo Ren wrote: > > The patch adds "user access from kernel" codes. > > Signed-off-by: Guo Ren > Cc: Arnd Bergmann > --- > arch/csky/include/asm/uaccess.h | 416 ++++++++++++++++++++++++++++++++++++++++ > arch/csky/lib/usercopy.c | 262 +++++++++++++++++++++++++ > 2 files changed, 678 insertions(+) > create mode 100644 arch/csky/include/asm/uaccess.h > create mode 100644 arch/csky/lib/usercopy.c Reviewed-by: Arnd Bergmann The 64-bit __put_user() is usually what everyone gets wrong, but your version seems fine. Also the access_ok() checks and the copy_to_user() result value all look correct. Arnd