From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:44776) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RjsG7-0001WE-HD for qemu-devel@nongnu.org; Sun, 08 Jan 2012 07:54:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RjsG6-00020F-D8 for qemu-devel@nongnu.org; Sun, 08 Jan 2012 07:53:59 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39062) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RjsG6-000206-5K for qemu-devel@nongnu.org; Sun, 08 Jan 2012 07:53:58 -0500 Message-ID: <4F0991E1.6030005@redhat.com> Date: Sun, 08 Jan 2012 14:53:53 +0200 From: Avi Kivity MIME-Version: 1.0 References: <1325687322-6797-1-git-send-email-avi@redhat.com> <20120104144721.GA5961@redhat.com> <4F05BE55.8030209@weilnetz.de> <20120108091706.GA25444@redhat.com> <4F0969BB.7080208@redhat.com> <20120108101242.GA26189@redhat.com> <4F097465.8090103@redhat.com> <20120108124516.GC26189@redhat.com> In-Reply-To: <20120108124516.GC26189@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH master/stable-1.0] pci: fix corrupted pci conf index register by unaligned write List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Stefan Weil , qemu-devel@nongnu.org On 01/08/2012 02:45 PM, Michael S. Tsirkin wrote: > On Sun, Jan 08, 2012 at 12:48:05PM +0200, Avi Kivity wrote: > > On 01/08/2012 12:12 PM, Michael S. Tsirkin wrote: > > > > > > > > > > > And the check for unaligned writes is, well, unusual :-) > > > > > > > > What's unusual? > > > > > > > > > > > > > This seems to be how memory API behaves ... right, Avi? > > > > > Maybe this should be documented somewhere. > > > > > > > > Document what? > > > > > > That address passed to callbacks is in fact an offset > > > from start of the region. > > > > > > > It's documented already (and it's not new - since 8da3ff18097, Dec 2008). > > True, memory.h explicitly says: > @addr is relative to @mr > > But now that's mentioned, I have a question: > we could also specify min access size and disable > unaligned access in ops.valid structure. > That would trigger machine checks on access errors > instead of ignoring them as we do now. > Anyone knows offhand what does real hardware do? It depends on the actual hardware. qemu has some #ifdefs deep down that control this. Ultimately this should be local to the bus rather than global; for example a bus can intercept unaligned writes and invoke some bus specific behaviour even though the cpu allows those accesses. -- error compiling committee.c: too many arguments to function