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

Re: [PATCH] console: generalize the ability for domU access


  • To: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 4 Aug 2023 09:49:53 +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=pK8Vhq387biROCAprJ3LZiRopB/zy2Jlz6LEwBX6jI0=; b=hrplvX8R/BfPxx62uXBYLugDBezfbRdrlwVkWRqrdCJBdEdmozPnrT6/fcHLvk8MheZv41rDD6aSn7Pl2BuUXN2CUoy5mD+zdrUvhfyyxEdLm0BiDa35diQ488ZKFy4nqcBp5/MOnRGce6I3dSNV5cV5vhr22aUWq4ZPq+SUidDTFw6r8ldLphhWVjO9zPEvJdxwaJ+82fPl3qhmgiPRqVyp4Hlxmh32eL1EisTQhMWWO4BZ3Dkhf9Jrn0LnSNPUMlcALJ++iLQdq6YySIND8YSWePh+O74686DSUw5y3de+bM/1h/j56SOwR8tiiKAQpt6U+Nxe8l2c9nqt5l023Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A//hTqTS05Uf9mDHd8lfOgmr+xNEhNXhVuejcvsPaytZb4iBwSdy7TO93Gp3XwCjHwaEahtsFx5B2f9qZcEx/Iawnrnt6hlL2ZABwC8MMYWjbmGaIS0oy+2tvZJE9xwdMM5WxBCvwh0p+zbyFjL2nW8Z+JyJYV5/pbuf9614RdYLe8j/9dlEmABxyrZ1gdrDxi5lrNVCmLCnNWNSZPYFyXF0DoSxgHbRPrlnpjKjMUOB3W5QD/U0cd+ZJOUMu0SrtmJNZGaHc1ZKkZPkUq4/fqe/fFkTK8kyuVToTaUNuZMJHShqEUQyWlepvE4IMD7IvlJPED5RJ1pkPe/d6HO6lg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Christopher Clark <christopher.w.clark@xxxxxxxxx>, Luca Fancellu <luca.fancellu@xxxxxxx>, Henry Wang <Henry.Wang@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 04 Aug 2023 07:50:07 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 03.08.2023 18:31, Daniel P. Smith wrote:
> On 8/3/23 11:56, Jan Beulich wrote:
>> On 03.08.2023 14:56, Daniel P. Smith wrote:
>>> On 8/2/23 07:01, Jan Beulich wrote:
>>>> On 01.08.2023 18:06, Daniel P. Smith wrote:
>>>>> +        {
>>>>> +            for_each_domain(next)
>>>>
>>>> What guarantees that the list won't change behind your back? You don't
>>>> hold domlist_read_lock here afaict. It might be that you're safe because
>>>> that lock is an RCU one and this function is only invoked at init time
>>>> or from some form of interrupt handler. But that's far from obvious and
>>>> will hence need both properly confirming and stating in a comment. (It
>>>> is actually this concern, iirc, which so far had us avoid iterating the
>>>> domain list here.)
>>>
>>> It is better to error on the side of caution instead of assuming this
>>> will always be invoked in a safe manner. I will add a read lock for the
>>> domain list.
>>
>> I'm not firm enough in RCU to be certain whether acquiring that lock is
>> permissible here.
> 
> Same and I took your statements to suggest that I should.

Actually I wasn't paying close enough attention here: The code already
uses rcu_lock_domain_by_id(), which acquires domlist_read_lock.

Jan



 


Rackspace

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