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

Re: [RFC PATCH] libacpi: Fix cross building x86 on arm


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Wed, 24 Aug 2022 07:37:14 +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=armh.onmicrosoft.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=iZEq/e83HIzaNoHQR1mdMPPVp79HpUG1fmfaYpDeddY=; b=oAeZBcT+agxhrYMnjJIlcnHELHiK1243AKkF874ZYt5dfxjYdbRtqXjbTzB597QPeruMDlSMKI+S83d8e2+xi7T7cNpABvf2/zrzSlwN8LgslhZe9CFMOK8WFRueobZM6rxWSW5rkujr6LFI/C3ODALFu4Tl2CYrNCya9sMxYEKxD1NAHgrXMe4AxCWAxWIpJtHsqgzqxjO4ldm1c4MJgWSdz4T8KA7DB5bx7v4AwLj31sqKq0nXxpNVSDpVn4zuZIa+KISKwqzPwT0sa07w42580mZBL9vVJV8e1GXTY996d+Gyi0zEC1/fXQvabuDrhwiOFidSNerCYaefjchVXQ==
  • 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=iZEq/e83HIzaNoHQR1mdMPPVp79HpUG1fmfaYpDeddY=; b=XaD3MaPhZdBch/4I9brSHarHWQEzP1mh6RgSFysRbzHus4vQ/Fb6dE9iB6vPsRO1JueLdicVScOcZ8ESR0QWc7YCbWopSu3482RJb4H5FtZI8R+TyjNIwVdNxoHbTJwYXAun3G8gWD3mnM/2yWhrxJ4y+u+Zon123YqCBtqaP57HK/hHznksH5yESBmb21khL6uzsgaA46hhXKnsUzK13JzT0/57G9HaSzRrMMYhURIA3KzfY5uxV2TM6Agnjb6GF+xOnkwjIbUZaBt/M9JzOtIOx9hz6q/oV6wxig409c7nFJhtlhCK6PwBvICboN0q8YwNClvnYMlDQVCGvB0Ljg==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=nO7HzlnSOwAVkgF34gvnQ6ecGv3C09bAQM2FFep6WX5T/vCMDtZpN7nCVWR82iUhv57RPAe6EueEpxR1JdkWKYWcCiKbf4ZrYIq6gavDQJnQ/GgtaxnkVlsiVD7NIYigx6A8x4mVykLaDY+v86L1C3UL1+fkNNZvU/mPRZR1qVg8Grx2ULpOu92GZ1XWBFLT0N/JsxmIushcslXIDFVt3/2bW4KmmvEiN+plKacP9Biolm0zhAnErVuCQrakOhoQqCYidOI/nN32ysURqze+XMsfbAbmaVZ4dYXwa0mQuEtBlxaLuwGMUPBW4+qpoYV2lb+nrXs7WVXXOk5HoVoLdQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Lyq8/iP6WKG2Om8myJXtOsN6KKS3BVLANt0dpq3lM+9fbOxEU0HCyxjWQClC/uq5O+UThVuyCZOL9C1kwCcsv4k5ibLePewUj66xFOBWE/gaied8ybgmuEKR21rRhwNvAfchmrHmJm4ZgaaOXveF9BYQYlDXufPTqkFHvUvQR3Kf/SdnunBFAgf7/xpdBiHPoiEeomqqAZOlr/5L4BEOgxzULeBFbwK911cE2iNAEllfTBhGGAF8BH0KyNBckIDL4240RUPOuFlDEW1uLk1g6rahp4WJzEV+EDoOyrR5KEEtZrtgf32umIub7tKh1o4wVwRASVetmTDY9bhKays6OQ==
  • 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@xxxxxxx" <julien@xxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 24 Aug 2022 07:37:42 +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: AQHYttqU3r7Sk/IKHkKroerrTRS8F628a1KAgAARJACAABAJgIAAAokAgAAaagCAAQF/gA==
  • Thread-topic: [RFC PATCH] libacpi: Fix cross building x86 on arm

Hi Jan,

> On 23 Aug 2022, at 17:15, Jan Beulich <jbeulich@xxxxxxxx> wrote:
> 
> On 23.08.2022 16:41, Bertrand Marquis wrote:
>> 
>> 
>>> On 23 Aug 2022, at 15:31, Jan Beulich <jbeulich@xxxxxxxx> wrote:
>>> 
>>> On 23.08.2022 15:34, Bertrand Marquis wrote:
>>>>> On 23 Aug 2022, at 13:33, Jan Beulich <jbeulich@xxxxxxxx> wrote:
>>>>> On 23.08.2022 12:24, Bertrand Marquis wrote:
>>>>>> --- a/tools/libacpi/mk_dsdt.c
>>>>>> +++ b/tools/libacpi/mk_dsdt.c
>>>>>> @@ -18,6 +18,16 @@
>>>>>> #include <stdlib.h>
>>>>>> #include <stdbool.h>
>>>>>> #if defined(CONFIG_X86)
>>>>>> +/*
>>>>>> + * When building on non x86 host, arch-x86/xen.h will include xen.h 
>>>>>> which will
>>>>>> + * try to include the arch xen.h (for example if built on arm, 
>>>>>> x86/xen.h will
>>>>>> + * include xen.h which will include arch-arm.h).
>>>>>> + * To prevent this effect, define x86 to have the proper sub arch 
>>>>>> included when
>>>>>> + * the compiler does not define it.
>>>>>> + */
>>>>>> +#if !(defined(__i386__) || defined(__x86_64__))
>>>>>> +#define __x86_64__
>>>>>> +#endif
>>>>> 
>>>>> Besides being confusing this depends on the order of checks in xen.h.
>>>>> 
>>>>>> #include <xen/arch-x86/xen.h>
>>>>>> #include <xen/hvm/hvm_info_table.h>
>>>>>> #elif defined(CONFIG_ARM_64)
>>>>> 
>>>>> At the very least you will want to #undef the auxiliary define as soon
>>>>> as practically possible.
>>>> 
>>>> Ack
>>>> 
>>>>> 
>>>>> But I think a different solution will want finding. Did you check what
>>>>> the #include is needed for, really? I've glanced through the file
>>>>> without being able to spot anything ... After all this is a build tool,
>>>>> which generally can't correctly use many of the things declared in the
>>>>> header.
>>>> 
>>>> As stated in the comment after the commit message, this is not a good
>>>> solution but an hack.
>>>> 
>>>> Now I do not completely agree here, the tool is not really the problem
>>>> but the headers are.
>>> 
>>> Well - the issue is the tool depending on these headers.
>> 
>> Yes but the tool itself cannot solve the issue, we need to have the values
>> in properly accessible headers.
>> 
>>> 
>>>> There is not such an issue on arm.
>>> 
>>> Then why does the tool include xen/arch-arm.h for Arm64?
>> 
>> Because this header defines the values required and as no such thing as 
>> include xen.h.
>> The point is on arm, the arch-arm.h header does not depend on per cpu 
>> defines.
> 
> At first I was surprised you get away there without including xen.h -
> this may change at any time, as soon as you grow a dependency.
> 
> But then the inclusion by arch-x86/xen.h looks suspicious, since xen.h
> itself includes arch-x86/xen.h (first thing), so unless I'm missing
> something arch-x86/xen.h can't really have a dependency on xen.h. So
> maybe in the short term you could get away with removing that include
> as a "fix"?

Just removing the include is ending up in errors (I tried that first).
I will dig deeper to check if those are possible to solve but some files
including arch-x86/xen.h should actually including xen.h instead and
I think the amount of changes might get a bit bigger.
I will give it a try.

Bertrand

> 
> Jan




 


Rackspace

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