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

Re: [PATCH v2] xen/arm: p2m: Populate pages for GICv2 mapping in arch_domain_create()


  • To: Henry Wang <Henry.Wang@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 14 Oct 2022 14:00:40 +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=OBiTkr1oxxv/4yoo989+RzrA1PdxQINdACqpm1fb1kA=; b=gJZ5mhQZhGqpx3BLYYxy7e6KnRT89acTvSl1VbYHlP4hjs/he/0ezbDk6C4Exq3gbkG8wungToxJ0S/o8v2f5LfknDNcujc6OaxJEKHtD+7ipx/tHuIoA1e01HyL977KaeAKQYssQZwR1cLMQcyuLTjydKTnGXEsWrjjhoJnpAtFVwWL/hh9CnPCYem+kIN7c6Gf7Qpmd1JQER3fsZ2ljGaL0FAWfNgksY62119BQN183kRisyAKm4x8wHFtD492f+YsofUWY0RRpAHRr0TlkU0GLkhvuPp5zwn99hsVDuXEwlMu3ISPpi0EIKYGqeZqYtlQW15s6/r/nexBtW9myg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jFXccE0uBKmhsjoa7gGON9nN7t8wT8tjyMPgTf7hI4+lwBOkFpJ6oeqXzXSAsR4dn56U/Z3x5CyrwjbCp+7xzOYQK/0+IEdh9Z68+KAkS6nSB3iilRU2xNHVAfC2RnGoeo5Bm3Hx3yN6rXwsMsziKFm/W6PpXRRSuGJk2xGCC5WL4ouBIFAKYPE843Y7GkHQAn3lSmJwIuZvjQSedPVk2aBuN4axGU+Diw3CK8XhM25njXZ7e5Clh3L3Ucg318bApX2gXnks26jlL134sqsbrMDw2lEJGlLzMOuOh4hwkvbA8IQfwiwCk0eXBbXR16J7RP4/mbQxu3RqNMxuWE7OCg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>
  • Delivery-date: Fri, 14 Oct 2022 12:00:52 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 14.10.2022 13:04, Henry Wang wrote:
>> -----Original Message-----
>> From: Jan Beulich <jbeulich@xxxxxxxx>
>>
>>> My initial thought is the "else if" part in p2m_set_allocation. It might be
>>> wrong. Would the code below seems ok to you?
>>>
>>> int err;
>>>
>>> do {
>>>     err = p2m_teardown_allocation(d)
>>> } while ( err == -ERESTART )
>>
>> Sure, one of several ways of doing it.
> 
> Thanks for your confirmation. Just to play safe if you have more simple
> Solutions please do raise it. It is a good opportunity for me to learn and
> personally I am not a big fan of either do-while or the introduced "err"
> which is used only by p2m_teardown_allocation(d), considering the
> p2m_final_teardown(d) has a void return type...

Personally I would probably have written

    while ( p2m_teardown_allocation(d) == -ERESTART )
        /* Nothing - no preemption support here. */;

or

    while ( p2m_teardown_allocation(d) == -ERESTART )
        continue; /* No preemption support here. */

. Otoh with the "err" variable you could ASSERT(!err) after the loop.

Jan



 


Rackspace

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