Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp326760pxf; Wed, 17 Mar 2021 06:22:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLfkLHS5O6sHm63QJjdbD5Cf+41UDarpRg4HxI1Q0SbB68kxd9/HIbElMZYD99NYMBwKsH X-Received: by 2002:a17:906:2e45:: with SMTP id r5mr34260656eji.380.1615987347698; Wed, 17 Mar 2021 06:22:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615987347; cv=none; d=google.com; s=arc-20160816; b=LodTrN6eIvESMcprkDThIKDgbmbhS6bU7BidkyD0L8aoetuSVLyMzNLDJ+uu7WGLoS OrhsytjGmnn1rFWHxLXwu6l+fCIZ28yeEXFLFN4G0kiz2nEUUOrqJ69gM8DQlzb7qHy2 NjPKTjePYuo0fA9AYyvERirZTobwLbfgVUJQwx5rWFXW957GF0ogiDi1qV1YqxE1SwPT YYpCGay1U1CiBQqRgStZLtgMcOMnUiYs13EiGY1yjePVUgD7ojE+K3126ZKKMtfRe0At 0VcATtZmq1FXKYXgqQpO6muM51Wf7lXebLhrRGcseuGPJCX8lDIwdQxmSn+vabjthm2A Qn8w== 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=kWO2i8S4beXP4ZfLl6bHIL+2hOaiGIbcE7NZGqkqW1Q=; b=FR4Ftpkr4A035TwTE3aQIZa5hjEViayI1kwkdfmQ6Kh5wEDzlVhTlxT8xr9IGIuL+W W9WUlEaW89IOCZfSgMZ+VhJCb4oENn4O3p4QXkB7r+4+ccG/ShzFDxEXUFsdmr/PyRHs 5y18TbSOgETmqSpgLvKKd9nDQ1ss29HXV6GFHp3oY/WPppft+TVyjKa7gLLFbGwgMaRi 0uxGD124eixiFyA/xGX39GS/oMSrwqXZLNPG4puZz0tqi/9ELVRKvA6Gva3iUC2QSI8A XVB3XV7hWLRid4EJXDPTQ2C5adrXyKqZI45a6vSyVPfMfp9hfaRkCeK0un/t675Km3ht SoLg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n19si10011317edd.382.2021.03.17.06.22.01; Wed, 17 Mar 2021 06:22:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S230511AbhCQNUC convert rfc822-to-8bit (ORCPT + 99 others); Wed, 17 Mar 2021 09:20:02 -0400 Received: from eu-smtp-delivery-151.mimecast.com ([185.58.86.151]:39784 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230505AbhCQNTb (ORCPT ); Wed, 17 Mar 2021 09:19:31 -0400 Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-55-3sGq2adXMGirCyN93jbuVw-1; Wed, 17 Mar 2021 13:19:24 +0000 X-MC-Unique: 3sGq2adXMGirCyN93jbuVw-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.2; Wed, 17 Mar 2021 13:19:23 +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.012; Wed, 17 Mar 2021 13:19:23 +0000 From: David Laight To: "'Martin K. Petersen'" , Arnd Bergmann CC: "Don.Brace@microchip.com" , Sergei Trofimovich , "linux-kernel@vger.kernel.org" , "linux-ia64@vger.kernel.org" , "storagedev@microchip.com" , linux-scsi , "jszczype@redhat.com" , "Scott.Benesh@microchip.com" , "Scott.Teel@microchip.com" , "thenzl@redhat.com" , "John Paul Adrian Glaubitz" Subject: RE: [PATCH] hpsa: fix boot on ia64 (atomic_t alignment) Thread-Topic: [PATCH] hpsa: fix boot on ia64 (atomic_t alignment) Thread-Index: AQHXGtT0rSNa450uZ0SMu8nCYRzH7aqIKWKQ Date: Wed, 17 Mar 2021 13:19:23 +0000 Message-ID: <4b2a64d91c4c478f881d9713cac5001b@AcuMS.aculab.com> References: <5532f9ab-7555-d51b-f4d5-f9b72a61f248@redhat.com> <20210312222718.4117508-1-slyfox@gentoo.org> In-Reply-To: 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Martin K. Petersen > Sent: 17 March 2021 02:26 > > Arnd, > > > Actually that still feels wrong: the annotation of the struct is to > > pack every member, which causes the access to be done in byte units on > > architectures that do not have hardware unaligned load/store > > instructions, at least for things like atomic_read() that does not go > > through a cmpxchg() or ll/sc cycle. > > > This change may fix itanium, but it's still not correct. Other > > architectures would have already been broken before the recent change, > > but that's not a reason against fixing them now. > > I agree. I understand why there are restrictions on fields consumed by > the hardware. But for fields internal to the driver the packing doesn't > make sense to me. Jeepers -- that global #pragma pack(1) is bollocks. I think there are a couple of __u64 that are 32bit aligned. Just marking those field __packed __aligned(4) should have the desired effect. Or use a typedef for '__u64 with 32bit alignment'. (There probably ought to be one in types.h) Then add compile-time asserts that any non-trivial structures the hardware accesses are the right size. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)