[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: Jan Beulich <jbeulich@xxxxxxxx>
- From: Henry Wang <Henry.Wang@xxxxxxx>
- Date: Fri, 14 Oct 2022 12:10:38 +0000
- Accept-language: zh-CN, en-US
- Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=2; 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=DhGkMGBtWQoFDpTCLjROZmvmBwHuk6kZyrUC2Qf9RXk=; b=Y0JfrWKVFC72ZXEu219i7ZOZaBazyhqAe1U5oeFEcdWme5kJeYLLlreVjzuoUvcsyrTAQBUpbWAjOmLweWSohm9cqljoVQOJMuTFtGuOhW0bXLMGNzQ2FX33rc0n7wpB2CQFTBGi9GuAVxiJikRIy+60dzrvtG6VoNdhgEpMAidlwSMf5O/7m3jsPpQpqn1oKctol7Uyn4csls9Own9oPsOHM53aHXLmi++4SEuHAg7bhsCZZE7vAG7I/WOIRgRUAVJ4VT1h9SoPvVIElw/jfyOd7otFLDcnc4aI8vcuADSIvuw+Af6ZyKJiQJPVBM444E4WaxqzWZv5YmUiGsH9rg==
- 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=DhGkMGBtWQoFDpTCLjROZmvmBwHuk6kZyrUC2Qf9RXk=; b=ZrboU0cdIASj5WW1D5s3sU8jnMT5h49S4FKyFB2FcJYrGu0Zbyiei4F10IL1aPqdpnaBpI+jHqrRnDOrlY7q1722gZCjilOa/oTFUatxcmPEewTTexBFunDVvbT45uGMdH9XHZzvonhcH4GiNqEWTHTMOItbDBT67goKucUR0odfDrYq6pNibKYseF1QgjWSBmVcn/hQ5SuSzjJdFWSTFOA5h1ETq1gUf4EJJP6eYuEtKDuuK8rwEuGJQ8JevpRSeD4nrMalP5LntRQ04MtVZQlGsYEcabye9Qb3lhGa8/1QUuZP4scZbKu8qRXuYHEl2FOr2dGktzgA+1XeVkU+rA==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=kNrnunlGyrYJWDtvWrsRUag5bCic1XyTgDtdgz4yWfuVWhYFiqX7Ze5aCYBYn92oIrPhur6vPqeWvcQTe0qKsnZhHvBVxZWffyBMa3M04YY3eHFHEsWTCbiIntYsJ+tqK8ovYBUNyvhqAX8rwR+dVBiuBDgEjTviX9skuFVzXDzcKuuHjZ/lkWoiuRxnI+/McwJ6lLgPwldVjDjYcL8GLOVSV/1nD+Z5sFZOnujmt7mofKE9zXyj7jqPLYRIZj8FkR7VGwZ7IAF2nfJidsu1SiB2FojfY7b81ociu1/fCxIDUTkJ+4LPP+i3mPIwMbWXbWvAWziqx3khH0m70X76iw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TtywUq3tbC3scmkUCyWWNIoWIrDSAZJOAbA/EIfcimEDNMPGJrXa72NhCxQN0HhDThFjbSy7I/BDFj2RT329kIk+wwLUoVGe0UJbAOX38fZq697lhOKBJ4x9RLzpsO3t1RuVL/W/AEEHV7urEwOVOIsrdOO1wrKFPhUwgCOikMAA5Rta8Hvs0pLimg9Ai/shxF3G4GfVNh7FaY3Mwz+uysLWbrSl8b0GA+Yhtr1n1YEpUngCGWB0SI0LBiliN601fVwoKDnjwOABlSU4c/iUcmnhNmzl1KQ6Z9QRAY7DCq9pDKfA6ybjZIxDmQ3DzRZQE3sBgCA7u+FleFOEvknkKQ==
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.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:11:17 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
- Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Thread-index: AQHY36RSrOIThkYtnEq9RrtWc+uYX64NnUwAgAAAd5CAAA4NgIAAAPkwgAAIMgCAAAAtcIAAA6oAgAAAMLCAABDdAIAAAGAA
- Thread-topic: [PATCH v2] xen/arm: p2m: Populate pages for GICv2 mapping in arch_domain_create()
Hi Jan,
> -----Original Message-----
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Subject: Re: [PATCH v2] xen/arm: p2m: Populate pages for GICv2 mapping in
> arch_domain_create()
>
> 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. */;
Thanks very much for the suggestions! I didn't think of the /* */
part and I really like this idea. This said, a quick search of different
coding styles and I found [1] mentioned:
"Empty loop bodies should use either empty braces or continue. "
So I will probably follow...
>
> or
>
> while ( p2m_teardown_allocation(d) == -ERESTART )
> continue; /* No preemption support here. */
...this way. Great experience of learning, thanks!
[1] https://google.github.io/styleguide/cppguide.html
Kind regards,
Henry
>
> . Otoh with the "err" variable you could ASSERT(!err) after the loop.
>
> Jan
|