Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp3596852pxb; Mon, 21 Feb 2022 01:22:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJzFSrEepcVUeEC/cnE8vem8DnvWcmuI5dOA8DDR+Qg4kJP9gF5D8zo3qkpx3Cwlz/3DlyVp X-Received: by 2002:a17:902:ce0a:b0:14f:bdcd:a56 with SMTP id k10-20020a170902ce0a00b0014fbdcd0a56mr3587367plg.97.1645435352557; Mon, 21 Feb 2022 01:22:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645435352; cv=none; d=google.com; s=arc-20160816; b=FD3GnsGwXAgv2vZy1mN0QGTXLP03oRtrT4W3yQdA+ZphKwuRhbUrjjbU95KcWzchzW L2kUTy2zzMfkc0AHeN+jszPxBrTioyfTDn02GWaWvjZ9Dn/c96Z+pgE0GCRxP5mTCZ5U Q7XCFYN/ZITC0rI1zrRVM+483gNnWwOnQtxogvi/MkOmyDgO1uKaXbCsUswyMp6uDVr1 R0FwTzgZEv8vAmqClYQySf5587cvRaCezdkIM7EOqgIT7/rHSSxVzjej3rBDrbMi+DOa aqaYDAAL//fq2sjltt24KwnG6e3TJXDwxse+WkyyLGa/TgEM1fbCOcGdrYLRfGqcI4w/ Xm3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=1BfD9zJb8tX2Tw1DSVz6MePnmJ1xw0Ad6QTvQ3pgAyg=; b=x3YEOthfOp8LeFq3UERHJ+mn0OwRSeKvdQMzxGkGmPe02JjinivUVe/wxUHXKYJcLd bU69ZfRQE6+pjL3LqTYRBo62Ix4k9sipW/bUc7cHCBt1WvPESi0bAbLN1waqslf7USEC mS/YEfyCT18kto6LFpi8NhtqShe9W0pqTtu3RST+jc1qVDZd2dhplgGkZxi+ZvtNz0Wt sXNeu1hBdmm/0j6kM96yi9o8yfVp/8ge9XbC2gptxac7xBPPrHLCijFD5jSK9GP9zXId T2qDvZ7YSxSOTd723OI39M6BpNFbigojPG0RB//FCIUy+aKa7jJolHiwAxVU19gB6+nZ c1nQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a28si8245229pfx.71.2022.02.21.01.22.18; Mon, 21 Feb 2022 01:22:32 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244555AbiBTStZ convert rfc822-to-8bit (ORCPT + 99 others); Sun, 20 Feb 2022 13:49:25 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:33384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244554AbiBTStZ (ORCPT ); Sun, 20 Feb 2022 13:49:25 -0500 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.86.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 43F244A3FF for ; Sun, 20 Feb 2022 10:49:03 -0800 (PST) Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-231-Q5RDfTEoPQK_wlmSaWaQ6g-1; Sun, 20 Feb 2022 18:49:00 +0000 X-MC-Unique: Q5RDfTEoPQK_wlmSaWaQ6g-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) by AcuMS.aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) with Microsoft SMTP Server (TLS) id 15.0.1497.28; Sun, 20 Feb 2022 18:48:58 +0000 Received: from AcuMS.Aculab.com ([fe80::994c:f5c2:35d6:9b65]) by AcuMS.aculab.com ([fe80::994c:f5c2:35d6:9b65%12]) with mapi id 15.00.1497.028; Sun, 20 Feb 2022 18:48:58 +0000 From: David Laight To: 'Armin Wolf' , "pali@kernel.org" CC: "jdelvare@suse.com" , "linux@roeck-us.net" , "linux-hwmon@vger.kernel.org" , "linux-assembly@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH v2] hwmon: (dell-smm) Improve assembly code Thread-Topic: [PATCH v2] hwmon: (dell-smm) Improve assembly code Thread-Index: AQHYJdVCkKl8QQjZ0kWJRwIdNPLg26ycx2mg Date: Sun, 20 Feb 2022 18:48:58 +0000 Message-ID: <6f4c21b5e1cb4fa38a5e0c1716658329@AcuMS.aculab.com> References: <20220219211011.16600-1-W_Armin@gmx.de> In-Reply-To: <20220219211011.16600-1-W_Armin@gmx.de> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, 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 From: Armin Wolf > Sent: 19 February 2022 21:10 > > The new assembly code works on both 32 bit and 64 bit > cpus and allows for more compiler optimisations by not > requiring smm_regs to be packed I'm intrigued about the __packed.. Prior to 5.17-rc1 __packed was only applied to the fields after 'eax'. This actually has no effect (on any architecture) because there is no padding to remove - so all the later fields are still assumed to be 32bit aligned. 5.17-rc1 (565210c781201) moved the __packed to the end of the structure. AFAICT this structure is only ever used in one file and for on-stack items. It will always actually be aligned and is only read by the code in the file - so why was it ever marked __packed at all! On x86 it would make no difference anyway. I can only guess it was to ensure that the asm code didn't go 'wrong' because of the compiler adding 'random' padding. That isn't what __packed is for at all. The linux kernel requires that the compiler doesn't add 'random' padding - even if the C standard might allow it. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)