[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 13:57: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=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=Qj95v0F4jEBZJBlEeYiyEY3/PdOwE+UuPuzRIxR02Zc=; b=bF3iPwx16wtGib6F0x6KTkt7mW48jvHbNHLLlmPDKOoSqMeHbdFwzM4wAcw6NxhcXOwKKsSabrlAbO1yqI01QsT5oiP/0OpWQGO9evqvGaS2a0Jh2bPrV9jkGlw1XYhe5U4G2Zwj7g8OcMFfFJC5emYs8gMxlDiv48PflZ+AZUIlIWhkhWmEzW9B35FNNU5s1Yot+HRS+vhPwjAGdwDLY91u5MIrUUOCcIGogw35v4557nUQ6GjfumUnRcNkntlRZuUot86Js0ns62SlrJsjytQwpID+D1XBjb4ojeYL89KwWmYnoZZj/MBJvysD+inKzXNld1yaJP0ePGMsa/bMeQ==
  • 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=Qj95v0F4jEBZJBlEeYiyEY3/PdOwE+UuPuzRIxR02Zc=; b=X8lfrAE0ck3Vbtqix2uhsOZN8DbuFMl9D+lP1qetVLIJRdqV0w8OlLyh055ae1uLOzmJjhqAkL1OACC0iTQ8kv+rOciUX5ouNaKWpKHKul3LvxTeiY7LR0eP7y0PIGrw5MwV4jxsSnNJyguroGYd8TFxJTMTk1sOtXWT2ds0GzDYqLl9aV3pilumyye4ABO36ZmysFbb0IgLLhmpBqzQi9Zlh8ylzdt4rcIR+Gh1A1NEFomWJQCYhT1x342CGzNM/GtaBRhf78KpzYhLbi50rwi8PJUMY4Eu139LYCc71TQb4VJzfrjbY9gAkml3V/Qsog5tBdSvSWA7mLC/KJXcrg==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=h0I1I5DPCO5S9fLGKY5Fl08PlnMxuoblxKmr/3iGAgjXgJFENL99asHSnqIXUAZqVRWq6w9khNgzVFswB2p3kniEJ/TGRKjjlDZYPx7AvwW/OSB+wUKhulJg/NQxUcOZ/ANqj5LqQcqsVlu62kSH8/LjvliqBNFupvDW55hPuxneinNhwtcU5AQOoX4SUeiinj4dEa1ju1a6AwOvaFtBIPh0KfBwddOR2VGwPK0EfGhEcDMqad7yZ6geM5aywyJLSbfmyFSrCkQSNN+DK6OtZu07cY48Lvmr1Dng61JAs5vT+DIvd/yDt4ygqO9qmtz9HSD8Qe0523Pdi6VErunefA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Xgf96QGKJCQD+b3sow/to73uTTq4selMrsbLRjnDQ2LgFEU5RH/cniGgrQhEOy+DC4DUNsQAXVixdkMpMaYRBTz+mf49Byq9vctbMtmQcFR4/CxnD5bPG6CAo9ulwjgJXEJIsCG5PtUP0JFR2oiQvVdL1/LdJMPD5BcAst3zSjMeoLhC66X9uzAC1D49MzBqcn1OmBrTKg1daQymnexDIeAHmQK0OECWAaoGxfGKIy621mfgKrzFl6rF4jXOThdP5jdM+81dlvz1JYmiQLIh3etTAZgHBxmeRKHEOw56Hiah9oEuvKV43Lewn4/OaGsfHE7Wt2NQd5t5ilZEFoEZGQ==
  • 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 13:58:05 +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: AQHalVfkdpwTrVVpI0ikGFOyHt7ILLGKSvyAgAGXWoA=
  • Thread-topic: [PATCH 2/7] xen/arm: Wrap shared memory mapping code in one function

Hi Michal,

>> 
>> +static int __init handle_shared_mem_bank(struct domain *d, paddr_t gbase,
>> +                                         bool owner_dom_io,
>> +                                         const char *role_str,
>> +                                         const struct membank *shm_bank)
>> +{
>> +    paddr_t pbase, psize;
>> +    int ret;
>> +
>> +    BUG_ON(!shm_bank);
> not needed
> 
>> +
>> +    pbase = shm_bank->start;
>> +    psize = shm_bank->size;
> please add empty line here

Will do
>> 
>> 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
dt_property_read_string isn’t it?

Cheers,
Luca


 


Rackspace

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