Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp988084rdg; Fri, 11 Aug 2023 06:32:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHt6wUhTpVDTxq04ElHmLLAwhKU/QQJwzeYWb+vjfk6OfYbIsMXTjQKS5OsEYrLynijwbNc X-Received: by 2002:a05:6a00:1782:b0:687:22ce:365f with SMTP id s2-20020a056a00178200b0068722ce365fmr2398834pfg.29.1691760773217; Fri, 11 Aug 2023 06:32:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691760773; cv=none; d=google.com; s=arc-20160816; b=IKLKWPB6vK/uSJiKuz4nsRW/TMBXZ8ePRb5PtXs5hjoTIIBYDyFX4flP9t61yrU+Nn GxR+r4bXIb0rpGdFfUJWUW9OvQILULOyJVAm13CqbkZtPLXngBKyux0wZ8BUpGoVP/pr eTWI7NeEo1TCYKqO7eWNGoyLz3sScgm4qztNUdHIc+GXCdB5Ur5Bq/PozQyCGJe5UXmM AbJ8AMUENuBN03gY4k3brdQHDCCKK57I5jA2Br8FlG+QD2Gi8bIJ5cAgtzUzCHVzlzpO 7Sv1KfGUOjmcTNQNe7yTqKWXRWUggqDiDykg8Leaa/YDbF3poaYyVv21DNt/U8HO5Lro TB4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=1FHav62wGjkvJfOtUkSd7cOKVq97NsYIFXy+uWXuPQo=; fh=ZmD7FloCuIdY8/lnIAZEWgUINgXFu8uOVdm70CbX1Xc=; b=z4ZBNyPocUjXYEcmPjOdDFYrBHgoP4UX737E4nb8vnKhGO8CN/MBwx5Vpraz+FC20i d2+7Hqp7OtpNseFAk4x/+t/aysuHoZJfRQPPtAcnvjThtLxzbhvT5oMrWEPyQiad2TWY oxwB+ME35vt71I0xxPTmgXjU64iam2f6xJljl1M004nnXw2SprXsPNXy4MLh4b3qgrx5 xaiPuEEBtUSDhjfsGkCmvlB99cBhV0ta2O5fnJsguld9iEoXKo8JS4cm8RnBQSmxQ0rG bGJN4eab9D4TWDaVEqyvdmgb+CrOaNxhmz/yNPYwMeFRuP+8dv3Go3eS+hky8TZX23ic h4gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LHYfk427; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q65-20020a632a44000000b00565314fb64bsi3484995pgq.744.2023.08.11.06.32.40; Fri, 11 Aug 2023 06:32:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LHYfk427; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234782AbjHKMd6 (ORCPT + 99 others); Fri, 11 Aug 2023 08:33:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229751AbjHKMd5 (ORCPT ); Fri, 11 Aug 2023 08:33:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47BF830C1 for ; Fri, 11 Aug 2023 05:33:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D866C67031 for ; Fri, 11 Aug 2023 12:33:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E65AEC433C7; Fri, 11 Aug 2023 12:33:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691757236; bh=1FHav62wGjkvJfOtUkSd7cOKVq97NsYIFXy+uWXuPQo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=LHYfk427SN+8jcuF4CGk2ctHNHJrOyNVbxrKiyAnLNkdP8HSx8OAFvXv5wAo92046 R/q+eDvY+nJpxiPoTGYLEOzMPqipfJEi1VedDPSTfsauAK29sLPTgD/3seErq/9zrL R+2ts+V9OJZl6OM0Gwb3AVOSQBwP8/uRIFPJgzyuwpK/XKTg1M18WwTmGWFGb/3Nd7 5bpp1y38+bQBDnORdZhVikVDAlzEJAFJYSPMOpI/X6umIIXpeHGd8WRRlTe7jBouA7 DAoYTFfeKQHEGBQKzI7pxIdhuTEnxMeSRhBe4+IrlRXI25vHOSfNwNdLR7I+RNJSiv GqzwqbnkjCftg== From: =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= To: Alexandre Ghiti , Alexandre Ghiti , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alan Kao , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Bo YU , Aurelien Jarno Subject: Re: [PATCH -fixes] riscv: uaccess: Return the number of bytes effectively copied In-Reply-To: References: <20230811110304.1613032-1-alexghiti@rivosinc.com> Date: Fri, 11 Aug 2023 14:33:53 +0200 Message-ID: <87r0o9ahce.fsf@all.your.base.are.belong.to.us> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Alexandre Ghiti writes: > On 11/08/2023 13:03, Alexandre Ghiti wrote: >> It was reported that the riscv kernel hangs while executing the test >> in [1]. >> >> Indeed, the test hangs when trying to write a buffer to a file. The >> problem is that the riscv implementation of raw_copy_from_user() does not >> return the number of bytes written when an exception happens and is fixed >> up. > > > I'll respin another version as the changelog and the title are=20 > incorrect: the uaccess routines should not return the number of bytes=20 > copied but actually the number of bytes not copied (this is what this=20 > patch implements). > > I'll wait for feedbacks before doing so! Yikes! Nice catch. Functions like fault_in_readable() will fail horribly w/o this. I wonder why we haven't seen this problem more? Feel free to add my RB to your next spin! Reviewed-by: Bj=C3=B6rn T=C3=B6pel