[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: Julien Grall <julien@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
  • From: Henry Wang <Henry.Wang@xxxxxxx>
  • Date: Fri, 14 Oct 2022 10:38:29 +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=mlL8+1BvEfMN6YB6D3qMgFFOOzmaFnpxC4LRI1A/U/k=; b=L+a01MSDQe16Jmk/Mp0I5x2+EhvXqSqHwZUkMq/SNe18q2EdTmS5LpGxXXoXjZg7+wHhmlOhSjHjRP1be5f8kvXFvO15fdF0wzbhPB99lhgmPEjxxoDlm1tnn+s/IPm+czPbSXS97WoyjKD4QZe00yayAU1xDwz70g7R+Kxsis2BW5NP9XechUm6Qre7hjxsi2XB3ZInBRt8ICteRGTkdgQbnZWyOK1oKgT3+Dd3lATjwQB+D2uJRIPIqDpUMOfwQ/N3wxsc2L4JUIUXUHXMvVqrVgq4/7S+SAmeODM7eZ/woWYyhYeWLdeCXxtH5dR9TZmLDUgP0kxfo36URXQMzA==
  • 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=mlL8+1BvEfMN6YB6D3qMgFFOOzmaFnpxC4LRI1A/U/k=; b=I/p4BvycdOJFq8xPLh+YkZiF3+H6/DF8/JQa2HjIn/lSMNV3fKHANj7Mvd+pkshsY6XqCOMuRf6xvr5e6hMxlrIl4QpXr/3URPmsWarjTpnxWWju0iLyY+MYh9vHXsVQt+qMMCVgTXgptRSYxQmV8rCMUXjBlroZ4f1Hz2cUL6ELJCGMET0j85b5Sh1qyVydJS9SAVYY+tAuFKbz//ze2Dfn/XjRhrzRfkqktb+yKv9HoiZDW2bUquTkcr8YaqE9lOFyMr6AnR6qjnn/kWp8fsrzIxiHOzbSMltl2AG8/vwsB1XtDAr48WDOpV6EeAU6qV+9k9XQD9f86WDbcFQ2aQ==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=J2HKeOxmrYKsvTCikh9EMN/jW4mh4LRhp9ybBoyhvV2xkkqJtV+NnV58MNFY1vwp4MGdlwM9Q0uPg50WCX8sgujUSFhEtuWSaGCNni3Tbtp3MOYW9fe6MQ6KTy9QUq42OA6EQl5k8HtMA9deGliP0EDorwzhFw3KJzKA8Zki9ZHnokje8Hl2VEW/QKfQuwUWNkO2whZPUWizo9/Dec7muSPH54Cky1eMSKhDfCCoLN7nqIQ/tKde3aaXV5YHnWfS59q8a8r7YhuwD4BKM4eSFW4pErY2eVFXjK/wH1cPy+VrdEKx5gHLnCZjiiBqEJmq97aTyfx6fs/HkMAz1um6hA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=THBJsdJ+Ur/JT9IqWuJ5225KIR5RadCENEH1NXR+aT0h5hNefRgK9Vc/RP5tLTIgw/b/HN4XCI/ZsPCHwsQzmGA6j9giiPbC+mXRBudO80A0auqe4CQ6lfsXVpVrYa7uqdlL/KK20rUegIHsh96Gw6dSIRk1Z8bB8la1VCcuWl261FAMnM1gX249JOIGYtbXnQ+pS05Wamed/zpjt5mgyEklZgwxIH2Q90hpC6W1nkskEQbbBn8JcD3yV2K14xgzD5lsSTw5yiLyln+WhwPrPlqMP5TA+rIoTohYUexFZTK5N8pqilp1s8yenfH0qRe3sQfmCChQJEnZA0SRopkbeA==
  • 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>
  • Delivery-date: Fri, 14 Oct 2022 10:38:44 +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+uYX64NnUwAgAAAd5CAAA4NgIAAAPkw
  • Thread-topic: [PATCH v2] xen/arm: p2m: Populate pages for GICv2 mapping in arch_domain_create()

Hi Julien,

> -----Original Message-----
> From: Julien Grall <julien@xxxxxxx>
> Subject: Re: [PATCH v2] xen/arm: p2m: Populate pages for GICv2 mapping in
> arch_domain_create()
> >>> +    spin_lock(&d->arch.paging.lock);
> >>> +    rc = p2m_set_allocation(d, 16, NULL);
> >>> +    spin_unlock(&d->arch.paging.lock);
> >>> +    if ( rc != 0 )
> >>> +        goto fail;
> >>
> >> Putting this level of knowledge here feels like a layering violation to
> >> me. My first suggestion would be to move this call somewhere under
> >> p2m_init().
> >
> > That is definitely possible. If Julien or other Arm maintainers are not
> > against that I am happy to move this to p2m_init() in v3.
> I understand both of Jan and your concern. I don't really have a strong
> opinion either way.
> 
> You are the author of the patch, so I will let you chose.

Then p2m_init(), just want to make everyone happy :)))

> 
> >>> +    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?

Kind regards,
Henry

> 
> Cheers,
> 
> --
> Julien Grall

 


Rackspace

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