[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 12:45:54 +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=TgQ2wrU8Ch7wfwAdiTSrgmW0AQveNp6rsVxf8bjn4AQ=; b=P7OUddb60iGfnzdKqCn4mJ87WnX+SzqbLRjpMKu+nkVKJbaq3V1YjKC16F9hkaWYK5dd3GwqfqgLFLIwH+nP2PoRT9eJfEu6EKe8OSCTFCXpbuiENh22O/1JXJb5m0lx63/uHGVnysRJH/Z6HTVHJH5oxKRGVV+7+/dL5VxOnlS79BNkDW8ZTKYZrTubJ7kI9pvN8Miih9uwvM0H9RXNM3aULZDEzPjUbMU5796P5x7gBDPtOthtmwEg8Movo0SdTGNsh1RE+Xo2Mvi6B12j5M4u7EQhrXeZrVoyDvwSEoWbVnkJb+W9uPkZnWrHbj/hdS9MNEg0pr6Fh49iC2fEOA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SGpxUOIA0iu0Xv+YdQlPtRNT1OBNf+qiW9uT3PZbws+GtmqFr5pTHo+eQlA7qSI+TvGOA/zUjpZYg0jru2Mf4vrXL1PTjJb1SBGFp7XGuKNIq0mHWrHEg0TUR2VsNAvHhkh292llIT774B0DfUSIr/IkVgmrDARQp5P20X1oDjA8SjC442z5E+c0PADS+i5r2vramzcZ9CzXtFyK3eCOUrBCL8pVkl+QNtbHkH9Da06A7Wf8ikYqWqr0CFJVMEIKh7Ek0bWEm6bMtSAvjH9ao81pPswbVPOl17wuv4bID2sVbINjVXDHU0GE3NFdH1pm4oOE4TNE/qIE+C+HO1uZKA==
  • 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 10:46:03 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 14.10.2022 12:38, Henry Wang wrote:
>> -----Original Message-----
>> From: Julien Grall <julien@xxxxxxx>
>>>>> +    if ( d->arch.paging.p2m_total_pages != 0 )
>>>>> +    {
>>>>> +        spin_lock(&d->arch.paging.lock);
>>>>> +        p2m_set_allocation(d, 0, NULL);
>>>>> +        spin_unlock(&d->arch.paging.lock);
>>>>> +        ASSERT(d->arch.paging.p2m_total_pages == 0);
>>>>> +    }
>>>>
>>>> Is it intentional to largely open-code p2m_teardown_allocation() here?
>>>
>>> Yes, AFAICT p2m_teardown_allocation() is preemptible and we don't want
>>> any preemption here.
>>
>> Like Jan, I would prefer if we can avoid the duplication. The loop
>> suggested by Jan should work.
> 
> I am a little bit worried about the -ENOMEM, if -ENOMEM is
> returned from p2m_teardown_allocation(d), I think we are in
> the infinite loop, or did I miss understood the loop that Jan referred
> to?

Where would -ENOMEM come from? We're firmly freeing memory here. -ENOMEM
can only occur for a non-zero 2nd argument.

Jan



 


Rackspace

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