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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 86764C43334 for ; Wed, 1 Jun 2022 22:29:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=aSxK+gUyFxQvlcL4VnMzP4feaawA8p5zU1JZsPgjPmw=; b=q/5ID4GfpSvwgU 1szwHufgTe4BaxuEKom4YT72gAVv631Ita05VFURnrZd56/3ulm/JO7OFq/Egk/sQ+/dWZQ2Y1XQr Yd0yzJ2LAJZQVCeKNVKawDX/bVM4Feszkfir9h2GQFUnRzotz84niWVh7HLRk05iLnErKndobloWO tCxBgjPBDXD3F/j6un5bCM8m1y0zgJ8xQ+rw1c3cSWC/r1lxyEYcKtL/ITQsCSYjDESL0vEMIKmMY f2BiPPrqM7blPdHJzRQNa0aRW16tiQoXMZzXoTrNoYFO2M2d8TZ0NhttSWh33+EJbqIMMvZepvors AOgQ2jMuDnrQIS24S/3A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwWpU-000fVj-9q; Wed, 01 Jun 2022 22:28:40 +0000 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwWpQ-000fUE-0y for linux-arm-kernel@lists.infradead.org; Wed, 01 Jun 2022 22:28:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=AkDE+5ZI+IK3BHuS7N7ViWTtDYvZB4rptzcmh8eb1n8=; b=ciO8DIRhw86/ODL5KXlAbuCIsWdUVr65CDTHtk2tDoP9AoVAH7qNtfnF KU+mwi2rgZ6Cf64GqsKh3HgBkBJMfS2VQbVTEcVT4U7O3d2xR7VeMOmDI 2ZKs9XO4RK+y56oP0BgJpCEo8Qpz091wtL7m22O6JPphXLTN2WA5VzsxQ Y=; Authentication-Results: mail2-relais-roc.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=keisuke.nishimura@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="5.91,269,1647298800"; d="scan'208";a="39079992" Received: from eth-east-parth2-46-193-69-7.wb.wifirst.net (HELO [10.188.210.33]) ([46.193.69.7]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2022 00:28:28 +0200 Message-ID: Date: Thu, 2 Jun 2022 07:28:29 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: mainline build failure due to f1e4c916f97f ("drm/edid: add EDID block count and size helpers") Content-Language: en-US To: Linus Torvalds Cc: Julia Lawall , Arnd Bergmann , Jani Nikula , Sudip Mukherjee , Russell King , Viresh Kumar , Shiraz Hashim , =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , dri-devel , Linux Kernel Mailing List , Linux ARM , SoC Team References: <91E67F46-A3C7-4159-9E0C-C6C6306F3669@inria.fr> From: Keisuke Nishimura In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220601_152836_564992_08921670 X-CRM114-Status: GOOD ( 16.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2022/06/01 1:41, Linus Torvalds wrote: > On Tue, May 31, 2022 at 1:04 AM Arnd Bergmann wrote: >> >> As an experiment: what kind of results would we get when looking >> for packed structures and unions that contain any of these: > > I don't think we have that. Not only because it would already cause > breakage, but simply because the kinds of structures that people pack > aren't generally the kind that contain these kinds of things. > > That said, you might have a struct that is packed, but that > intentionally aligns parts of itself, so it *could* be valid. > > But it would probably not be a bad idea to check that packed > structures/unions don't have atomic types or locks in them. I _think_ > we're all good, but who knows.. I am Julia's student at INRIA and I heard from her that there is an opportunity to use Coccinelle to find specific types in packed struct or enum. I found 13 definitions of packed structure that contains: > - spinlock_t > - atomic_t > - dma_addr_t > - phys_addr_t > - size_t > - struct mutex > - struct device - raw_spinlock_t == Results == security/tomoyo/common.h: atomic_t in tomoyo_shared_acl_head drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls.h: spinlock_t in key_map include/linux/ti-emif-sram.h: phys_addr_t in ti_emif_pm_data drivers/scsi/wd719x.h: dma_addr_t in wd719x_scb drivers/net/wireless/intel/ipw2x00/ipw2200.h: dma_addr_t in clx2_queue drivers/infiniband/hw/irdma/osdep.h: dma_addr_t in irdma_dma_mem drivers/infiniband/core/mad_priv.h: size_t in ib_mad_private drivers/crypto/qat/qat_common/qat_asym_algs.c: - dma_addr_t in qat_rsa_ctx - dma_addr_t in qat_dh_ctx drivers/atm/idt77252.h: dma_addr_t in idt77252_skb_prv arch/s390/include/asm/kvm_host.h: atomic_t in kvm_s390_sie_block drivers/net/wireless/ath/ath10k/core.h: dma_addr_t in ath10k_skb_cb drivers/net/wireless/ath/ath11k/core.h: dma_addr_t in ath10k_skb_cb drivers/crypto/ccp/ccp-dev.h: dma_addr_t in ccp_dma_info The last 3 structures have a dma_adddr_t member defined as the first member variable. Most of the others also seems valid. I used this SmPL script to find them: @e1@ type T; identifier i; position p; attribute name __packed; @@ T@p { ... ( atomic_t i; | raw_spinlock_t i; | struct mutex i; | spinlock_t i; | dma_addr_t i; | phys_addr_t i; | size_t i; | struct device i; ) ... } __packed; @e2@ type T; identifier i; position p; @@ T@p { ... ( atomic_t i; | raw_spinlock_t i; | struct mutex i; | spinlock_t i; | dma_addr_t i; | phys_addr_t i; | size_t i; | struct device i; ) ... } __attribute__(( ( pack | __pack__ ) ,... )); @script:python@ ps <