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

RE: [PATCH] xen/arm64: Fix incorrect DIRECTMAP_SIZE calculation


  • To: Michal Orzel <michal.orzel@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Henry Wang <Henry.Wang@xxxxxxx>
  • Date: Tue, 17 Jan 2023 08:22:22 +0000
  • Accept-language: zh-CN, en-US
  • 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=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=GZNfsjqiMrKTyOZAMsDTnFWGOL7CzY82zZphDBIVogw=; b=QgBRVFPXw0LuiUbSRnIsuB4g3DcSIa8rgiwLxEIlyoOkz9CJvoa0M8SPwHYoiJgudKuhAZFsCJWWFmIFs7TA6GgtcVSX3loEV8c6XyFe2icz0lULeQKrAEMlWYLks+uYbfa4ijWupr+9El9opvoeJ/l+1f55ZCeaTaHMzgKjP1cXsvSBIgbiT+aVGjXnFgC0o+1IwTO64R/LCXIWEvYQTldqFJC65c2JJPsp3ru2pKq0WkEp679VpYSYF4UKCsKZQ4npirq2iIOZV+DAPkNkcpHce4y3n780WXzyvT78QUrYnQK3aV4KJ9hY7qoW258kxgYPf1J5dVcLV+Sb7nHRqg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Th1uo7D0OFDEoki4odNQnGHRfruO5fDa1VQN3/BSh/CzO1Nv8rbTiDidqoX3+JS3nQIdRllxEuBIPWFYnM0453rPR+fWGSzlFAageGXcXdbjKC7Ew27mCE5UGcqcMmgJXxWJWsoIll7dLpchNrMAwx28YWJRRfcBv0e7p0iJnTlmPaywZZdBXNQhiXRfxwojPQlO9xQxr01tnyqQpeo2WSyNEhGO3x9Uj4A9cloFgtfv0LHH0igS42nehlXn/PtyzZhz+sPm5lqepTm8wdNDBpWpa1Kh26TDeC4IBUGIvF+AHSDGSPhBSrVszQl/ouvGoOvYOQOl7H+C2oKeqjU7gQ==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Tue, 17 Jan 2023 08:22:44 +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: AQHZKbkuhF2CydVKlkSWMcq+jFNCca6h0FvQgAB02YCAAABNQA==
  • Thread-topic: [PATCH] xen/arm64: Fix incorrect DIRECTMAP_SIZE calculation

Hi Michal,

> -----Original Message-----
> From: Michal Orzel <michal.orzel@xxxxxxx>
> Subject: Re: [PATCH] xen/arm64: Fix incorrect DIRECTMAP_SIZE calculation
> 
> Hi Henry,
> 
> >> -#define DIRECTMAP_SIZE         (SLOT0_ENTRY_SIZE * (265-256))
> >> +#define DIRECTMAP_SIZE         (SLOT0_ENTRY_SIZE * (266 - 256))
> >
> > From the commit message "L0 slots from 256 to 265 (i.e. 10 slots)", I think
> > the actual range is [256, 265] so probably using "(265 - 256 + 1)" here is a
> > bit better? It seems to me that the number 266 looks like a magic number
> > because 266 is not in the range. But this is my personal taste though and I
> > am open to discussion if you or maintainers have other opinions.
>
> I think this is a matter of taste.

Yes indeed, so I wouldn't argue for your explanation...

> I prefer it the way it is because at least it matches
> how x86 defines the DIRECTMAP_SIZE and it also matches the usual way of
> calculating the size
> which is subtracting the start address of that region from the start address 
> of
> the next region
> (e.g. VMAP_VIRT_SIZE calculation on arm32).

...here and you can have my:

Reviewed-by: Henry Wang <Henry.Wang@xxxxxxx>

> 
> >
> > Maybe we can also putting a comment on top of the macro to explain this
> > calculation.
> >
> > I did test this patch on FVP using XTP in both arm32 and arm64 execution
> > mode, and this patch is good, so:
> >
> > Tested-by: Henry Wang <Henry.Wang@xxxxxxx>
> Thanks.

Pleasure.

Kind regards,
Henry

> 
> >
> > Kind regards,
> > Henry
> 
> ~Michal

 


Rackspace

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