All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
	Kevin Tian <kevin.tian@intel.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v2 8/9] xue: mark DMA buffers as reserved for the device
Date: Wed, 20 Jul 2022 22:17:56 +0200	[thread overview]
Message-ID: <Ythi9BXeKwcdmiOO@mail-itl> (raw)
In-Reply-To: <a259bc09-710c-0c19-60c8-f7fa310357bc@suse.com>

[-- Attachment #1: Type: text/plain, Size: 1941 bytes --]

On Thu, Jul 14, 2022 at 01:51:06PM +0200, Jan Beulich wrote:
> On 06.07.2022 17:32, Marek Marczykowski-Górecki wrote:
> > +    /*
> > +     * Don't place anything else on this page - it will be
> > +     * DMA-reachable by the USB controller.
> > +     */
> > +    char _pad[0] __aligned(XUE_PAGE_SIZE);
> 
> I don't think this is needed, due to sizeof() being required to be
> a multiple of alignof().

I'd prefer to be explicit about this, because if some future change
breaks this property (makes alignment smaller than a page size), the
result will be pretty bad.

> > +};
> > +static struct xue_dma_bufs xue_dma_bufs __aligned(XUE_PAGE_SIZE);
> 
> I don't think the alignment here is needed, as the struct will
> already have suitable alignment (derived from the biggest field
> alignment value). Instead please consider putting this in
> .bss.page_aligned.

Ok.

> > @@ -990,16 +999,22 @@ void __init xue_uart_init(void)
> >          xue->sbdf = PCI_SBDF(0, bus, slot, func);
> >      }
> >  
> > -    xue->dbc_ctx = &ctx;
> > -    xue->dbc_erst = &erst;
> > -    xue->dbc_ering.trb = evt_trb;
> > -    xue->dbc_oring.trb = out_trb;
> > -    xue->dbc_iring.trb = in_trb;
> > -    xue->dbc_owork.buf = wrk_buf;
> > -    xue->dbc_str = str_buf;
> > +    xue->dbc_ctx = &xue_dma_bufs.ctx;
> > +    xue->dbc_erst = &xue_dma_bufs.erst;
> > +    xue->dbc_ering.trb = xue_dma_bufs.evt_trb;
> > +    xue->dbc_oring.trb = xue_dma_bufs.out_trb;
> > +    xue->dbc_iring.trb = xue_dma_bufs.in_trb;
> > +    xue->dbc_owork.buf = xue_dma_bufs.wrk_buf;
> > +    xue->dbc_str = xue_dma_bufs.str_buf;
> >  
> >      if ( xue_open(xue) )
> > +    {
> > +        iommu_add_extra_reserved_device_memory(
> > +                PFN_DOWN(virt_to_maddr(&xue_dma_bufs)),
> 
> virt_to_pfn()?

Doesn't exist. Did you mean virt_to_mfn()?

-- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  parent reply	other threads:[~2022-07-20 20:18 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-06 15:32 [PATCH v2 0/9] Add Xue - console over USB 3 Debug Capability Marek Marczykowski-Górecki
2022-07-06 15:32 ` [PATCH v2 1/9] drivers/char: Add support for Xue USB3 debugger Marek Marczykowski-Górecki
2022-07-08  2:11   ` Marek Marczykowski-Górecki
2022-07-12 15:59   ` Jan Beulich
2022-07-18 10:45     ` Marek Marczykowski-Górecki
2022-07-18 10:55       ` Jan Beulich
2022-07-12 16:06   ` Jan Beulich
2022-07-14  6:05   ` Jan Beulich
2022-07-16 22:40     ` Marek Marczykowski-Górecki
2022-07-14 11:58   ` Jan Beulich
2022-07-16 23:32     ` Marek Marczykowski-Górecki
2022-07-20 20:12     ` Marek Marczykowski-Górecki
2022-07-21 10:25       ` Jan Beulich
2022-07-06 15:32 ` [PATCH v2 2/9] xue: reset XHCI ports when initializing dbc Marek Marczykowski-Górecki
2022-07-13  7:19   ` Jan Beulich
2022-07-06 15:32 ` [PATCH v2 3/9] xue: add support for selecting specific xhci Marek Marczykowski-Górecki
2022-07-13  7:24   ` Jan Beulich
2022-07-06 15:32 ` [PATCH v2 4/9] console: support multiple serial console simultaneously Marek Marczykowski-Górecki
2022-07-13  9:39   ` Jan Beulich
2022-07-18 12:48     ` Marek Marczykowski-Górecki
2022-07-18 14:37       ` Jan Beulich
2022-07-06 15:32 ` [PATCH v2 5/9] IOMMU: add common API for device reserved memory Marek Marczykowski-Górecki
2022-07-14 10:17   ` Jan Beulich
2022-07-18 10:53     ` Marek Marczykowski-Górecki
2022-07-18 11:14       ` Jan Beulich
2022-07-18 11:03     ` Marek Marczykowski-Górecki
2022-07-18 11:15       ` Jan Beulich
2022-07-06 15:32 ` [PATCH v2 6/9] IOMMU/VT-d: wire common device reserved memory API Marek Marczykowski-Górecki
2022-07-06 15:32 ` [PATCH v2 7/9] IOMMU/AMD: " Marek Marczykowski-Górecki
2022-07-14 10:22   ` Jan Beulich
2022-07-18 11:35     ` Marek Marczykowski-Górecki
2022-07-18 11:44       ` Jan Beulich
2022-07-06 15:32 ` [PATCH v2 8/9] xue: mark DMA buffers as reserved for the device Marek Marczykowski-Górecki
2022-07-14 11:51   ` Jan Beulich
2022-07-18 13:15     ` Marek Marczykowski-Górecki
2022-07-20 20:17     ` Marek Marczykowski-Górecki [this message]
2022-07-21 10:30       ` Jan Beulich
2022-07-06 15:32 ` [PATCH v2 9/9] xue: allow driving the rest of XHCI by a domain while Xen uses DbC Marek Marczykowski-Górecki
2022-07-14 12:06   ` Jan Beulich
2022-07-18 12:54     ` Marek Marczykowski-Górecki
2022-07-18 15:07       ` Jan Beulich

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=Ythi9BXeKwcdmiOO@mail-itl \
    --to=marmarek@invisiblethingslab.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=kevin.tian@intel.com \
    --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.