From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51230) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXXGN-0000yW-5N for qemu-devel@nongnu.org; Thu, 13 Dec 2018 15:07:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXXGI-00024p-4E for qemu-devel@nongnu.org; Thu, 13 Dec 2018 15:07:15 -0500 References: <20181213120252.21697-1-peter.maydell@linaro.org> From: Thomas Huth Message-ID: <9683dc80-e258-149a-8a55-3d53cd248761@redhat.com> Date: Thu, 13 Dec 2018 21:06:58 +0100 MIME-Version: 1.0 In-Reply-To: <20181213120252.21697-1-peter.maydell@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2] hw/s390/ccw.c: Don't take address of packed members List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , qemu-devel@nongnu.org Cc: patches@linaro.org, qemu-s390x@nongnu.org, David Hildenbrand , Richard Henderson , Christian Borntraeger , Cornelia Huck , Farhan Ali On 2018-12-13 13:02, Peter Maydell wrote: > Taking the address of a field in a packed struct is a bad idea, because > it might not be actually aligned enough for that pointer type (and > thus cause a crash on dereference on some host architectures). Newer > versions of clang warn about this. > > Avoid the problem by using local copies of the PMCW and SCSW > struct fields in copy_schib_from_guest() and copy_schib_to_guest(). > > Signed-off-by: Peter Maydell > --- > v1->v2 changes: > * add comment about why we're using locals Thanks! Reviewed-by: Thomas Huth