Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp817044imm; Wed, 17 Oct 2018 08:45:54 -0700 (PDT) X-Google-Smtp-Source: ACcGV62quZ3BlsL04Z3qv7EdHHNuA0W5I5WqY8yTlgAEY2EoBfRnB4o45GYJawrEjlPSvLHmViPX X-Received: by 2002:a62:34c5:: with SMTP id b188-v6mr24391358pfa.65.1539791154891; Wed, 17 Oct 2018 08:45:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539791154; cv=none; d=google.com; s=arc-20160816; b=ENjTzyqB+fYSXNDA5fxbA2ZwPLk9z/bdjEH5K3euLTgNJa06zZfQIl2H96AOLp9M1Y yZf0hMmz+/AUOdUoN8nDhrNLlQ/A3pqNPKAgs2X2L6Z4QGGKI68z6liwI9EesQjKYcHV QhTCXLNFApvlVtUK6q5o98GWvICWKj9PoyBHH2G7IsmiENAGMP0GuBvjiz/q1GB3cX7I LVjnILUMFNliuN/qhdB0MF/EChZE490znf8LMDKE/8JCivbyjPkx+8u/uHiG7/7wLayf rTXxyzX1uJzxj/bpbh84voD6Z5bwoATanxKgbHtgw5ESt1zalj7jd15AvT6edJlDSVBn Ariw== 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=/hC5+/aeRgdkw2kRABeizbTqREY0y51ywyP4l5uHV8w=; b=hk4/B0cZHumkgl20etrikUQ/LcmsK5TLjT2FVj5tCmhaFfSXFe4vhgw0FxsgDyC4ce 8jQbpLx5HjgaMGJP5p4onZsiJrf/BxAeS/sEiVLqr/IJTdCaCkmo62HTGa79xLkvWLO4 2N38XPoFD5dsIMMMHLv8TeKy5fG4lpvXG3OVzq7IlWYyIKS3Ejf3NpRVNEMRO1/pMu2P 17CqNsUlPhyUQVJRNigniPs0z/8ZAjQywtfR5Y756E3uwY/FooCpwL358MjKRgYkvumV XGJDTOa0zSdu5LXZvX7EmQb0zSTEqUcj4EWeI7GQZieKNUdW5Y53TS8tuAlTVzk5H95T P71w== 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 y3-v6si16325575pga.500.2018.10.17.08.45.39; Wed, 17 Oct 2018 08:45:54 -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 S1727852AbeJQXkv (ORCPT + 99 others); Wed, 17 Oct 2018 19:40:51 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:44548 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727175AbeJQXkv (ORCPT ); Wed, 17 Oct 2018 19:40:51 -0400 Received: by mail-qk1-f194.google.com with SMTP id y8-v6so16747771qka.11; Wed, 17 Oct 2018 08:44:34 -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=/hC5+/aeRgdkw2kRABeizbTqREY0y51ywyP4l5uHV8w=; b=AB9qaNth661jc/M7mWoMKb5YIattiSNZuDYfxQ7ruzLq5pR0niQK08iTuCvD+w3XS0 Ep4BF6zTGI2tFXbpJzoisv6uPcdJQmFrQsYAnntDPeXQbTZ5VPfU/y2BbOiCd+yKH8qU wssmT7uFAXtD3cKc27hW9bECaNvfz83K7s9URxy0saAWukpq4/z/zVeumyXNH2fCFuhv ZyOmv1u6ZJAiw7J9kAGc7xKXQakrV28ymbgmvR5V2O+9+PZgC/28G8oxulvlDFm3iI+i SO3KctcZIRMLJd54Lci56s5L3sWs6MKfC+MtYlGIlpn8WKffJFUG2kZgMIG6yvb3nmFm Irew== X-Gm-Message-State: ABuFfogqTaz6QdM5065tEEi7b8JU5WSOKVCyeeMxRMkdBc0N1dMIknOk GwE4IxJ8PxJ8Cl2ooPmaNmtYbq7nRC9p0DcmO7k= X-Received: by 2002:a37:e21a:: with SMTP id g26-v6mr24611380qki.330.1539791073838; Wed, 17 Oct 2018 08:44:33 -0700 (PDT) MIME-Version: 1.0 References: <4bc11ff0cff5960892a464189605f9bc808383fc.1539655732.git.ren_guo@c-sky.com> In-Reply-To: <4bc11ff0cff5960892a464189605f9bc808383fc.1539655732.git.ren_guo@c-sky.com> From: Arnd Bergmann Date: Wed, 17 Oct 2018 17:44:17 +0200 Message-ID: Subject: Re: [PATCH V9 21/21] csky: support dword access for get_user_size() 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:33 AM Guo Ren wrote: > > Support dword access for get_user_size and redesign put_user_size with > the same style of get_user_size. It's Ok to use xxx_user_asm_common for > all size of variable with ldb, ldh, ldw, ld.d > > ld.d rx, (addr, 0) could "rx <= addr" "and r(x+1) <= addr+4" and this also > follow abiv2 gcc ABI for dword access. Are you sure this is correct for this? static inline u32 get_64_to_32(__u64 __user *p) { u32 ret; get_user(ret, p); return ret; } If I read __get_user_asm_common() right, the ld.d would overwrite two registers, but the caller only expects one, so it clobbers one that might be in use. Arnd