From: Cao jin <caoj.fnst@cn.fujitsu.com>
To: qemu-devel@nongnu.org
Cc: marcel@redhat.com, alex.williamson@redhat.com, mst@redhat.com
Subject: Re: [Qemu-devel] [PATCH RFC] msix_init: input params *_offset isn't the real one
Date: Mon, 15 Aug 2016 12:14:25 +0800 [thread overview]
Message-ID: <57B141A1.2040706@cn.fujitsu.com> (raw)
In-Reply-To: <1470799131-26024-1-git-send-email-caoj.fnst@cn.fujitsu.com>
Sorry for the noise.
On 08/10/2016 11:18 AM, Cao jin wrote:
> The parameter table_offset & pba_offset is kind of confusing, they shouldn't
> include bir field.
>
> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
> ---
>
> According to the passed arguments, I guess all the callers of msix_init()
> has the same feeling with me, but I am not quite sure about this, so, RFC.
>
> hw/pci/msix.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/hw/pci/msix.c b/hw/pci/msix.c
> index 0ec1cb1..3a16d83 100644
> --- a/hw/pci/msix.c
> +++ b/hw/pci/msix.c
> @@ -264,8 +264,7 @@ int msix_init(struct PCIDevice *dev, unsigned short nentries,
> if ((table_bar_nr == pba_bar_nr &&
> ranges_overlap(table_offset, table_size, pba_offset, pba_size)) ||
> table_offset + table_size > memory_region_size(table_bar) ||
> - pba_offset + pba_size > memory_region_size(pba_bar) ||
> - (table_offset | pba_offset) & PCI_MSIX_FLAGS_BIRMASK) {
> + pba_offset + pba_size > memory_region_size(pba_bar)) {
> return -EINVAL;
> }
>
> @@ -282,8 +281,8 @@ int msix_init(struct PCIDevice *dev, unsigned short nentries,
> dev->msix_entries_nr = nentries;
> dev->msix_function_masked = true;
>
> - pci_set_long(config + PCI_MSIX_TABLE, table_offset | table_bar_nr);
> - pci_set_long(config + PCI_MSIX_PBA, pba_offset | pba_bar_nr);
> + pci_set_long(config + PCI_MSIX_TABLE, (table_offset << 3) | table_bar_nr);
> + pci_set_long(config + PCI_MSIX_PBA, (pba_offset << 3) | pba_bar_nr);
>
> /* Make flags bit writable. */
> dev->wmask[cap + MSIX_CONTROL_OFFSET] |= MSIX_ENABLE_MASK |
>
--
Yours Sincerely,
Cao jin
next prev parent reply other threads:[~2016-08-15 4:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-10 3:18 [Qemu-devel] [PATCH RFC] msix_init: input params *_offset isn't the real one Cao jin
2016-08-15 4:14 ` Cao jin [this message]
2016-08-18 10:54 ` Marcel Apfelbaum
2016-08-19 2:35 ` Cao jin
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=57B141A1.2040706@cn.fujitsu.com \
--to=caoj.fnst@cn.fujitsu.com \
--cc=alex.williamson@redhat.com \
--cc=marcel@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.