From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:48412) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gxa0d-00045Y-BL for qemu-devel@nongnu.org; Sat, 23 Feb 2019 11:18:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gxa0c-0004Dc-8O for qemu-devel@nongnu.org; Sat, 23 Feb 2019 11:18:38 -0500 Received: from mail-ot1-x32c.google.com ([2607:f8b0:4864:20::32c]:44998) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gxa0b-00046n-Jb for qemu-devel@nongnu.org; Sat, 23 Feb 2019 11:18:38 -0500 Received: by mail-ot1-x32c.google.com with SMTP id g1so4442341otj.11 for ; Sat, 23 Feb 2019 08:18:29 -0800 (PST) MIME-Version: 1.0 References: <28e6b4ed-9afd-3a79-6267-86c7385c23ce@redhat.com> <20190223165523.1d674224@ncopa-desktop.copa.dup.pw> In-Reply-To: <20190223165523.1d674224@ncopa-desktop.copa.dup.pw> From: Peter Maydell Date: Sat, 23 Feb 2019 16:18:15 +0000 Message-ID: Content-Type: text/plain; charset="UTF-8" Subject: Re: [Qemu-devel] [Qemu-block] Guest unresponsive after Virtqueue size exceeded error List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Natanael Copa Cc: Stefan Hajnoczi , Paolo Bonzini , =?UTF-8?Q?Fernando_Casas_Sch=C3=B6ssow?= , qemu-devel , Richard Henderson On Sat, 23 Feb 2019 at 16:05, Natanael Copa wrote: > I was thinking of something in the lines of: > > typedef volatile uint16_t __attribute__((__may_alias__)) volatile_uint16_t; > static inline int lduw_he_p(const void *ptr) > { > volatile_uint16_t r = *(volatile_uint16_t*)ptr; > return r; > } This won't correctly handle accesses with unaligned pointers, I'm afraid. We rely on these functions correctly working with pointers that are potentially unaligned. thanks -- PMM