qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefano Stabellini <sstabellini@kernel.org>
To: peter.maydell@linaro.org, stefanha@gmail.com
Cc: sstabellini@kernel.org, stefanha@redhat.com,
	anthony.perard@citrix.com, xen-devel@lists.xenproject.org,
	qemu-devel@nongnu.org, Ross Lagerwall <ross.lagerwall@citrix.com>
Subject: [Qemu-devel] [PULL v2 04/15] xen_pt: Present the size of 64 bit BARs correctly
Date: Tue, 22 May 2018 11:46:31 -0700	[thread overview]
Message-ID: <1527014802-11289-4-git-send-email-sstabellini@kernel.org> (raw)
In-Reply-To: <alpine.DEB.2.10.1805221136110.24793@sstabellini-ThinkPad-X260>

From: Ross Lagerwall <ross.lagerwall@citrix.com>

The full size of the BAR is stored in the lower PCIIORegion.size. The
upper PCIIORegion.size is 0.  Calculate the size of the upper half
correctly from the lower half otherwise the size read by the guest will
be incorrect.

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
---
 hw/xen/xen_pt_config_init.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hw/xen/xen_pt_config_init.c b/hw/xen/xen_pt_config_init.c
index a3ce33e..aee31c6 100644
--- a/hw/xen/xen_pt_config_init.c
+++ b/hw/xen/xen_pt_config_init.c
@@ -504,6 +504,8 @@ static int xen_pt_bar_reg_write(XenPCIPassthroughState *s, XenPTReg *cfg_entry,
         bar_ro_mask = XEN_PT_BAR_IO_RO_MASK | (r_size - 1);
         break;
     case XEN_PT_BAR_FLAG_UPPER:
+        assert(index > 0);
+        r_size = d->io_regions[index - 1].size >> 32;
         bar_emu_mask = XEN_PT_BAR_ALLF;
         bar_ro_mask = r_size ? r_size - 1 : 0;
         break;
-- 
1.9.1

  parent reply	other threads:[~2018-05-22 18:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-22 18:46 [Qemu-devel] [PULL v2 00/15] xen-20180522-tag Stefano Stabellini
2018-05-22 18:46 ` [Qemu-devel] [PULL v2 01/15] xen-pvdevice: Introduce a simplistic xen-pvdevice save state Stefano Stabellini
2018-05-22 18:46 ` [Qemu-devel] [PULL v2 02/15] xen/pt: use address_space_memory object for memory region hooks Stefano Stabellini
2018-05-22 18:46 ` [Qemu-devel] [PULL v2 03/15] configure: Add explanation for --enable-xen-pci-passthrough Stefano Stabellini
2018-05-22 18:46 ` Stefano Stabellini [this message]
2018-05-22 18:46 ` [Qemu-devel] [PULL v2 05/15] xen-hvm: create separate function for ioreq server initialization Stefano Stabellini
2018-05-22 18:46 ` [Qemu-devel] [PULL v2 06/15] checkpatch: generalize xen handle matching in the list of types Stefano Stabellini
2018-05-22 18:46 ` [Qemu-devel] [PULL v2 07/15] xen: add a meaningful declaration of grant_copy_segment into xen_common.h Stefano Stabellini
2018-05-22 18:46 ` [Qemu-devel] [PULL v2 08/15] xen_backend: add grant table helpers Stefano Stabellini
2018-05-22 18:46 ` [Qemu-devel] [PULL v2 09/15] xen_disk: remove open-coded use of libxengnttab Stefano Stabellini
2018-05-22 18:46 ` [Qemu-devel] [PULL v2 10/15] xen: remove other " Stefano Stabellini
2018-05-22 18:46 ` [Qemu-devel] [PULL v2 11/15] xen_backend: add an emulation of grant copy Stefano Stabellini
2018-05-22 18:46 ` [Qemu-devel] [PULL v2 12/15] xen_disk: remove use of grant map/unmap Stefano Stabellini
2018-05-22 18:46 ` [Qemu-devel] [PULL v2 13/15] xen_backend: make the xen_feature_grant_copy flag private Stefano Stabellini
2018-05-22 18:46 ` [Qemu-devel] [PULL v2 14/15] xen_disk: use a single entry iovec Stefano Stabellini
2018-05-22 18:46 ` [Qemu-devel] [PULL v2 15/15] xen_disk: be consistent with use of xendev and blkdev->xendev Stefano Stabellini
2018-05-24 12:23 ` [Qemu-devel] [PULL v2 00/15] xen-20180522-tag Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1527014802-11289-4-git-send-email-sstabellini@kernel.org \
    --to=sstabellini@kernel.org \
    --cc=anthony.perard@citrix.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=ross.lagerwall@citrix.com \
    --cc=stefanha@gmail.com \
    --cc=stefanha@redhat.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).