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

Re: [PATCH v3 3/5] xen/ppc: Define minimal stub headers required for full build


  • To: Shawn Anastasio <sanastasio@xxxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 11 Sep 2023 08:26:25 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=rXoyWX9grCWk3DjTs5rM9ZydvgRbpa+79b36HefABhU=; b=C+pqqLLY7Un8AoQdvUMfLwl7U8CXYEZ/gGHDbdcEfB9OIzCZqSng9s+Dc3lHmMThX+uuFEaDb0Thof8/2t0khHjIKJBmPiG+ye8Dk4VQIY3aFAwVPQVmrlX3H4ZxiuNkGklfNPn/K4vrIoyy1BWrt0jug3MUaqyL6F+3AM0QIk8atJg31bbcqdUeVb6NwAJ8Ky+rLU/d5fH1PbpqHs7KPHroLJbzXL0vhDI2Fh4d9FxBpmiPOoAs4b3KoHACdYzTx1wzYjnitrmvW03glcayfe5ESz46aQYihwpJK2gfufwB8MchRXTg/k+VOLEsawCWQatahvuoWoforEofiY4Arg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G+PgZIwTkgYFPPdVppha1PQdpBEga+ppZBOg0mrrQaFOhnVGJHRat+TO7yDIYsUN4oIt+yh4F0Fso9u5AEjxgep+5wVVnNYwXVv5yNOt3GQNDo5/URM4ci7yY7skHewdpwHajm5i2YSKJF+2vgvZYISvRH1jXvf6LeDTZmBaZO0HsJrTM4WTRiuC0vun38TZ2D2mzHLs1aBJN1PPeE69FAx5THkLD7rnBEv0znE0z5t1INEGiVnwe94Ft1wcn9/pZKRI4Q5yJZhV2VvEmWQ8W6TJEocMk7p7Pz+PLHkLP5DCmLR4h3NG/X2k1M+MoI7YlweHQ4Qd0XjTIEd2YRe3UA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Timothy Pearson <tpearson@xxxxxxxxxxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 11 Sep 2023 06:27:05 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 09.09.2023 00:05, Shawn Anastasio wrote:
> On 9/5/23 10:52 AM, Jan Beulich wrote:
>> On 01.09.2023 20:25, Shawn Anastasio wrote:
>>> @@ -13,6 +28,237 @@
>>>  #define __pa(x)             (virt_to_maddr(x))
>>>  #define __va(x)             (maddr_to_virt(x))
>>>
>>> -void setup_initial_pagetables(void);
>>> +/* Convert between Xen-heap virtual addresses and machine frame numbers. */
>>> +#define __virt_to_mfn(va) (virt_to_maddr(va) >> PAGE_SHIFT)
>>> +#define __mfn_to_virt(mfn) (maddr_to_virt((paddr_t)(mfn) << PAGE_SHIFT))
>>> +
>>> +/* Convert between Xen-heap virtual addresses and page-info structures. */
>>> +static inline struct page_info *virt_to_page(const void *v)
>>> +{
>>> +    BUG_ON("unimplemented");
>>> +    return NULL;
>>> +}
>>> +
>>> +/*
>>> + * We define non-underscored wrappers for above conversion functions.
>>> + * These are overriden in various source files while underscored version
>>> + * remain intact.
>>> + */
>>> +#define virt_to_mfn(va)     __virt_to_mfn(va)
>>> +#define mfn_to_virt(mfn)    __mfn_to_virt(mfn)
>>
>> Is the comment really applicable? The only non-arch-specific file still
>> doing so is xenoprof.c, and I'm not sure you mean to support xenoprof
>> on PPC. PPC-specific files would better be introduced in a type-safe way
>> right from the beginning.
>>
> 
> To be clear, you're suggesting that I define virt_to_mfn and mfn_to_virt
> to operate on the type-safe mfn_t wrapper? When doing this,
> xen/include/xen/domain_page.h:63 fails to build, since it seems to
> assume that these macros do not use the type-safe mfn_t:
> 
>   static inline void *map_domain_page_global(mfn_t mfn)
>   {
>       return mfn_to_virt(mfn_x(mfn));
>   }

Oh, I see. That's a result of (at least) 41c48004d1d8 ("xen/mm: Use
__virt_to_mfn in map_domain_page instead of virt_to_mfn") not going far
enough and f46b6197344f ("xen: Convert page_to_mfn and mfn_to_page to
use typesafe MFN") not properly doing the intended conversion. Let me
(try to) make a patch, once again ...

> If the comment is no longer accurate I can drop it, but there definitely
> seems to be an assumption in the codebase that these macros operate on
> raw unsigned longs rather than mfn_t.

Well, the comment is new (in PPC), so it cannot really be "no longer
accurate". It (sadly) still is accurate in Arm, but I was hoping we
would be able to do better in new ports.

Jan



 


Rackspace

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