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 16FCEC2D0A3 for ; Fri, 6 Nov 2020 09:02:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AA9C020A8B for ; Fri, 6 Nov 2020 09:02:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="wubGnpb1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726157AbgKFJCc (ORCPT ); Fri, 6 Nov 2020 04:02:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726027AbgKFJC2 (ORCPT ); Fri, 6 Nov 2020 04:02:28 -0500 Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A3F1C0613CF for ; Fri, 6 Nov 2020 01:02:27 -0800 (PST) Received: by mail-lj1-x242.google.com with SMTP id v19so596952lji.5 for ; Fri, 06 Nov 2020 01:02:27 -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=XRrRBfPYH/bkmsZOx4qMrn5D4jrJX+l5qtooLUP29hp5oCszEgVpm/tuGbgg89JmiC FRAN3VoL7UsDR9tUj/1/nDfppTFRcVpFcqVrBNW7k05Uzq5u292oWCBUA6n1tVBXSNoI ucGbga1LrxaFGBWFZeEvjRZVFQTHRQWcwSpI5j6AcXLHHZIZANFauFrQbwBAX0ZL3Ri3 S1tEbhVP6zU6Syk80igF/gjD1xyOL3K1qjS0CreeFMl/8OETLoFPg2iK0ZYqzhWTlZCo u6PTW9/ciKQ2i76eZSgD78Xik9vKpt02DUEtbTcDGtjSFxFjMYheL6lkM08jGoh5uJvk Yp/g== X-Gm-Message-State: AOAM533JV1AuSvVnXuJsslqfnbd2Z4t4TBRvfk8/FuFcw/TtD4bOXvjI RzdDTL3NJXU57TD4EfU0NcVJue1Gte6g3LvAW++5aA== 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" Precedence: bulk List-ID: X-Mailing-List: linux-arch@vger.kernel.org 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