qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Blue Swirl <blauwirbel@gmail.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Avi Kivity <avi@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Re: [PATCHv2] qemu: target library, use it in msix
Date: Tue, 29 Sep 2009 22:34:53 +0300	[thread overview]
Message-ID: <f43fc5580909291234k2878fb62x79dc1f06ba658b39@mail.gmail.com> (raw)
In-Reply-To: <20090929155756.GA13666@redhat.com>

On Tue, Sep 29, 2009 at 6:57 PM, Michael S. Tsirkin <mst@redhat.com> wrote:
> On Tue, Sep 29, 2009 at 06:15:21PM +0300, Blue Swirl wrote:
>> On Tue, Sep 29, 2009 at 5:50 PM, Michael S. Tsirkin <mst@redhat.com> wrote:
>> > On Sun, Sep 27, 2009 at 06:19:05PM +0300, Blue Swirl wrote:
>> >> On Sun, Sep 27, 2009 at 5:24 PM, Michael S. Tsirkin <mst@redhat.com> wrote:
>> >> > On Sun, Sep 27, 2009 at 04:21:29PM +0200, Michael S. Tsirkin wrote:
>> >> >> On Sun, Sep 27, 2009 at 04:14:49PM +0200, Avi Kivity wrote:
>> >> >> > On 09/27/2009 04:08 PM, Michael S. Tsirkin wrote:
>> >> >> >>
>> >> >> >>
>> >> >> >>>> In practice, the only user is now msix and it does not.  It has 0x1000
>> >> >> >>>> as a constant parameter.  For target_phys_addr_t users if we ever have
>> >> >> >>>> them, we'll just add target_phys_page_align. Generally it's unusual for
>> >> >> >>>> devices to care about size of target physical page.
>> >> >> >>>>
>> >> >> >>>>
>> >> >> >>> I'd fill better with uint64_t, at least that won't truncate.
>> >> >> >>>
>> >> >> >> Doesn't naming it target_page_align32 address this concern?
>> >> >> >>
>> >> >> >
>> >> >> > How can the caller (except in your special case) know if it has a
>> >> >> > quantity that will fit in 32 bits?
>> >> >>
>> >> >> It's actually not unusual for devices to limit addressing to 32 bit, whatever
>> >> >> the bus supports.
>> >> >
>> >> > I would say that devices normally have a specific addressing, and should
>> >> > not be using target specific types at all.  This alignment to target
>> >> > page size is actually an unusual thing.
>> >>
>> >> Actually, AFAICT MSI-X spec (6.8.2, from the MSI entry in Wikipedia)
>> >> only requires a QWORD alignment. There is some blurb about 4k
>> >> alignment, but I think it only describes how software should use the
>> >> structure.
>> >> If this is the case, we could drop the whole target page
>> >> stuff.
>> >
>> > The variable MSIX_PAGE_SIZE actually specifies the size of the space
>> > allocated for MSIX in the memory region.  Spec requires locating MSI-X
>> > tables in a 4K region separate from any other device register, so from
>> > that point of view we could just have had
>> > #define MSIX_PAGE_SIZE 0x1000
>>
>> Can you cite the spec, I only found the QWORD stuff.
>
> In spec revision 3.0, see this text:
>
>        6.8.2.  MSI-X Capability and Table Structures
>
>        ...
>
>        If a Base Address register that maps address space for the MSI-X Table or MSI-X PBA also
>        maps other usable address space that is not associated with MSI-X structures, locations (e.g.,
>        for CSRs) used in the other address space must not share any naturally aligned 4-KB address
>        range with one where either MSI-X structure resides. This allows system software where
>        applicable to use different processor attributes for MSI-X structures and the other address

