Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp137688rwi; Tue, 18 Oct 2022 15:21:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7WBnDQ8SPRcRtYsvn3iTwcNUBfF1UYsfyAZKAInhBd3kdyIlga80VPJyUnsgVU4VaIMOvp X-Received: by 2002:a63:e00a:0:b0:43c:7f5c:822b with SMTP id e10-20020a63e00a000000b0043c7f5c822bmr4324624pgh.307.1666131679593; Tue, 18 Oct 2022 15:21:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666131679; cv=none; d=google.com; s=arc-20160816; b=VSwvv6KcQ00TgDWcBytlbsFAU2LoURkMZcdvrj9dEP1hHZwVlnCyVrll+59ClWCJTo hREi/ADlCJRouuiXgZs3hAC4t6lxb6HMYTuuAiu8mW7ASvxj5Qf0zvm8+fz5LAHZSE1K +wLmQCijkpkOmc1a7QYHz+yvnBl2E9ZfhSKmbsZU9gI1H5bMrQUkJ6GnwAT+WecIySi/ dXN8rjjt0iXvwaGgSWP13eORCRWXlAk5j8Y0GwAZPewNRb3CC9yJ+KnVtINFudk40D8J G0sseXZonTe1G9ww8bhWtBfLnblZNb2K05y/jyqr+E0KVm9lAAWGHQDCNWa/SuaK33zR P67g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=kkMKLBAX6vZe5+FR2sneUyNPLXj5K2NRXGHtjYxoPEQ=; b=lhqFnFleY57g4wcD/aI0GpiAQCr87gzJpefOvTKT+E8YERo0FRz5Gybfm6mCBddso+ QHgYmcy2ShNf0d3QdtyPWz60a3W4UCtEsODh4UzmFDP/Bz8N9Xmc+rzFTGYnZR41RPUu Q4Q0C+7i6aCzuUbPROkM2uE4/AAS24vl6Oa55UYZQ5tjdq/VwZMyzo6e8iye0B/J4eBt VYKiBuHG4yBS/Uw1w/KP/pWXm/KQ0A5nMejBxqJF8rM0k4Kef3S21WT1oweCghD6utMB eewRb95mDnBbcnUaMFB4IA54HkjWGvROfz6Ta/PI+tE7WL2x4hb0cvuIwBrIM3J7VKWY jyUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=gPOzOaSQ; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s1-20020a170902ea0100b0017f5dfeb82fsi16756209plg.204.2022.10.18.15.21.08; Tue, 18 Oct 2022 15:21:19 -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=@lunn.ch header.s=20171124 header.b=gPOzOaSQ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229995AbiJRVjm (ORCPT + 99 others); Tue, 18 Oct 2022 17:39:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229719AbiJRVjk (ORCPT ); Tue, 18 Oct 2022 17:39:40 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [185.16.172.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AE681F2DC; Tue, 18 Oct 2022 14:39:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=kkMKLBAX6vZe5+FR2sneUyNPLXj5K2NRXGHtjYxoPEQ=; b=gPOzOaSQRy6C01KNcLOtFWyOWi bIqQ3X7Ob0FyVjq1di8Zlo/yFj/XUeEMn7UOHdxXE9K2rIURKq/+pOyym8Kf//aImSuYrEuhQFmXM cgOWteyLXX56xH9XdMTJVi/3efv8tXEtndSo8Ypnx3fTK6jncvQsoozo3dHYJhi7gdew=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1okuJ6-002OPI-29; Tue, 18 Oct 2022 23:39:28 +0200 Date: Tue, 18 Oct 2022 23:39:28 +0200 From: Andrew Lunn To: Andrew Davis Cc: Sean Anderson , "David S . Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Madalin Bucur , Jakub Kicinski , Eric Dumazet , Paolo Abeni , Camelia Groza , Geert Uytterhoeven Subject: Re: [PATCH net] net: fman: Use physical address for userspace interfaces Message-ID: References: <20221017162807.1692691-1-sean.anderson@seco.com> <97aae18e-a96c-a81b-74b7-03e32131a58f@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <97aae18e-a96c-a81b-74b7-03e32131a58f@ti.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,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 On Tue, Oct 18, 2022 at 01:33:55PM -0500, Andrew Davis wrote: > On 10/18/22 12:37 PM, Sean Anderson wrote: > > Hi Andrew, > > > > On 10/18/22 1:22 PM, Andrew Lunn wrote: > > > On Mon, Oct 17, 2022 at 12:28:06PM -0400, Sean Anderson wrote: > > > > For whatever reason, the address of the MAC is exposed to userspace in > > > > several places. We need to use the physical address for this purpose to > > > > avoid leaking information about the kernel's memory layout, and to keep > > > > backwards compatibility. > > > > > > How does this keep backwards compatibility? Whatever is in user space > > > using this virtual address expects a virtual address. If it now gets a > > > physical address it will probably do the wrong thing. Unless there is > > > a one to one mapping, and you are exposing virtual addresses anyway. > > > > > > If you are going to break backwards compatibility Maybe it would be > > > better to return 0xdeadbeef? Or 0? > > > > > > Andrew > > > > > > > The fixed commit was added in v6.1-rc1 and switched from physical to > > virtual. So this is effectively a partial revert to the previous > > behavior (but keeping the other changes). See [1] for discussion. Please don't assume a reviewer has seen the previous discussion. Include the background in the commit message to help such reviewers. > > > > --Sean > > > > [1] https://lore.kernel.org/netdev/20220902215737.981341-1-sean.anderson@seco.com/T/#md5c6b66bc229c09062d205352a7d127c02b8d262 > > I see it asked in that thread, but not answered. Why are you exposing > "physical" addresses to userspace? There should be no reason for that. I don't see anything about needing physical or virtual address in the discussion, or i've missed it. If nobody knows why it is needed, either use an obfusticated value, or remove it all together. If somebody/something does need it, they will report the regression. Andrew