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=-6.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 D6FE1C2D0A3 for ; Fri, 6 Nov 2020 09:02:29 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 23207216FD for ; Fri, 6 Nov 2020 09:02:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="wubGnpb1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 23207216FD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 53D346B005C; Fri, 6 Nov 2020 04:02:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4ED5F6B005D; Fri, 6 Nov 2020 04:02:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 369AB6B0068; Fri, 6 Nov 2020 04:02:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0099.hostedemail.com [216.40.44.99]) by kanga.kvack.org (Postfix) with ESMTP id 074A26B005C for ; Fri, 6 Nov 2020 04:02:27 -0500 (EST) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id AD7EA98A4 for ; Fri, 6 Nov 2020 09:02:27 +0000 (UTC) X-FDA: 77453402334.20.join60_06129ca272d1 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin20.hostedemail.com (Postfix) with ESMTP id 8A10C180BFBA1 for ; Fri, 6 Nov 2020 09:02:27 +0000 (UTC) X-HE-Tag: join60_06129ca272d1 X-Filterd-Recvd-Size: 3997 Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) by imf01.hostedemail.com (Postfix) with ESMTP for ; Fri, 6 Nov 2020 09:02:26 +0000 (UTC) Received: by mail-lj1-f195.google.com with SMTP id l10so602695lji.4 for ; Fri, 06 Nov 2020 01:02:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gGpm+hTgP3uSHc11kp/wC/9AQaj0Wxc5iwlyk0l4rxU=; b=wubGnpb1Wk3yX0c3VStUaEQWmvHsW7CyYe5k/5JpppMRaNKhSxvZwzi6+l+B17Toqx TxcuChm2PsWjT3wmCjLSFCqlc6GrWcbk+bCmyLTX7tt6q+SdmHh1KPErgv/j+hC5Zxbs MMkgs9gJhHT5Jc2Ga18UZ6Gmuv1m35fRv91zZcGI7saFibfT4JpZ40GHRLxIjtVdsGPP 1HMdDGzc5mF0rmvewC0WKU6atzUIkS7ZInNX6yBSt8PfIfeHWDgjTbdiErWyFrk+EwaC szUyHdXneTpqcWQf2XlFQf42kLcHxSvS/9Qj8EQDSDi2bqba+X4gLNhK0vaCBG/Nfqos lHhg== 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=gGpm+hTgP3uSHc11kp/wC/9AQaj0Wxc5iwlyk0l4rxU=; b=sQXYzQBLW4/0dbDduKjYIyjmjpsy5EOPiPpjW7ujawM1FNZegGUw/HDWEwalp9pjmd zghyokQh96b9jhADTc+cI34VOsiq6qS9O0OJGg0EAdwwE9HAqALh+IQCKU0B8kk2FUb6 B/G+QKZE96WL2m8Mj6MNK5m+/JQfFX9zc9hef3HOjYqqYYvn+oqoHmZHxq8EBUOHr5u+ OGRotKsuMGZfQz0Wg+g6RaoDam48HPCZc5dd0WHZB1EWqDgQcYbGJ6kYPluNC0QuO5Iq OMT+WFMOZVI9Pnt9rL3G0wVSOxYg6T5fYOWszga3Q2RkLf7DdxBm0FiM2ea/ah+Nqlu6 RsWQ== X-Gm-Message-State: AOAM532+6Y/5IscKgmXrOvu/ppI2cyp8J9ubGD9OQnhYdLpFSLkEJkX/ ISwypSsCtXwni+CcqRnYmw09kAqoBlLd0zC+TQWZgQ== X-Google-Smtp-Source: ABdhPJwpBGjD4hxUWe5IBanElpgpL/GBbicPDmJOUdpSaqy6eP8G9wyJ2i0EBTejTmRu+M3D7rzTZYnldm2CMLo7h9o= X-Received: by 2002:a05:651c:1205:: with SMTP id i5mr409279lja.283.1604653345700; Fri, 06 Nov 2020 01:02:25 -0800 (PST) MIME-Version: 1.0 References: <20201030154519.1245983-1-arnd@kernel.org> <20201030154919.1246645-1-arnd@kernel.org> <20201030154919.1246645-2-arnd@kernel.org> In-Reply-To: <20201030154919.1246645-2-arnd@kernel.org> From: Linus Walleij Date: Fri, 6 Nov 2020 10:02:14 +0100 Message-ID: Subject: Re: [PATCH 2/9] ARM: traps: use get_kernel_nofault instead of set_fs() To: Arnd Bergmann Cc: Russell King , Christoph Hellwig , "linux-kernel@vger.kernel.org" , Linux ARM , Linux-Arch , Linux Memory Management List , Al Viro , Arnd Bergmann Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Oct 30, 2020 at 4:49 PM Arnd Bergmann wrote: > From: Arnd Bergmann > > ARM uses set_fs() and __get_user() to allow the stack dumping code to > access possibly invalid pointers carefully. These can be changed to the > simpler get_kernel_nofault(), and allow the eventual removal of set_fs(). > > dump_instr() will print either kernel or user space pointers, > depending on how it was called. For dump_mem(), I assume we are only > interested in kernel pointers, and the only time that this is called > with user_mode(regs)==true is when the regs themselves are unreliable > as a result of the condition that caused the trap. > > Reviewed-by: Christoph Hellwig > Signed-off-by: Arnd Bergmann Not to mention the drastically improved readability of the code, as ARM developers no more needs to cross-reference the x86 FS segment register to figure out what this might be doing. Reviewed-by: Linus Walleij Yours, Linus Walleij