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

Re: [PATCH v2 2/2] memory: XENMEM_add_to_physmap (almost) wrapping checks


  • To: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 13 Dec 2021 08:28:07 +0100
  • 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=tAmoCuDuA4Rpu4CReY46oI835jDUWPsgxCmYXHsXa+o=; b=EBfoeoHcLlfX9VLm2gMl71/BZMZRMEbnNmXFDzFcO5igNSkoPL28iANJ59WFNHxwgPHfVjkHnbAIU9s7AfGYccWjwhzlu5VRZJirSXGMBUTEc0qKKea3bzlGneEJQDpoJqZq0aoEi9odZhcVRvPvoXcQH0FsSjCK8Isov28h07MCb3OndX34loGKy5tQQdUP98YJiF0SHBqYm3wFroR5OpKIlKXgiDsrrXRQ/jEIF57kyqxmlmnTnYGBG9HPHEH7u9KlgPaogSWUaeUwKAmS7d4AVZsGcamSD2OQXX9c/Ff2KnjBhna8FQbXg9cd0O3+NHaSGiX3qZpi8uq8PqB1vQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OiIpISJKBY6AmSiQIXqpjqU9mQPkTJBm9vYhqf3CUe7+fMev0TR2nIL0eCSQzfHdcQQCJ6oRXV0smNF1M6PzpSh62JBuiGdgNZntCwyCCIPZStDMdruZ3irsBplezHvsDPsDuZZaL0iLT7A/teFF6HBIvXgeRSlmmKslXOE/qaJCGlJyH+IKGaEXliz4AI70aGOSFqFMbKeKp/O9Bh0/P76g/RRM1OR3OLmTe7lFhSqTA1wrcST18DApd5zvP6iHhbJxlJvm+kAccOtS5RPI6l/r92sNDn9N84AScI7BrI8+8e0wbK6/lAEQQ7VCs7kX9n1mV4Mh2tCpz5r98uiCGA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 13 Dec 2021 07:28:50 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 10.12.2021 15:10, Oleksandr Andrushchenko wrote:
> On 10.12.21 11:40, Jan Beulich wrote:
>> --- a/xen/arch/arm/mm.c
>> +++ b/xen/arch/arm/mm.c
>> @@ -1479,7 +1479,7 @@ int xenmem_add_to_physmap_one(
>>           break;
>>       }
>>       case XENMAPSPACE_dev_mmio:
>> -        rc = map_dev_mmio_region(d, gfn, 1, _mfn(idx));
>> +        rc = map_dev_mmio_region(d, gfn, _mfn(idx));
> Technically this is ok, but reads odd now: the function maps a single
> page, but its name has "region" in it (which might also be ok, e.g.
> for a region of a single page).
> 
> I think it is worth either implementing full mfn range check inside
> map_dev_mmio_region or renaming it to something else:
> with mfn check map_dev_mmio_region will indeed be able to map
> a region consisting of multiple pages and perform required validation.

Well, I had no maintainer comments on v1 regarding the name. I'd be
happy to rename to e.g. map_dev_mmio_page(), so long as there can be
an agreed upon name before I submit a possible v3. Julien, Stefano?

Jan




 


Rackspace

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