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

Re: [PATCH v3 01/10] drivers/char: Add support for USB3 DbC debugger


  • To: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 4 Aug 2022 16:36:35 +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=vCrFzfLO4JwT40Kgl1uU/Intzf3eBBVTYERP1T9BfUg=; b=CVfSrCfWnEAgVYIaoat54WZLZyXORzYgwni4kVPwqQ9AoTQK/iaSF6FZIgm9p8ph5+LZhYhJWyeLYjKynFz8/36QZlfKndFPA2S+xbJ0t1lMTWpEli8WZpUJ4Cwmti/4pGatD0k/MsriUDt0T3c+AYk5Rxe5XOWLWjWkZ1I5ggO06q3MyCpAm2uPfFO+6447x5TUpJKX6Im/rBdN3rAcOCC1ro46uS2e9xk//0jQQMNrISz3qQxwiAE9zBvg1b6eTqTtZknyOUV/hsmspnMXzvyp0bshVXjp7EAT6shRb0ofP6ZSQyXpa29KaiAlfSK0WWq3evjWedBF6IAbloXosg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Aswbek4tPS64AW3u6EViYBhgM6qGJr7xwtBE3pYn8/l0gFYrc7gQub1eXh+0QFWMAFq3fBnuS2F4MtpxnQsp+ocnbyrZgRsqVZHjdwXvRQ5wMECdze3EjgTRWVrYB0O30D1BoeCSBDPQO4cT7tgZRBSrxHXUa8k3m2613pSqXx0pMMJ0sRTBg4xrQtApj9O95R4E+Q0tygCdCrsREXTN780gd0ha3e6ruNaP02A/U8uabmy6/nm+lTPebrNYuG9KConfPh2umQjyJuVfeAnU/loSYKvoSmODCqtJhOkS26IDsfEAVZNLtG76hZdbFbk+bfwVZ53/IgH+IN3xlHEJCg==
  • 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
  • Delivery-date: Thu, 04 Aug 2022 14:36:43 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 04.08.2022 16:28, Marek Marczykowski-Górecki wrote:
> On Thu, Aug 04, 2022 at 04:21:01PM +0200, Jan Beulich wrote:
>> On 04.08.2022 15:43, Marek Marczykowski-Górecki wrote:
>>> I need to keep this structure somewhere DMA-reachable for the device (as
>>> in - included in appropriate IOMMU context). Patch 8/10 is doing it. And
>>> also, patch 8/10 is putting it together with other DMA-reachable
>>> structures (not a separate page on its own). If I'd make it a separate
>>> static variable (not part of that later struct), I'd need to reserve the
>>> whole page for it - to guarantee no unrelated data lives on the same
>>> (DMA-reachable) page.
>>>
>>> As for statically initializing it, if would require the whole
>>> (multi-page DMA-reachable) thing living in .data, not .bss, so a bigger
>>> binary (not a huge concern due to compression, but still). But more
>>> importantly, I don't know how to do it in a readable way, and you have
>>> complained about readability of initializer of this structure in v2.
>>>
>>>> That struct will be quite a bit less than a page's worth in size.
>>>
>>> See above - it cannot share page with unrelated Xen data.
>>
>> I have to admit that I'd see no issue if these lived side by side with
>> e.g. other string literals. The more that the device is supposed to be
>> exposed to Dom0 only anyway, and hence that'll be the only domain able
>> to get at that data.
> 
> Other string literals are fine. But for example `struct dbc` itself is
> not.
> See how it is combined with other data in patch 8.
> 
>>>> If you build the file with -fshort-wchar, you may even be able to
>>>> use easy to read string literals for the initializer.
>>>
>>> I can try, but I'm not exactly sure how to make readable UTF-16
>>> literals...
>>
>> L"Xen" looks sufficiently readable to me. We use this all over the
>> place in the EFI interfacing code.
> 
> Ok, I can try that. But given later adjustments, IIUC it will make the
> whole 50+ pages structure land in .data. Is that okay?

No. I was actually expecting the piece of data we're talking about here
to land in .rodata, and hence be re-usable at the same address for all
devices. Hence my reference to string literals.

Jan



 


Rackspace

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