All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Rahul Singh <Rahul.Singh@arm.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
	Bertrand Marquis <Bertrand.Marquis@arm.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [PATCH] xen/vpci: msix: move x86 specific code to x86 file
Date: Thu, 16 Dec 2021 12:01:53 +0100	[thread overview]
Message-ID: <YbscoZG/NRP6lMof@Air-de-Roger> (raw)
In-Reply-To: <621259B5-E5EB-4ED9-A836-B6E17C0D6E36@arm.com>

On Thu, Dec 16, 2021 at 10:18:32AM +0000, Rahul Singh wrote:
> Hi Roger,
> 
> Thanks for reviewing the code.
> 
> > On 14 Dec 2021, at 12:37 pm, Roger Pau Monné <roger.pau@citrix.com> wrote:
> > 
> > On Tue, Dec 14, 2021 at 10:45:17AM +0000, Rahul Singh wrote:
> >> +              unsigned long *data)
> >> {
> >> -    const struct domain *d = v->domain;
> >> -    struct vpci_msix *msix = msix_find(d, addr);
> >>     const struct vpci_msix_entry *entry;
> >>     unsigned int offset;
> >> 
> >>     *data = ~0ul;
> >> 
> >>     if ( !msix )
> >> -        return X86EMUL_RETRY;
> >> +        return VPCI_EMUL_RETRY;
> >> 
> >>     if ( !access_allowed(msix->pdev, addr, len) )
> >> -        return X86EMUL_OKAY;
> >> +        return VPCI_EMUL_OKAY;
> >> 
> >>     if ( VMSIX_ADDR_IN_RANGE(addr, msix->pdev->vpci, VPCI_MSIX_PBA) )
> >>     {
> >> @@ -210,11 +194,11 @@ static int msix_read(struct vcpu *v, unsigned long addr, unsigned int len,
> >>         switch ( len )
> >>         {
> >>         case 4:
> >> -            *data = readl(addr);
> >> +            *data = vpci_arch_readl(addr);
> > 
> > Why do you need a vpci wrapper around the read/write handlers? AFAICT
> > arm64 also has {read,write}{l,q}. And you likely want to protect the
> > 64bit read with CONFIG_64BIT if this code is to be made available to
> > arm32.
> 
> I need the wrapper because {read,write}{l,q} function argument is different for ARM and x86.
> ARM {read,wrie}(l,q}  function argument is pointer to the address whereas X86  {read,wrie}(l,q} 
> function argument is address itself.

Oh, that's a shame. I don't think there's a need to tag those helpers
with the vpci_ prefix though. Could we maybe introduce
bus_{read,write}{b,w,l,q} helpers that take the same parameters on all
arches?

It would be even better to fix the current ones so they take the same
parameters on x86 and Arm, but that would mean changing all the call
places in one of the arches.

Thanks, Roger.


  reply	other threads:[~2021-12-16 11:02 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-14 10:45 [PATCH] xen/arm: vpci: Remove PCI I/O ranges property value Rahul Singh
2021-12-14 10:45 ` [PATCH] xen/vpci: msix: move x86 specific code to x86 file Rahul Singh
2021-12-14 12:37   ` Roger Pau Monné
2021-12-16 10:18     ` Rahul Singh
2021-12-16 11:01       ` Roger Pau Monné [this message]
2021-12-16 13:37         ` Jan Beulich
2021-12-17 14:32           ` Julien Grall
2021-12-17 14:58             ` Rahul Singh
2021-12-21  7:41             ` Jan Beulich
2021-12-21  9:35               ` Rahul Singh
2021-12-14 14:15   ` Jan Beulich
2021-12-16 10:28     ` Rahul Singh
2021-12-16  2:33 ` [PATCH] xen/arm: vpci: Remove PCI I/O ranges property value Stefano Stabellini
2021-12-16  9:57   ` Rahul Singh
2021-12-16 21:48     ` Stefano Stabellini
2021-12-17  9:19       ` Rahul Singh
2021-12-17 11:28 ` Julien Grall

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=YbscoZG/NRP6lMof@Air-de-Roger \
    --to=roger.pau@citrix.com \
    --cc=Bertrand.Marquis@arm.com \
    --cc=Rahul.Singh@arm.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --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 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.