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

Re: [PATCH v1 01/10] drivers/char: Add support for Xue USB3 debugger


  • To: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 4 Jul 2022 11:36:02 +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=q6xKKvrTzkKsrHUsM0iN5okDsgdVIju65ZhH96dTARc=; b=czAOAoE3XX6gRVsunHpa0U36uY8qh0vcjEVBfBt/3XKjyB+lXXjjPuV2G7XAFnePLqr1cGUVpPy6tzCFe2EGJ7YOtfdFieFC4UD611veDYDahx1G2Z5eAI8DDRzpd0w46vTjYm/OsnJOA2yhPxUdSu9DvJaLlIAejH22AfAEJupgF3apC0s+IM0dArCIPEqyJl+dGStijNZjxaMcjhmd67P4GmzTJoE4RjF7A8PjabpaZBEO4eCKTR+BxN3bFThZ9HZNhvyOiQSM1DCJ9SPO977nvDENCAdWcciBXTiM9M4mOj5Gz8VTRqrNtYAUbi3DfPcym4TXxygRQdiiH3B1qQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n5uh3582hsd6UgvryAW0EODJoZ4f64+YiFTEan0951kcvh7JKAxlJY3S8HxNULLVzpbm5w8AtPPx+Y4rPbOqi4XbIdOZjDc/EYUsEcO3LufBdp2UnzTbkU1Aa5odpDtXqQ5uTXw6uLLMhT5p8knQhXuhsjaCjQ1J04nNxLN76Qi3vGgwoCcIEcvm/hxuLbF84D9hkyYF0mBCWL9wQO/FWKjY8HpHaUYnzXU7CTUFZ9Y5BFZEUJPZG0z64+N7FHcXBD4YV96197807xlAb4UZLKOVAaUhXPRkCIQBC3MtaiICcFBwnRibQijjW00znLuBsMGR63TsCoOxZjY+YuezMA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Connor Davis <davisc@xxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 04 Jul 2022 09:36:16 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 04.07.2022 11:27, Marek Marczykowski-Górecki wrote:
> On Mon, Jul 04, 2022 at 08:05:06AM +0200, Jan Beulich wrote:
>> On 03.07.2022 14:17, Marek Marczykowski-Górecki wrote:
>>> On Thu, Jun 23, 2022 at 11:29:31AM +0200, Jan Beulich wrote:
>>>> On 22.06.2022 17:47, Marek Marczykowski-Górecki wrote:
>>>>> On Wed, Jun 15, 2022 at 04:25:54PM +0200, Jan Beulich wrote:
>>>>>> On 07.06.2022 16:30, Marek Marczykowski-Górecki wrote:
>>>>>>> +    memset(xue, 0, sizeof(*xue));
>>>>>>> +
>>>>>>> +    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;
>>>>>>
>>>>>> Especially the page-sized entities want allocating dynamically here, as
>>>>>> they won't be needed without the command line option requesting the use
>>>>>> of this driver.
>>>>>
>>>>> Are you okay with changing this only in patch 9, where I restructure those
>>>>> buffers anyway?
>>>>
>>>> I'm afraid I'll need to make it to patch 9 to answer this question. If
>>>> suitable dealt with later, I don't see a fundamental problem, as long
>>>> as it's clear then that I will request that this patch be committed in
>>>> a batch with that later one, not in isolation.
>>>
>>> This turns out to be rather problematic. xue_uart_init() is called
>>> really early (as it should, to get console as early as possible). It's
>>> before even boot allocator is functioning, so I can't use 
>>> alloc_boot_pages().
>>> Are there any other options for memory allocations at this point?
>>
>> No "neat" ones. Stealing directly from E820 could be an option, but
>> would of course be heavily x86-centric.
>>
>>> We are talking about 58 pages. It isn't much, but isn't exactly nothing
>>> either. Maybe there is way to keep the memory allocated statically as it
>>> is now, but return it to the allocator is xue is _not_ enabled?
>>
>> Well, yes, treating them like .init.data would seem to be the least bad
>> alternative then, at least for now. Down the road we may want to generalize
>> what's needed here, as there are other full-page or larger memory areas
>> which are used only under certain conditions. We may e.g. want to introduce
>> an approach similar to Linux'es .brk section (recently renamed to .brk..bss
>> iirc). If a non-generalized approach ends up looking too ugly, I'd be okay
>> with keeping things as they're now, just with a respective justification
>> added to the patch description.
> 
> Looking at it, I see another issue - Xen uses superpages, so I'd either
> need to:
>  - reserve the whole superpage to be able to release it later (waste 6
>    pages if xue is used), or
>  - shatter superpage when releasing unused xue buffers

That's part of the reason for my desire to generalize this.

> First one is probably less bad. But maybe, instead of doing all this,
> add xue to the menuconfig (make the prompt visible) with appropriate
> note about wasting 58 pages when built-in but not enabled. What do you
> think?

I don't mind it being done this way for now.

Jan



 


Rackspace

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