[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 10:53:12 +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=zeCrEx6uxBpFQnoMQNaF/5FHws6SrBOtz2IWoU8HGnM=; b=a4PD5OAsZrHKQ/kBeip+Mj7Xpnor+ojwNAd2+zRwCzOj+2PqVf5IEtNEDAXBDxR9ss6S8iElslpnDonKjv7YUZsoodhHVQndWNNYYgX3vePJYDQcnOCntyaj0lX3G3XwUrl9uIQOCMg+TKruI49lTuTwILMsGZH3fpq8M9/ZPqwQhaDpuHR3TT93xHkKLZ6/XqmmUV3eGFQzpZeRRjwZSMueJCqn34Tc5fwdGnjxPXdbrYhO6X2bSqZ7t1HM+gYKdMy27wE+A/zM+L+2zEdYrd6UR3JiPpfGHeoeozrn1U32Z1pQuIwLs4TMy2KpWfJWr4qhvbgKIbIR4Ntl1UGElQ==
  • 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=zeCrEx6uxBpFQnoMQNaF/5FHws6SrBOtz2IWoU8HGnM=; b=KmxoIhkdWjTESamg2iRJKDb72lvKz6UObePkMQ4ABT0UE4N6ivZ0QfzDOGv8b7U1Y4oF4KNIKdlodRmsP+lJQla6WSTn6GCU840jIlmkOaJLcurmJ2IQ8lOsejWAbXihKSGF3UuuZAs5bYN5UimcWx8pPYNqA8UkbiRSXs1pqGDFtHopg9FkCT2gohbA09nzoKJvX5FPNKR8Jd86BDg6rkR0pZTHIZV3D9SeZI6ea1hR5bhEdvFN/1rZf39a+WU8Cn/unU1xoajOKnKRqRQ5yIc5YaoCrF44ZpIYATai5eiP0fS84a0/OKZdqHFCIJLPPT2+bKqvCbKn+EY9/uOjNQ==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=PAkSMaqF55FZsRB4EYzeGeq6HX9u5vWUN5GIc4vzPuQbRqELkAKetOdcMo7xqhAbmzoTqO+ML7JPEElpKL2jckxIdVCQNdcYRjT68+9o3h6aIkTUwOs7/Ettqb0dpQkwlnsRrmW1H1O58oNOIcDb23jHx4lc1gqDndQtB0fU7vQfeAt2O0e4p9PLE8wj1Mlbp9OExzGOmcAiZhPy5GGnnp6m/QBZYudiQR8xzambLugDUsqXzCKsMX7ub2tI7h6QluBPJK91k2kjg36aSfKDBaT5PzmgW9IuwfT4ilwggq+ZhG5EbUZc4a0oqFT0xNEzx8eW8o9Cc+dQUyBLfzCWAw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EewzD0sNSGK7hsKBvibS1GMP+AEdkjgL8ToxO5VlMZ/R6YImocQJWdqTWv7VPWCHumzWWJqXFxijai7htVE7GZQQETDOszky700uNqaLhcBXUZYLRg6ne0lkrcbHlRsbV4m16wgAOZ/dm2m710vJBz+wXmhKpnxfmzr3KuI4msYqwhjzRWT5nD2lbUZw8ZDBkBn/igjK/G/pM+/VHKCQoHw7jCeo12p0clvGJrkTRjqnjdDRM1Z/M7dhHc8U1B8s7zzHZi7APVmOyFarghDFBPgbYyO9XpsfH3e5b2YxaZeRFrq9P7YmBqEsaZ95Yvz1jiniVcFwldGG7hX/aoz1LQ==
  • 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 10:53:36 +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+uYX64NnUwAgAAAd5CAAA4NgIAAAPkwgAAIMgCAAAAtcA==
  • 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 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.

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 )

Kind regards,
Henry

> 
> Jan

 


Rackspace

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