[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/6] xen/arm: fix math in add_hwdom_free_regions
- To: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- From: "Orzel, Michal" <michal.orzel@xxxxxxx>
- Date: Mon, 5 May 2025 09:52:59 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=omH6pmtu5g3vZH53Ks/+qvZpK7FmZYOIbCvEAKvwg7I=; b=JPHJLtaougnxv+pC1JcB+CYHJ1fddqXCm8fx1yZ4jRT4aHl7QiYU4UK5ISskU/JHJCIBwpYI+/wlJnUc8DAI329Do5De+Rl8qC2jRk8PNE6hsfkGGZPtjnYzMx1c6fiexN6XFVM8woY3rfUMMdmVQ7aPaecze94y83iblZyEa5ERHehLzppuidUKlWMDAERdVSsD3shMOSfwxRUhM57peYkoBEVakBBzVrVvbsn2HDb8MO8hPwHg0k/fdsyPYIbryOw5UvP5TgFTiLb92dcgk6pMC98bgaMO0XeNfd1SuJEfQ1/UCJcVviwfMFBvK6qkRPRk59/amPTBBPrDMUckzQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=eoXP6z363vO+wCgOaAwFGsT+DFRVgZWgjaWYHhziPBEMkgCmgIY1+2XVJafTgwLMXf3Uv4GJYL2fzRuRAcBlQTpuDW3YW8Ey865PP3k6dlF+2XM6/3AQ2YSI+rN95ZZNcBAi8B/OG1GRG5KLlV53jzFmxKKAhtSTXdqQ82i/NMpQk3nUjOT5FlmNZ4+5a4Ac2JCiIsdxiIlbEtCeK9IrUy35KzmRlPoTkovTRTs9/GccAZAfH5uoUP57Nhnkv3CsimoHbCocAp2Dod2eJ7z2fruQ2QiQVR4mNRf+Y9NYXZKtcWmc2vVtyYqwBOrKaoCBgl1UKDnjWgOlxI5OfpKN6g==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
- Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
- Delivery-date: Mon, 05 May 2025 07:53:07 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 05/05/2025 04:56, Stewart Hildebrand wrote:
> Erroneous logic was duplicated from add_ext_regions() into
> add_hwdom_free_regions(). Frame numbers are converted to addresses, but
> the end address (e) is rounded down to page size alignment. The logic to
> calculate the size assumes e points to the last address, not page,
> effectively leading to the region size being erroneously calculated to
> be 2M smaller than the actual size of the region.
>
> Fix by adding 1 to the frame number before converting back to address.
>
> Fixes: 02975cc38389 ("xen/arm: permit non direct-mapped Dom0 construction")
> Signed-off-by: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
Acked-by: Michal Orzel <michal.orzel@xxxxxxx>
~Michal
|