[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 4/7] xen/arm: Parse xen,shared-mem when host phys address is not provided
- To: Michal Orzel <michal.orzel@xxxxxxx>
- From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
- Date: Thu, 9 May 2024 08:58: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=GB07rgyqgbV5QuSTYi/imjCNAQ3g6YJl1ZO3tXKI8eM=; b=gqwiznNXFuFklCz1vFmSgXdt3K02x8TtnG40oe42woL67kb6xac5uk0ANI14QsZSvljWlagzxvyEWy3qKpewhzEmbPCxqHfgGtHpmpzMDDrVfg8YlzzQMxVl+BKzSMMI1tB7JvX4BuDmQlICz1AZMC9T+kq7o2YnwbQNb5TspHTBeD1jVvLX1uy+gUhX/x7c7wvffwd2gZZbviFrhntr6t25QweeEBANPEz6bIaqMKnFyFPIo06pn/sw343F7nbuYDMnI73mFuy8to1DdP0tgQW7CuQvRLqdI//5KJzPhVPZVW/ebr8Cruqw2pFLNls4CgoafKZbwKouT+BLRw2jzw==
- 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=GB07rgyqgbV5QuSTYi/imjCNAQ3g6YJl1ZO3tXKI8eM=; b=NdO7RFQUGy8GswiZyV3KAfDhATat9UntPm7ib1dQ3CIv3TBtFLpPZdiRdsWCWQ9x0pIcnqqlJLjvHu+FRgLohGO5M+Ae3mE9gGV+yQYSX2JyxwlBDZz62diVp4OdiL69Y9a3HtF9Q/P4C50+acctoxe0oHMCZyszrngwIjFs1rx56hDFjpuw7UDyky3PZn2LGxj5wvELwroQ4/M10y3lQqhyKL33HHnvf4LTx9qT91kG2Ja3V88/Fgng/Pz/TfKue5ofeQKe5DR6D1JQ6Bae8emeIYhqxKtUlrz+x8mf5eCeAmb4+BTGFDc581QeS1He47yyKhFjZqWfFDutAVpBkQ==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=LFfsvtQB6lv+VK3l6n8InjlKp+ftF9jLJdEGPoy+eNoJ8J0BrLH3YvWYVoMMOPJNOf3KdLSCjaaVh9tJT56xDh3cqhVsRmKTZWpx16bhEH9ZVLOpZujdWC7JA3gB9QNQ31hJ4a4SsCuWfG+tmxHQjnMEmmW0Lq8TOLQxJIZ6wgCBzp52M468bd2VcjRAumq+/NPQY4rKDxN3Adhp8EILfGBrDMdqhDUsqDE290/JKamWiAa4S6kDUMGSFbVtRwC1/TlA9TDLsE5LrhLnhOyTOz0+q5IQOURbP7PmGoMrITJ6/TmUzglRfpu9bG2tlPZMMYQpFSO7YrlhOK6T0WjEhQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i6sMbQzMVc4q7BXVYFduQOHyQ9b4TvB4mLy/m3nhQvK4uU8ru0onu8JnRvBTvflRee5LtGJ374p6QGwmTdo/fF3+lIVDNpmk+tNqQZpmtUqId0BZrnQB4eflSi2g7gAtq6DMKTqV+gswum9HoYg9DFghs00+rey+Ju+qxhcmJobOehDtdK34keLy5sFeU8gL0QqN9HLcApAKi/64xT2Y37urhJbwK7JU+OlAePoyIBa+adDLzGR16+lmuvfZJWVr8JI10ulJMFwy9h0bFIoJTAI8xeNALTwtMRCn8D0E0UzesUSYmwzCuq7L6izxs76omKjcriK2d7NP7HetEGRdrA==
- 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: Thu, 09 May 2024 08:59: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: AQHalVfmskMuPI2TlEqCln/x5OWH6LGNVmgAgAAV/wCAAUcPgA==
- Thread-topic: [PATCH 4/7] xen/arm: Parse xen,shared-mem when host phys address is not provided
Hi Michal,
>>
>>> + if ( shm_id_match )
>>> {
>>> - if ( strncmp(shm_id, shmem_extra[i].shm_id,
>>> - MAX_SHM_ID_LENGTH) == 0 )
>>> + /*
>>> + * Regions have same shm_id (cases):
>>> + * 1) physical host address is supplied:
>>> + * - OK: paddr is equal and size is equal (same region)
>>> + * - Fail: paddr doesn't match or size doesn't match (there
>>> + * cannot exists two shmem regions with same shm_id)
>>> + * 2) physical host address is NOT supplied:
>>> + * - OK: size is equal (same region)
>>> + * - Fail: size is not equal (same shm_id must identify
>>> only one
>>> + * region, there can't be two different regions
>>> with same
>>> + * shm_id)
>>> + */
>>> + bool start_match = paddr_assigned ? (paddr ==
>>> mem->bank[i].start) :
>>> + true;
>>> +
>>> + if ( start_match && size == mem->bank[i].size )
>>> break;
>>> else
>>> {
>>> - printk("fdt: xen,shm-id %s does not match for all the
>>> nodes using the same region.\n",
>>> + printk("fdt: different shared memory region could not
>>> share the same shm ID %s\n",
>>> shm_id);
>>> return -EINVAL;
>>> }
>>> }
>>> - else if ( strncmp(shm_id, shmem_extra[i].shm_id,
>>> - MAX_SHM_ID_LENGTH) != 0 )
>>> - continue;
>>> else
>>> {
>> There is no need for this else and entire block given that the block within
>> if either calls break or return
>
> There was a MISRA discussion about else at the end of if ... else if ...
> (R15.7) and I don’t remember
> the outcome
Sorry I was misreading the code here, sure I’ll remove the else.
Cheers,
Luca
|