From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Reding Subject: Re: [PATCH v3 02/23] drm: remove drm_vblank_no_hw_counter assignment from driver code Date: Tue, 7 Feb 2017 12:01:41 +0100 Message-ID: <20170207110141.GB29507@ulmo.ba.sec> References: <1486458995-31018-1-git-send-email-shawnguo@kernel.org> <1486458995-31018-3-git-send-email-shawnguo@kernel.org> <1493652.dxNfDRezma@avalon> <20170207104449.GS27312@n2100.armlinux.org.uk> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1892796538==" Return-path: Received: from mail-wr0-x241.google.com (mail-wr0-x241.google.com [IPv6:2a00:1450:400c:c0c::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id C5C656E66D for ; Tue, 7 Feb 2017 11:01:44 +0000 (UTC) Received: by mail-wr0-x241.google.com with SMTP id k90so5308278wrc.3 for ; Tue, 07 Feb 2017 03:01:44 -0800 (PST) In-Reply-To: <20170207104449.GS27312@n2100.armlinux.org.uk> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Russell King - ARM Linux Cc: Neil Armstrong , Daniel Vetter , Liviu Dudau , Laurent Pinchart , Daniel Vetter , Marek Vasut , Alexey Brodkin , Xinliang Liu , Tomi Valkeinen , Mali DP Maintainers , Ben Skeggs , Jyri Sarha , dri-devel@lists.freedesktop.org, Maxime Ripard , Shawn Guo List-Id: dri-devel@lists.freedesktop.org --===============1892796538== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="s/l3CgOIzMHHjg/5" Content-Disposition: inline --s/l3CgOIzMHHjg/5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 07, 2017 at 10:44:49AM +0000, Russell King - ARM Linux wrote: > On Tue, Feb 07, 2017 at 12:42:15PM +0200, Laurent Pinchart wrote: > > On an unrelated note, for security reasons we should try to make the dr= iver=20 > > structure static, or at least move ops to a static structure. >=20 > ITYM "const" not "static". >=20 > "static" doesn't get you anything from a security point of view. "const" > gets you write protection, so code can't modify the function pointers. We can't easily do that for struct drm_driver at the moment because some fields end up being modified at runtime. I suppose we could move some of those fields over to struct drm_device, which, in many cases, would make more sense anyway. What i915 is currently doing is probably fine for all existing cases, but it sets a bad example for other drivers that may end up having to drive multiple devices with one driver, so modifying the global driver is likely going to break things. Thierry --s/l3CgOIzMHHjg/5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAliZqRUACgkQ3SOs138+ s6Fp+g//ZpeGXM8eKEzx6f1Ym4t2QtSCCp/M3WucLoqJB++ZIJKtqkm/aQKfW79J TvkaFVs0HtCTeCCA9iu7RZqVQ2EUtfA6T4Ttx5k63q19/2vbo7KkkMGZ6v5yk/27 fAemOZBuoZkFncS3+RLTx9mkg2+GQcujKELNzqC9aVCUG0nFzncFeA/0UMziTQML Xe0AKNiEbLhw4ATMSASxzpC0VIUudmEA7gxoyBCJ9TAvp3vr7+y5Ym/xp57ctmtT 6pbjj3jYwkmAv1BpNTaXrOntatUiCwh381q5xItWN1hilj3ABKjs4kQpwKNu8z35 Wqljd9SQtExvy6VE2iC4GkTjAml8e5nb2i6rOGGx57iUdQnDPxjZhHw/O+F0Hssf uMoPcMwhh+CVH8slbtRZ9Ao7ZhA1z0Pb3jHVdaSgxjABcwhntfb23pTDVL1wXFV+ b9U/T9lzLghmtPalzI4nAXHpKWpWQBWylXwOovmeA1bijFtWZCWlyQwqmDPb92y8 XlJMwTBKc4alYVMFyiNuNVJCXfLw4Dl1TocqAPMBjlTEk2a8jL6RDtxhmkzkqsD7 FdAGBvCXFip+jOHbebQuQ3jDGJ8peev9THvymF1Cxvrn+7/pjW6wZ7FX5Mj53iJ5 MkiWb7GO7ThfPdWkY044o7PsYx7X8SScPjh5Vid1zwc/vhwotV0= =mBzs -----END PGP SIGNATURE----- --s/l3CgOIzMHHjg/5-- --===============1892796538== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============1892796538==--