From patchwork Sun Oct 9 17:56:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thorsten Kohfeldt X-Patchwork-Id: 9368637 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6D91E607D2 for ; Sun, 9 Oct 2016 17:56:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 58FD328B43 for ; Sun, 9 Oct 2016 17:56:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4C27928B65; Sun, 9 Oct 2016 17:56:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9DFC328B43 for ; Sun, 9 Oct 2016 17:56:42 +0000 (UTC) Received: from localhost ([::1]:45113 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btIL2-0004z8-4e for patchwork-qemu-devel@patchwork.kernel.org; Sun, 09 Oct 2016 13:56:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50578) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btIKn-0004y2-1X for qemu-devel@nongnu.org; Sun, 09 Oct 2016 13:56:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1btIKi-0000xZ-R6 for qemu-devel@nongnu.org; Sun, 09 Oct 2016 13:56:23 -0400 Received: from mout.gmx.net ([212.227.15.19]:65074) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btIKi-0000wu-H2 for qemu-devel@nongnu.org; Sun, 09 Oct 2016 13:56:20 -0400 Received: from [192.168.27.241] ([84.118.216.34]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0MS5QA-1bQGDG1tIw-00TAxY; Sun, 09 Oct 2016 19:56:12 +0200 To: Alex Williamson From: Thorsten Kohfeldt Message-ID: <4cad93cd-9762-896f-c858-b9480340524e@gmx.de> Date: Sun, 9 Oct 2016 19:56:03 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 X-Provags-ID: V03:K0:tFziQEn02I3ZnD4WLznvRXR9ji6LofHZ4xkwfa6QrWVzJCkJJLR tS84lK4MU2SilNe+dSBHSdjT0V5QrTgtI8D0/66qGnVAqxrJJCdG7ILLy4fuseiV/yANKbW dXPN4JqBNGHdzCWF4YsomlzZfljJ31mXIWtaKYNtkPI1uwvOo7aL+jKdyDxMpvd1d84Z5Wz 3i1AlSM8ukH+a63g8l8EQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:6CxzKrYvf7E=:D8HE1FByhaMdY8fSrllgpZ /D73yfoO1pD//Mp/86RqCTJFwQAXcat1Ls3DUmtQxeD1oIQvCpnzyYUTWJjZ/s49RGWH+B6Ll 9bYJbHwIRHBr57t/1l2wpHBzIZuMF53VliJnpb+WmAYXMOVnehF51O45aT72hPMwSSdhf33D9 5G/UHjPPi1cYL/m863XSzDKAjl38SAFVZpsIP/lhmpWIMA3G9bxAQEXRtx3Vgm+Vkz7Jp8q/K bOhodSb2pr2Kcr+dhZW6g7dL+7NSZg28tTLcveeap8zM5eCkzLIeoUoMPxjubVF2wMQmUc8eV 4eJP9b72xdrfYhC1rUlQz36YViCOwWCTs821snXfck4kU3IF2HM1O+xh+Mrnly+Cx9FE+ZrIj j526frEqnLoib4EBDnAUffpfnLqvq4/3kJPT62JjKiG+iBRaSY8I9z7vg1tkyAOmi4tbEqxVB KcEMlGljAN6ddgQf61bIuHBjPGlvn8cMnGA+XYl69Nv1Gb7vK9M+qO5d4yGUkZET6lLf0AZcS jwTYjQxc/FJ0CA8P6hagCkEHBSzlSg5DiVbwh5USLY/SJqRluk1bdY3h3rhEiOH65ZhLnxVTj 8hG6d7YTpbzat/1nsJq77zSqhBGTFpQRKTWy7qSnvqdY2yuwv0icUoBdh162YmuUCb+el/vb4 CK5JgIsBKqc+h3x34jzGg+1/w/y4ZYsCd6QAVTacRwjJpEfrkmYsphieQNSWTaSss7GUiBNKf qIPyv95JY+7hZkuXSq4bUhOeR0vX+vF/aJnbEpuLr/1GeWddvDKmmgPPHWOG5JK7rKolsGW0W psEsT+I X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.15.19 Subject: [Qemu-devel] [PATCH] vfio: Fix vfio_rtl8168_quirk_data_read address offset X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Thorsten Kohfeldt Date: Sat, 24 Sep 2016 20:43:20 +0200 Subject: [PATCH] vfio: Fix vfio_rtl8168_quirk_data_read address offset Introductory comment for rtl8168 VFIO MSI-X quirk states: At BAR2 offset 0x70 there is a dword data register, offset 0x74 is a dword address register. vfio: vfio_bar_read(0000:05:00.0:BAR2+0x70, 4) = 0xfee00398 // read data Thus, correct offset for data read is 0x70, but function vfio_rtl8168_quirk_data_read() wrongfully uses offset 0x74. Signed-off-by: Thorsten Kohfeldt --- hw/vfio/pci-quirks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c index bec694c..1e97bc4 100644 --- a/hw/vfio/pci-quirks.c +++ b/hw/vfio/pci-quirks.c @@ -898,7 +898,7 @@ static uint64_t vfio_rtl8168_quirk_data_read(void *opaque, { VFIOrtl8168Quirk *rtl = opaque; VFIOPCIDevice *vdev = rtl->vdev; - uint64_t data = vfio_region_read(&vdev->bars[2].region, addr + 0x74, size); + uint64_t data = vfio_region_read(&vdev->bars[2].region, addr + 0x70, size); if (rtl->enabled && (vdev->pdev.cap_present & QEMU_PCI_CAP_MSIX)) { hwaddr offset = rtl->addr & 0xfff;