I think these are instructions for writing system software, not
description on how MSI-X hardware needs the tables laid out. That
means, the tables should use page alignment (in order to support some
CPU attributes), but the hardware only cares that the data is QWORD
aligned.

  parent reply	other threads:[~2009-09-29 19:35 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-23 20:06 [Qemu-devel] [PATCHv2] qemu: target library, use it in msix Michael S. Tsirkin
2009-09-24 17:50 ` [Qemu-devel] " Blue Swirl
2009-09-24 19:11   ` Michael S. Tsirkin
2009-09-24 20:13     ` Blue Swirl
2009-09-29 16:11       ` [Qemu-devel] CODING_STYLE (was Re: [PATCHv2] qemu: target library, use it in msix) Michael S. Tsirkin
2009-09-29 18:15         ` [Qemu-devel] " Blue Swirl
2009-09-30 13:51           ` Michael S. Tsirkin
2009-09-30 16:50             ` malc
2009-09-30 17:00             ` Avi Kivity
2009-09-30 17:29               ` Michael S. Tsirkin
2009-09-30 17:29               ` Blue Swirl
2009-09-30 21:01                 ` Anthony Liguori
2009-10-01  6:17                   ` Michael S. Tsirkin
2009-10-01  8:43                     ` Kevin Wolf
2009-10-01  8:58                       ` Michael S. Tsirkin
2009-10-01  9:10                         ` Kevin Wolf
2009-10-01  9:17                           ` Michael S. Tsirkin
2009-10-01  6:31                 ` Avi Kivity
2009-10-01  6:47                   ` Michael S. Tsirkin
2009-10-01  7:08                     ` Paolo Bonzini
2009-09-30 17:00             ` [Qemu-devel] Re: CODING_STYLE Juan Quintela
2009-10-01  1:25               ` Edgar E. Iglesias
2009-10-01  6:41                 ` Michael S. Tsirkin
2009-10-01  9:01                   ` Gleb Natapov
2009-10-01  8:56                 ` Kevin Wolf
2009-10-01  9:02                   ` Michael S. Tsirkin
2009-10-01  9:46                     ` Gleb Natapov
2009-10-01 10:02                       ` Michael S. Tsirkin
2009-10-01  9:01                 ` Gleb Natapov
2009-09-30 17:02             ` Markus Armbruster
2009-10-01  6:37               ` Amit Shah
2009-09-30 17:31             ` [Qemu-devel] Re: CODING_STYLE (was Re: [PATCHv2] qemu: target library, use it in msix) Paolo Bonzini
2009-09-30 17:32               ` Michael S. Tsirkin
2009-09-30 17:48               ` Michael S. Tsirkin
2009-09-30 18:32                 ` Paolo Bonzini
2009-10-01  6:00                   ` Michael S. Tsirkin
2009-09-30 20:11                 ` [Qemu-devel] Re: CODING_STYLE Markus Armbruster
2009-09-30 21:00               ` [Qemu-devel] Re: CODING_STYLE (was Re: [PATCHv2] qemu: target library, use it in msix) Anthony Liguori
2009-09-30 23:01                 ` [Qemu-devel] Re: CODING_STYLE Markus Armbruster
2009-09-30 23:24                   ` Anthony Liguori
2009-09-30 16:06           ` [Qemu-devel] Re: CODING_STYLE (was Re: [PATCHv2] qemu: target library, use it in msix) Christoph Hellwig
2009-09-30 16:14             ` Michael S. Tsirkin
2009-09-30 21:04               ` Anthony Liguori
2009-09-27  8:20   ` [Qemu-devel] Re: [PATCHv2] qemu: target library, use it in msix Michael S. Tsirkin
2009-09-27 10:40     ` Avi Kivity
2009-09-27 11:45       ` Michael S. Tsirkin
2009-09-27 11:55         ` Avi Kivity
2009-09-27 12:00           ` Michael S. Tsirkin
2009-09-27 12:19             ` Avi Kivity
2009-09-27 14:08               ` Michael S. Tsirkin
2009-09-27 14:14                 ` Avi Kivity
2009-09-27 14:21                   ` Michael S. Tsirkin
2009-09-27 14:24                     ` Michael S. Tsirkin
2009-09-27 15:19                       ` Blue Swirl
2009-09-29 14:50                         ` Michael S. Tsirkin
2009-09-29 15:15                           ` Blue Swirl
2009-09-29 15:57                             ` Michael S. Tsirkin
2009-09-29 16:26                               ` Avi Kivity
2009-09-29 16:38                                 ` Michael S. Tsirkin
2009-09-29 19:34                               ` Blue Swirl [this message]
2009-09-29 21:09                                 ` Michael S. Tsirkin
2009-09-27 14:26                     ` Avi Kivity
2009-09-29  7:19                       ` Michael S. Tsirkin

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=f43fc5580909291234k2878fb62x79dc1f06ba658b39@mail.gmail.com \
    --to=blauwirbel@gmail.com \
    --cc=avi@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 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).