From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55010) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YWXU2-0002ah-6Q for qemu-devel@nongnu.org; Fri, 13 Mar 2015 17:51:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YWXU1-0008AC-5R for qemu-devel@nongnu.org; Fri, 13 Mar 2015 17:51:06 -0400 From: John Snow Date: Fri, 13 Mar 2015 17:50:52 -0400 Message-Id: <1426283454-15590-1-git-send-email-jsnow@redhat.com> Subject: [Qemu-devel] [PATCH v2 0/2] AHCI: avoid mapping stale guest memory List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: kwolf@redhat.com, pbonzini@redhat.com, John Snow , qemu-devel@nongnu.org, stefanha@redhat.com Currently, the AHCI device tries to re-map guest memory every time the low or high address registers are written to, whether or not the AHCI device is currently active. If the other register has stale information in it, this may lead to runtime failures. Reconfigure the AHCI device to ignore writes to these registers while the device is active, and otherwise postpone the dma memory map until the device becomes active. If the mappings should for whatever reason fail, do not activate the bits that tell the user the device has been started successfully. v2: - ahci_map_[clb|fis]_address now returns true on success - PORT_CMD_LIST_ON and PORT_CMD_FIS_ON only turn on if the map succeeds - Fix compiler warning due to changing context. John Snow (2): AHCI: Do not (re)map FB/CLB buffers while not running AHCI: Protect cmd register hw/ide/ahci.c | 76 +++++++++++++++++++++++++++++++++++++++++++++-------------- hw/ide/ahci.h | 2 ++ 2 files changed, 60 insertions(+), 18 deletions(-) -- 1.9.3