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

Re: [PATCH v9 8/8] xen: retrieve reserved pages on populate_physmap


  • To: Penny Zheng <Penny.Zheng@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Fri, 12 Aug 2022 09:53:45 +0000
  • Accept-language: en-GB, 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=ScySF2g035rfwO4S5ctcc09VTH5urQlDE4LKqsdQo3w=; b=E09alhbrW9G5xWo/+1loWNefEudZCT8g4zD/3ExFDhmNHKtsSXX20Z7VA6nDqPTkIpMBvnTxeA0/V567mJa3HIbjkUZuhETVbidfDkZV0sDfpZ3nKb48uzd0njpAWw3cY16Hu9aJykoVRLTmFC/sG1XfCtfPV7Ygo1TpH/xQ53FyijqFQLwF/5O4Bxzu4g3z9+DdfK52e4Rcz1jfIu290D1vONHa4P3nJ3rDX7PtK3ctsth1EMJRjNsks/wfyVR8EEw/7dITS6NN0bDhaFbLW1uUaR29mObQTLM5dvgdxqcthvnguFhDUl3MSGS5XsuYOASmjMk0kZR8iUizg6f6kQ==
  • 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=ScySF2g035rfwO4S5ctcc09VTH5urQlDE4LKqsdQo3w=; b=fWo8EvxDxFgU/ZQ5LfIULxZqaRwCQd96/uh5sK1CuXilHKHjkL4f4zHEb/wHakOdZXNEbqGfQS33jq3ojEqQJicCL6CDopOYZy55NTucWWI0BtgXVNi1vkCGcoIih/WMFkWHj85wKAFUQmz65NMbTZvArDibeJGiBdQWEAgtEuIJlTdSq6tJBww4QVNBXrotQM9XluNlvfa4O3P3yH6DFa1x2xt/V1FrIJvZXbQl8XgRM6FDeuJ4aSjuTzg4UVDhjScqyxhhuWWjpC3Wk9cEAzgQ/tSWIbRDBiQjkV7osRm2PDEu54nfwHmlIbfWltGHK8xYrqT+Vv/g+/DWB2Ixmw==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=nWSGukNcaEzhJSLuEmYpaDU03THtuCJLjjlvahc6F/l01sCIMh0StMzPGVfuC1JVWCMDZ1Ncp8sSGWOy7eZyqGJBVmZdTUaSm5N2IqlIogAJFJimbHKtqL7mJT+4rjX+7MVoJtsgPF4smlTFV6GcLkNau+PFElz8ohJAr4GDh77hlkD/DJEwq545K6TCfyDHkIpXflCKHyvjlFqsPGh6k1gspqKCXf968Kw0AQz8MNpXp1+nh6shFWTwwnGB7dF84k3fgnJxXn7KvlqhdlxVu00fvoEMtp+ZsqeW75T8F4rT6q1RYWPSYD74jBRAmlvTMzxqs8AnOdKkWML2uOy5fw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CdFzmUZvLhBsCe4R6CpYBswF3jMqsq6QI0RI2oMFXL1jiLWlmTRZFQ2jK4HLH/MUstYum7sp4x/Yhl1hvQIrFQV0/hZkPorsPXhUa8cmOV6Ra42KR5hpXHg3b7egNEXp6V0xdMCLmryL/dLSexaM3vfsS4Ix6alUq0s0GvoQSoQ3sH9hAM+3OvATJyzUzh/09nNxTaDUodruXwWFx8rcFKdVS2IlavpoBbInQ4GwydA/ohex4CvzA/2dRAlU3szGooWXkxmNV/wCGKDZhz0JjVhejjo5Am/fxHCw6PQWfNLC1hhz6R2ewqxNUQSy06H0XgjVIL7BidZPafgGPbY/jQ==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Wei Chen <Wei.Chen@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 12 Aug 2022 09:54:09 +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: AQHYm/wrUfogDGShnkmhOgXs9i6E7a2PQtqAgBcPXACAAAGYAIAAAoCAgAAFWYCAAAiigIAExo8A
  • Thread-topic: [PATCH v9 8/8] xen: retrieve reserved pages on populate_physmap

