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

Re: [PATCH 2/7] xen/arm: Wrap shared memory mapping code in one function


  • To: Michal Orzel <michal.orzel@xxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Tue, 7 May 2024 14:15:43 +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=arm.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=HDhY/V3mlF24qJu1Y0rzcDgTa62AsaR53Ul8cRp69tg=; b=ag0RZbEMvgMAHiMzWVaStb8VaKtrL81PPIVbtCrWtJeTImdTD/BoKHxAC32fN3PLksOMEUazqY+ErEJX6OtuA5P4L0hqkOBQI4O+S+yWqQzrIJ8SMkZJAFGwIOgPQAEU59EdrtsKEjtrouyPmgKRtdF0bOt+xwQGcN0KmqkI60gfPtg/7kh5U59IXd1nIhTUKO6oYzHcN46nvRZAbuI3A1mFPjEo3vSy2fUsaLwlRN9ZnRlJQhfMHV5U4VUJrhwm/ipzcvUcIjoiZYpATY3sN4cZ12a3JBhCy87nFIpi0qVFEhnTba5L0dkQZjizy468gTGSYYFzG0fS0gOBVQzUzQ==
  • 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=HDhY/V3mlF24qJu1Y0rzcDgTa62AsaR53Ul8cRp69tg=; b=oXn34NpzNg5QVPUnH0P0jLXWHaA4iK6dDgfJLZnJF/3HfnFTcecfXGzjXFA35DkL7eLxVxWHsp88W5Na4sAzLpHqN3hi8AHi6b1MRWtbLokr3FkEZglAO43IKRRTMTJlm8q6mVmjK6MawX/ZQ44ka0SxH+uEVp9g0uTVDSZm2Hzo7VdSZ20AoUVk0DJpHj/edMPg6Nm6SScWFeUXF0ocE1ZZhwnHyCvCb2W214D/0GvlpT6QRNTUtrEMooThrdhMn8eLe5LJKWBKBWQkZbvHPEMQU4UV9Nd8JgdGkDBqAvyC3sAEemS4gRNRbhlpLbbqBL1eM1MDkRnggTwPDDtH8w==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=SF39ZeanH4pz/8iEVER6c/q3QV9tBl9AbFg+OWwReqcpZiD0fQ1+szOHSptjOV3gSpH+hyTYB4uG7FywS5IxcQe78tvL7/syBFM+uJ2jQxXchqrv2LnxZwAuLRe6XV+uT+LkUsbLbPoCCPjV2t2nkI1pxh7BGW7ZtbiDRZzEFH1AVLarvKsZs/ZMmYzhXv1eY1T5QMXFxUrLBwIdaHKICd68ZN1kbmTcOzz+M24aRkTlHEPIRZyx89nkNc7oFiXSSTc9IdM8ufHIY67YfJ05jINa3n3H/ktJLyDLxwO5OpgEROZNBYf3cg7QGlAunk8XWOjuEuPPRrPESCl7fFl0bg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Zg3LTHNgKhoqDReRD7zzTtrEdB6N6CaPtQRMjYUSoIC19v+4xpmIGmNrUlme8G3Yz/Tbrr74gCoqaTOF7+mAhiDY28GIqWOjpYRuRsiV4PeizSFjAspw7/jzWY7NjyjQZ4Hzj1WGigqcw/9N3BsQhGiNn/ppkfiyd1GOsu8OGPQs1JD8oEljpu+BIHEg1OEyZq36HBanvr+M5xvW4rHp2IeyQMRbzTZPPYjcjodbz6o3CtQuyFynj7W/FVM1gFyO+Ivyp63qKR+2SF6uwhxpqC5wqsr2LDLsv79vxXYP7eXlv4KOyHWnZ9FH6yxnMaVnrVQERQ1f5t3kJjkdDA8QFQ==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Tue, 07 May 2024 14:16:06 +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: AQHalVfkdpwTrVVpI0ikGFOyHt7ILLGKSvyAgAGXWoCAAAL7gIAAAgkA
  • Thread-topic: [PATCH 2/7] xen/arm: Wrap shared memory mapping code in one function

Hi Michal,


>>>> 
>>>> int __init process_shm(struct domain *d, struct kernel_info *kinfo,
>>>>                       const struct dt_device_node *node)
>>>> {
>>>> @@ -249,32 +290,10 @@ int __init process_shm(struct domain *d, struct 
>>>> kernel_info *kinfo,
>>>>        if ( dt_property_read_string(shm_node, "role", &role_str) == 0 )
>>>>            owner_dom_io = false;
>>> Looking at owner_dom_io, why don't you move parsing role and setting 
>>> owner_dom_io accordingly to handle_shared_mem_bank()?
>> 
>> I think I wanted to keep all dt_* functions on the same level inside 
>> process_shm, otherwise yes, I could
>> pass down shm_node and do the reading of role_str in handle_shared_mem_bank, 
>> or I could derive
>> owner_dom_io from role_str being passed or not, something like:
>> 
>> role_str = NULL;
>> dt_property_read_string(shm_node, "role", &role_str)
>> 
>> [inside handle_shared_mem_bank]:
>> If ( role_str )
>>    owner_dom_io = false;
>> 
>> And pass only role_str to handle_shared_mem_bank.
>> 
>> Is this comment to reduce the number of parameters passed? I guess it’s not 
>> for where we call
> In this series as well as the previous one you limit the number of arguments 
> passed to quite a few functions.
> So naturally I would expect it to be done here as well. owner_dom_io is used 
> only by handle_shared_mem_bank, so it makes more sense to move parsing to this
> function so that it is self-contained.

Ok I will, just to be on the same page here, you mean having 
dt_property_read_string inside handle_shared_mem_bank?
Or the above example would work for you as well? That one would have role_str 
passed instead of shm_node.

Cheers,
Luca


 


Rackspace

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