From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D995C2D0E8 for ; Fri, 3 Apr 2020 11:51:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 58B612078C for ; Fri, 3 Apr 2020 11:51:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403794AbgDCLve (ORCPT ); Fri, 3 Apr 2020 07:51:34 -0400 Received: from mx2.suse.de ([195.135.220.15]:37400 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726087AbgDCLve (ORCPT ); Fri, 3 Apr 2020 07:51:34 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id D2341AC50; Fri, 3 Apr 2020 11:51:29 +0000 (UTC) Date: Fri, 3 Apr 2020 13:51:27 +0200 From: Michal =?iso-8859-1?Q?Such=E1nek?= To: Nicholas Piggin Cc: Arnaldo Carvalho de Melo , Alexander Shishkin , Allison Randal , Andy Shevchenko , Arnd Bergmann , Thiago Jung Bauermann , Benjamin Herrenschmidt , Sebastian Andrzej Siewior , Claudio Carvalho , Christophe Leroy , "David S. Miller" , "Eric W. Biederman" , Eric Richter , Greg Kroah-Hartman , Gustavo Luiz Duarte , Hari Bathini , Jordan Niethe , Jiri Olsa , Jonathan Cameron , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Mark Rutland , Masahiro Yamada , Mauro Carvalho Chehab , Michael Neuling , Ingo Molnar , Michael Ellerman , Namhyung Kim , Nayna Jain , Paul Mackerras , Peter Zijlstra , Rob Herring , Thomas Gleixner , Valentin Schneider , Alexander Viro Subject: Re: [PATCH v11 3/8] powerpc/perf: consolidate read_user_stack_32 Message-ID: <20200403115127.GY25468@kitsune.suse.cz> References: <20200225173541.1549955-1-npiggin@gmail.com> <184347595442b4ca664613008a09e8cea7188c36.1584620202.git.msuchanek@suse.de> <1585039473.da4762n2s0.astroid@bobo.none> <20200324193833.GH25468@kitsune.suse.cz> <1585896170.ohti800w9v.astroid@bobo.none> <20200403105234.GX25468@kitsune.suse.cz> <1585913065.zoacp2kzsv.astroid@bobo.none> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1585913065.zoacp2kzsv.astroid@bobo.none> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 03, 2020 at 09:26:27PM +1000, Nicholas Piggin wrote: > Michal Suchánek's on April 3, 2020 8:52 pm: > > Hello, > > > > there are 3 variants of the function > > > > read_user_stack_64 > > > > 32bit read_user_stack_32 > > 64bit read_user_Stack_32 > > Right. > > > On Fri, Apr 03, 2020 at 05:13:25PM +1000, Nicholas Piggin wrote: > [...] > >> #endif /* CONFIG_PPC64 */ > >> > >> +static int read_user_stack_32(unsigned int __user *ptr, unsigned int *ret) > >> +{ > >> + return __read_user_stack(ptr, ret, sizeof(*ret)); > > Does not work for 64bit read_user_stack_32 ^ this should be 4. > > > > Other than that it should preserve the existing logic just fine. > > sizeof(int) == 4 on 64bit so it should work. > Right, the type is different for the 32bit and 64bit version. Thanks Michal