Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp5909605ioo; Wed, 1 Jun 2022 15:44:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYgBa5pK9cYa4sxotWlBa+wbg7MRyVe5HR9FYyrfnjfayeMmQK6P9ekC5RlQ6lUniWhwzq X-Received: by 2002:a05:6a02:19c:b0:3aa:1bf8:7388 with SMTP id bj28-20020a056a02019c00b003aa1bf87388mr1389758pgb.455.1654123462825; Wed, 01 Jun 2022 15:44:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654123462; cv=none; d=google.com; s=arc-20160816; b=KKYJOw9xF+6QforrVzErtpdXfprSYp1u3148WxI//mI91y7wuxFpt4T/MALfQuSJrt F10mUu6gRhggAdIONhNgsku2OnTGiMGi1ialbKVcu12H4w5k2SvZARuylPbeRBvB3MV7 ZJSYWVqXLqCGDGM54g1Yljoh2hPuxOFMAAiHup1UTCZ98dESO1YVSsIK2J0jpHmFSNLM isUepfqp9UMs32Qc4BgdSUouhYZHL1FQAREYr/SDG56HAEKV1sDfN+uwc2j67rQNQmwp /ucg1PGkTP0CAWlkZHHHwCNovi6ABqByq+v4MKRIN8KuCf5DGUzeA5jx6dlJY1Ppn33x C7gA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=AkDE+5ZI+IK3BHuS7N7ViWTtDYvZB4rptzcmh8eb1n8=; b=soWyqhcd2SeUnZqx1og/UadMvvPJiZcuaryemUMboDXM1X8EoiRbVYhAjJJsonNvPz 5j4TkhfNgIWVrTJRNCcdW04AewHFD5T+ZHg2XWbL/iUimtYaRp4mRdw6Wn+eJCgV70Mt qvPUIZJUwZVboCGV+f3hBUoVtpdx7+armWYj5Z/j4CJxmWV3WzJO2xBzsGqZsCD7rpMK 8vgyVI82mlURGaAHfVvrGDq3FNx6axws+b6PdpukpYQkLq3beW4NMRTr8urxTPmTTxtf sYPwKHby2Xe6CbtBhTEjvoOy1xe3U3674fn5N9hBdqq1dOg/vtVlQ5RzE4lR7SxnTb64 GnTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@inria.fr header.s=dc header.b=ciO8DIRh; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=inria.fr Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 3-20020aa79203000000b0051871bf07bcsi3364073pfo.309.2022.06.01.15.44.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 15:44:22 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@inria.fr header.s=dc header.b=ciO8DIRh; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=inria.fr Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4E92BDEAF; Wed, 1 Jun 2022 15:28:41 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232214AbiFAW2e (ORCPT + 99 others); Wed, 1 Jun 2022 18:28:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232184AbiFAW2c (ORCPT ); Wed, 1 Jun 2022 18:28:32 -0400 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C3A5B482 for ; Wed, 1 Jun 2022 15:28:29 -0700 (PDT) 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: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 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 <