Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp4314574ioo; Tue, 31 May 2022 01:24:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNchYJoSKxkANMlovbonhv2Irz8TSQ9B8Rb9yiPAsk/AxkXyFJGhXUw1hyAGC8nlPME0u/ X-Received: by 2002:a05:6402:5412:b0:42d:cf78:6479 with SMTP id ev18-20020a056402541200b0042dcf786479mr10985410edb.18.1653985455926; Tue, 31 May 2022 01:24:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653985455; cv=none; d=google.com; s=arc-20160816; b=B/7ZGarURY7hGV33Ts6IFLWKl8w3zWu8eEeEw9LU8ubT3odvJuXysDCuav025TGueA XG1DCpDKTWGlcMyFsIb47WiNHzLSSqVKivaFAWVH473LCReAAF/fopi41f+bGepzKetN pgmgF/O47MVXs6f9iTSBexXp8UYZ6rWyxgQsj8KN26JsZ94piS650Y7MRhU9ZpNp/RZy 9uwO65Fnmlfikz5eqjNPsaV1n+po+/hkGaAVMhDFiKWvTBiHA51DzlGZfPfB1TIx2Alc p2jkvvyxrrfi5TDqNLeQnAGdk3IPcF7l4CSQA5mBCQ1ViJChOSybeHQqRoQNHpoRbNNo zihw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :organization:in-reply-to:subject:cc:to:from:dkim-signature; bh=SVAjo5H9jAUdmpg9yGLM73ljEpXTI+wQ4k71uumOgYQ=; b=MZ+m0Zi444BuVOmTBO3isDCJbqD1esIuit4ObCRBcTcJcJ+n1pOcD4HzkO4cBsYgdq 5jQsJ4deHCPJ4jjrdnROKwVDFgQeZ2LryQaOn3ZRZuAHjJfQq7JwQRab2cso21S2amb6 WAqdi0lOeRYYm/0TEpbQ6fM8ypyPD27c9FW50VSSe8KSzZ2som2OBpgkV4ognFKEfwli 3ckXrWnPh30/qZiDAva+LXm+Yq+puY2sBJTAbvGnRNhs2LJ+TliGiSEBWrZfyG9NhT+d xgWgYSoho3Bh7Qp95EzLMxr9jMVm6Y7QvtSdvzRv9qp7dHvL3UWhgU6r52oZNT2eUvME xd0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=LXT3rX90; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h14-20020a056402280e00b0042dd723a671si4306384ede.272.2022.05.31.01.23.50; Tue, 31 May 2022 01:24:15 -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=@intel.com header.s=Intel header.b=LXT3rX90; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236375AbiE3NKo (ORCPT + 99 others); Mon, 30 May 2022 09:10:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236014AbiE3NKn (ORCPT ); Mon, 30 May 2022 09:10:43 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C2517092B for ; Mon, 30 May 2022 06:10:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653916240; x=1685452240; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=yR4CvAYEHnhJy9L0L3rshOUShjBlml110o6x0DwIo1A=; b=LXT3rX902qcHmZS8ShzsCqkwy/X062sfDvAymc0pO/U5FbLjkrLRSxnx g8OirrZFgLrMFqZrD1X13yAeqj9k7cy4abRWWUHJGafXLLrXnWBk4OqAc AKxyvcU7gmMxPWxCWmJR16/xEynb15OhRNDLct2HjpbC/5ccfxeVTYsC7 uTlKJUDzoB5sKUubOYgHOnWUZGlr+OCZTGWAHOVHLg92gBZdoFQpgFgl/ sv8I5qwu7GMwIlCxyNBge+JgfbacDqDaOpZ9vMYtxto2U51PcxDwvHmX6 kALBll5/2GAAoDUtcn+WqntzuOfoOA7CAJSqza8B8p22GL5Ho2oH5NHVL g==; X-IronPort-AV: E=McAfee;i="6400,9594,10362"; a="274998691" X-IronPort-AV: E=Sophos;i="5.91,263,1647327600"; d="scan'208";a="274998691" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 May 2022 06:10:16 -0700 X-IronPort-AV: E=Sophos;i="5.91,263,1647327600"; d="scan'208";a="605183061" Received: from jkuna-mobl.ger.corp.intel.com (HELO localhost) ([10.249.150.228]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 May 2022 06:10:10 -0700 From: Jani Nikula To: Arnd Bergmann Cc: Linus Torvalds , Arnd Bergmann , Sudip Mukherjee , Russell King , Viresh Kumar , Shiraz Hashim , Ville =?utf-8?B?U3lyasOkbMOk?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , dri-devel , Linux Kernel Mailing List , Linux ARM , SoC Team Subject: Re: mainline build failure due to f1e4c916f97f ("drm/edid: add EDID block count and size helpers") In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <87a6aztli2.fsf@intel.com> <877d63tleq.fsf@intel.com> Date: Mon, 30 May 2022 16:10:08 +0300 Message-ID: <87czfvrwsv.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 Mon, 30 May 2022, Arnd Bergmann wrote: > On Mon, May 30, 2022 at 11:33 AM Jani Nikula wrote: >> >> That is, for EDID. Makes you wonder about all the other packed structs >> with enum members across the kernel. > > It is not the 'enum' that is special here, it's the 'union' having > unpacked members, Obviously meant union not enum, that was just a -ENOCOFFEE on my part. > and the same thing happens when you have nested structs: both the inner > and the outer aggregate need to be packed, either with __packed at the > end, or on each individual member that is not fully aligned to > max(sizeof(member), 4)). > > I think in general, most __packed annotations we have in the kernel are > completely pointless because they do not change the structure layout on > any architecture but instead just make member access slower on Please explain. They are used quite a bit for parsing blob data, or serialization/deserialization, like in the EDID case at hand. Try removing __attribute__((packed)) from include/drm/drm_edid.h and see the sizeof(struct edid) on any architecture. BR, Jani. > architectures that lack unaligned load/store instructions. There have > definitely been other cases though where a __packed annotation is > not needed on any sane architecture but is needed for OABI ARM. > > Overall I'm not that worried because the only machines running OABI > kernels would be on really old hardware that runs a limited set of > driver code. > > A completely different matter are the extraneous __packed annotations > that lead to possible problems when accessed through a misaligned > pointer. We ignore -Waddress-of-packed-member and -Wcast-align > in the kernel, so these never get caught at build time, but we have > seen bugs from gcc making incorrect assumptions about alignment > even on architectures that have unaligned load/store instructions. > > Arnd -- Jani Nikula, Intel Open Source Graphics Center