[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 1/9] drivers/char: Add support for Xue USB3 debugger


  • To: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 14 Jul 2022 13:58:25 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=11unytSiLs678PrZ8sc7YV1Xvo4MxclbMNsP2wJRGwI=; b=Lh5h87BDt62MPCm91iLYhVFwtmbtram3VFCqcwXZN+Xiv6oXW4w6GrDpggdkbPkTbkxLZRX2Ji8UWT+ZGC/dridWuShigpph/eIgfmq9D4VLYPWzcxl73+O+/dLUmURxu88D+oCa1cFU4w3cTS5OFX8Eia/mFNt7+0m+GlR828bhzCK10oWZ6Env6V5c45l45Pdfa59GJ7aVfjHsNOeh0AbrPDuT/DULnPJivt4avvEYEruzTh19KxCwDuYDJZmljliszzNHEvn8UqE1G7PncQb5p1KbAyg9SjRT5FY9G+sa9r5b6VISwgkqXtMEEzjEkJjYeIx89abF+n/ZCQMwmA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kkkfeTlANHevIDBzX2kP62nBjz3l5atPi1AHzaZLyDG6gcIZ/LUtrQSiub5pkosiJk8/QMi0Xe7DO53S+E1sQhMoGWtRq3w382U29U5OImNEPG743arObIovkiO4XNzPYo8azKctb3/ghI7fskDwrjDsRljqzHiL+Z+5FRKB/4HtNGmJCDzgc4RV/MqLsg0tlmjwti4O8KGmMxDEdwGs08zoXnUaVzHtvasxaaAAI0G9ewdxL0jJP1gV+sCE9LqxON7W7CpfE9K/k31XYjiD5slmpf+qdceQkusyoWoTKD5H0l9KpOrcu7LeegDJ/Sqxam6+LrDz8uUtm6B0Srr7mQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Connor Davis <connojdavis@xxxxxxxxx>
  • Delivery-date: Thu, 14 Jul 2022 11:58:36 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 06.07.2022 17:32, Marek Marczykowski-Górecki wrote:
> +static int xue_init_dbc(struct xue *xue)
> +{
> +    uint64_t erdp = 0;
> +    uint64_t out = 0;
> +    uint64_t in = 0;
> +    uint64_t mbs = 0;
> +    struct xue_dbc_reg *reg = xue_find_dbc(xue);
> +
> +    if ( !reg )
> +        return 0;
> +
> +    xue->dbc_reg = reg;
> +    xue_disable_dbc(xue);
> +
> +    xue_trb_ring_init(xue, &xue->dbc_ering, 0, XUE_DB_INVAL);
> +    xue_trb_ring_init(xue, &xue->dbc_oring, 1, XUE_DB_OUT);
> +    xue_trb_ring_init(xue, &xue->dbc_iring, 1, XUE_DB_IN);
> +
> +    erdp = virt_to_maddr(xue->dbc_ering.trb);
> +    if ( !erdp )
> +        return 0;
> +
> +    memset(xue->dbc_erst, 0, sizeof(*xue->dbc_erst));
> +    xue->dbc_erst->base = erdp;
> +    xue->dbc_erst->size = XUE_TRB_RING_CAP;
> +
> +    mbs = (reg->ctrl & 0xFF0000) >> 16;
> +    out = virt_to_maddr(xue->dbc_oring.trb);
> +    in = virt_to_maddr(xue->dbc_iring.trb);
> +
> +    memset(xue->dbc_ctx, 0, sizeof(*xue->dbc_ctx));
> +    xue_init_strings(xue, xue->dbc_ctx->info);
> +    xue_init_ep(xue->dbc_ctx->ep_out, mbs, xue_ep_bulk_out, out);
> +    xue_init_ep(xue->dbc_ctx->ep_in, mbs, xue_ep_bulk_in, in);
> +
> +    reg->erstsz = 1;
> +    reg->erstba = virt_to_maddr(xue->dbc_erst);
> +    reg->erdp = erdp;
> +    reg->cp = virt_to_maddr(xue->dbc_ctx);

The only place this field is read looks to be xue_dump().

> +static struct xue_trb evt_trb[XUE_TRB_RING_CAP] __aligned(XUE_PAGE_SIZE);
> +static struct xue_trb out_trb[XUE_TRB_RING_CAP] __aligned(XUE_PAGE_SIZE);
> +static struct xue_trb in_trb[XUE_TRB_RING_CAP] __aligned(XUE_PAGE_SIZE);
> +static struct xue_erst_segment erst __aligned(64);
> +static struct xue_dbc_ctx ctx __aligned(64);
> +static uint8_t wrk_buf[XUE_WORK_RING_CAP] __aligned(XUE_PAGE_SIZE);
> +static char str_buf[XUE_PAGE_SIZE] __aligned(64);

While I think I can see the point of the page-size alignment, can you
please clarify the need for the three instances of 64-byte alignment?

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.