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

Re: [PATCH] stubdom: foreignmemory: Fix build after 0dbb4be739c5

  • To: Julien Grall <julien@xxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Tue, 13 Jul 2021 12:23:51 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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-SenderADCheck; bh=DSATlIsLgU8p+g1i3c0Aw8JPeUufzeiIhCzmr1/3EKA=; b=DTijWqDWw8lwMQ69770Pyx2AdrVTYMVOKJncIi9eEkXjqPSA4Pe2SBajxdio+orzaLY7BCbpYREaG/Rgez9wqzjVBXnQWKj7wHVPvkBSrs30JCKCz27wMXCUYeRvC2YeStJ+USAgz1a5S2rCg/vn5Kb2CxBquUE4FgC0IfS/uw6Upgv2l/5FfOIV98nOGiz2RNhbiKgw0dCG/89fFiBsWywvD8Mj0VYEmWSPTIZr9fHE3UdH8/T/nYbDWYqyC9RGKOQ51gKJtAUsI8j8ZjmSw3x8Cx/yJooAWRk4TtlVrw/JzYnNEutuOYAPp3Rgw67BICqdnF90a0wj+O1vaJdt/g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kLY6YbkB66yugONGi45oE+D04YyXOorY2v3Dn8FVfjCO5zOy8oNOl2xxYfYmb4jYLELFCgq0aj6Q0Nj3+Ry45r57faOgUkOD81QgJj27X9z+KCxz2uWYXEK4g3QsWi1l/C0gwpcDibtq7v38U0bJz2th1IKPAzhtyWdgwMERrGT47sK1PqHM8G+C98+VGcC4J9gfDPw+CngAFbRc8YqkYFK07uhfruI7GyffPhU6qZyuvBozATlwCQhi3rPCByvhxLwRH5TKOaoWs14RyJuGuxmFblj37h0lVBxXfpCie7d34HUOBzv+sRwoDh/TPvkXiznZWWuD275+RHQ39CljXQ==
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Julien Grall <jgrall@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, "Wei Liu" <wl@xxxxxxx>
  • Delivery-date: Tue, 13 Jul 2021 11:24:05 +0000
  • Ironport-hdrordr: A9a23:aKvfMqHqMalRdzjepLqFH5HXdLJyesId70hD6qkvc3Jom52j+P xGws526faVslYssHFJo6HmBEDyewKjyXcT2/hvAV7CZnibhILMFuBfBOTZskbd8kHFh5dgPO JbAtVD4b7LfCtHZKTBkXGF+r8bqbHtms3Y5pa9vgJQpENRGsddBm9Ce3am+yZNNWx77PQCZf 6hD4Z81kCdkSN9VLXLOpBJZZmOm/T70LbdJTIWDR8u7weDyRuu9b7BChCdmjMTSSlGz7sO+X XM11WR3NTsj9iLjjvnk0PD5ZVfn9XsjvNFGcy3k8AQbhHhkByhaohNU6CL+Bo1vOaswlA3l8 SkmWZuA+1Dr1fqOk2lqxrk3AftlBw07WX59FOeiXz/5eTkWTMTEaN69MFkWyqcz3BlkMB30a pN0W7cnYFQFwn8kCP04MWNfw12l3CzvWEpnYco/jxiuLMlGfpsRLEkjQdo+M9qJlO81GlnKp guMCjk3ocVTbvABEqp+FWGqbeXLwYO9hTveDlIhiXa6UkOoJlD9Tpu+CUopAZJyHsMcegx2w 36CNUfqFhvdL5dUUsvPpZNfSOIYla9CC4kdljieWjaKA==
  • Ironport-sdr: qnXolNMXHQHkSXE1eORRu7xn7VWv0E3olUh1F1IWm7HqqpCqI302UVj+gWeYxouXElkAFESVlp ovLDkcO1yT2rKZa50IlWbwbiLXNXWT50ZDqQH/65QantHGc7sNfzFxR9qZf0LGBCAQB764tb6f +ttWAABY3WncuP5d1sk/I1uIv2oS74+OUrPspUW/6L975HaJf4xEsOrzIxcgMXfz6f46DKBI7Z tdsOhP4gSbWjtae6rkyM0zwR466cj5Z1z3ylxEqXhk9IQagKQOifis4xX/ld96u3gcPPq8zRCS j8Q=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 13/07/2021 12:21, Julien Grall wrote:
> Hi Andrew,
> On 13/07/2021 10:35, Andrew Cooper wrote:
>> On 13/07/2021 10:27, Juergen Gross wrote:
>>> On 13.07.21 11:20, Julien Grall wrote:
>>>> From: Julien Grall <jgrall@xxxxxxxxxx>
>>>> Commit 0dbb4be739c5 add the inclusion of xenctrl.h from private.h and
>>>> wreck the build in an interesting way:
>>>> In file included from xen/stubdom/include/xen/domctl.h:39:0,
>>>>                    from xen/tools/include/xenctrl.h:36,
>>>>                    from private.h:4,
>>>>                    from minios.c:29:
>>>> xen/include/public/memory.h:407:5: error: expected
>>>> specifier-qualifier-list before ‘XEN_GUEST_HANDLE_64’
>>>>        XEN_GUEST_HANDLE_64(const_uint8) buffer;
>>>>        ^~~~~~~~~~~~~~~~~~~
>>>> This is happening because xenctrl.h defines __XEN_TOOLS__ and
>>>> therefore
>>>> the public headers will start to expose the non-stable ABI. However,
>>>> xen.h has already been included by a mini-OS header before hand. So
>>>> there is a mismatch in the way the headers are included.
>>>> For now solve it in a very simple (and gross) way by including
>>>> xenctrl.h before the mini-os headers.
>>>> Fixes: 0dbb4be739c5 ("tools/libs/foreignmemory: Fix PAGE_SIZE
>>>> redefinition error")
>>>> Signed-off-by: Julien Grall <jgrall@xxxxxxxxxx>
>>>> ---
>>>> Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
>>>> I couldn't find a better way with would not result to revert the patch
>>>> (and break build on some system) or involve a longer rework of the
>>>> headers.
>>> Just adding a "#define __XEN_TOOLS__" before the #include statements
>>> doesn't work?
>> Not really, no.
>> libxenforeignmem has nothing at all to do with any Xen unstable
>> interfaces.  Including xenctrl.h in the first place was wrong, because
>> it is an unstable library.  By extension, the use of XC_PAGE_SIZE is
>> also wrong.
> Well... Previously we were using PAGE_SIZE which is just plain wrong
> on Arm.
> At the moment, we don't have a way to query the page granularity of
> the hypervisor. But we know it can't change because of the way the
> current ABI was designed. Hence why using XC_PAGE_SIZE is the best of
> option we had until we go to ABIv2.

Still doesn't mean that XC_PAGE_SIZE was ok to use.

Sounds like the constant needs moving into the Xen public headers, and
the inclusions of xenctrl.h into stable libraries needs reverting.




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