Hi Penny,

> On 9 Aug 2022, at 09:58, Penny Zheng <Penny.Zheng@xxxxxxx> wrote:
> 
> Hi jan
> 
>> -----Original Message-----
>> From: Jan Beulich <jbeulich@xxxxxxxx>
>> Sent: Tuesday, August 9, 2022 4:27 PM
>> To: Penny Zheng <Penny.Zheng@xxxxxxx>
>> Cc: Wei Chen <Wei.Chen@xxxxxxx>; Andrew Cooper
>> <andrew.cooper3@xxxxxxxxxx>; George Dunlap <george.dunlap@xxxxxxxxxx>;
>> Julien Grall <julien@xxxxxxx>; Stefano Stabellini <sstabellini@xxxxxxxxxx>;
>> Wei Liu <wl@xxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx
>> Subject: Re: [PATCH v9 8/8] xen: retrieve reserved pages on
>> populate_physmap
>> 
>> On 09.08.2022 10:07, Penny Zheng wrote:
>>>> -----Original Message-----
>>>> From: Jan Beulich <jbeulich@xxxxxxxx>
>>>> Sent: Tuesday, August 9, 2022 3:59 PM
>>>> 
>>>> On 09.08.2022 09:53, Penny Zheng wrote:
>>>>>> -----Original Message-----
>>>>>> From: Xen-devel <xen-devel-bounces@xxxxxxxxxxxxxxxxxxxx> On Behalf
>>>>>> Of Jan Beulich
>>>>>> Sent: Monday, July 25, 2022 11:44 PM
>>>>>> 
>>>>>> On 20.07.2022 07:46, Penny Zheng wrote:
>>>>>>> When a static domain populates memory through populate_physmap
>> at
>>>>>>> runtime, it shall retrieve reserved pages from resv_page_list to
>>>>>>> make sure that guest RAM is still restricted in statically
>>>>>>> configured memory
>>>>>> regions.
>>>>>>> This commit also introduces a new helper acquire_reserved_page to
>>>>>>> make
>>>>>> it work.
>>>>>>> 
>>>>>>> Signed-off-by: Penny Zheng <penny.zheng@xxxxxxx>
>>>>>>> ---
>>>>>>> v9 changes:
>>>>>>> - Use ASSERT_ALLOC_CONTEXT() in acquire_reserved_page
>>>>>>> - Add free_staticmem_pages to undo prepare_staticmem_pages when
>>>>>>> assign_domstatic_pages fails
>>>>>> 
>>>>>> May I suggest to re-consider naming of the various functions?
>>>>>> Undoing what "prepare" did by "free" is, well, counterintuitive.
>>>>>> 
>>>>> 
>>>>> How about change the name "prepare_staticmem_pages" to
>>>> "allocate_staticmem_pages"?
>>>> 
>>>> Perhaps - if what the function does really resembles allocation in some
>> way.
>>>> So far I wasn't really certain in that regard, and hence I was
>>>> wondering whether "prepare" doesn't better describe what it does, but
>>>> then its inverse also doesn't really "free" anything.
>>>> 
>>> 
>>> Hmmmm, “prepare” with “destroy” in its inverse? Do you have any
>> suggestion in mind?
>> 
>> To be honest I was hoping you would make an attempt at finding a suitable
>> pair of verbs. To me "destroy" is more the opposite of "create", and I'm
>> unable to think of a good opposite of "prepare" (short of resorting to
>> "unprepare"); if I really needed to come up with something then it would
>> likely be "cleanup", albeit I'd not be overly happy with that either.
>> 
> 
> Maybe unprepare is better here, I was searching linux code for the help, and
> they are using prepare/unprepare as a pair of verbs a lot in drivers codes.
> 
> For the renaming here, I suggest to fix it with a new commit, since 
> free_staticmem_pages
> has already been merged.

I think that unprepare is ok and it make sense to do this in an independent 
patch.

@jan: can you confirm that you agree with this way to go ?

Cheers
Bertrand


 


Rackspace

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