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

Re: [Multiple reverts] [RFC PATCH] build: include/compat: figure out which other compat headers are needed


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • Date: Thu, 12 Jan 2023 11:02:37 +0000
  • Accept-language: en-GB, en-US
  • 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=N7VpTxKlYqQ0aWmh6KpZDMQyKIrC4HjhQ+OZJilveGY=; b=WfI4SC7uUTPB2X8/c+KPGbz3LCO+oZNhDZ75RM/17ncz3yhfRIjCBUOQ8EJeZmhBPFHEumGzlde5Iod0DVc+ODSx6H3hCiqVT4j5sx9kawSBoE6OW4K6QndyQy4IH1uW7jEcJ6lO4nCbbQZifk0uobRBJT5nL80adGkqKxivfnZuuptNqlz54L6byKKXTJMqjMgbmbdwzwsMRNWM09o0VRau+OBrwkcQIr4yCgMCUTwaH6N8Q1ZwC4QibcTbsce7uXMt17hhd7vO6kKLAaxmNEkXXUaZx2y3+8I3P+WD44y4dEDmkRbHRae/wdLnrNUFpd93n7eWnUVA9dLHDQCpTg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LI8H/4MEqXacB/CP5IjC0zkdF6K5S9kSUKKPYjlYMlB/Cigg4+mg9Q0aLDLOZBR6m583Z6UeeQYW3RXzvIPOhRS2FVLirb9NDb7c2MgwE+Or0L1QDKen9z9Lm7csiXEDi+YwgKWf9AF1JnppxP2h88wYHJkj82QN3p2CPkdf7J/L26Wbv4OObXjjoaR8PpsA3Pbexh1050qfhhSbsztQVbPvL5FFirYGPcv1k2n4jcSFnKyf8prjYCpGwrgufBjZpLOgLnvQfji4ZJjAV2eT7mvD9+n2wcDG1r+Ifqv0zSuReomxbkphisFA3lEDOHIGSwNxXD2E4W8sChgyQTT/CQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: George Dunlap <George.Dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 12 Jan 2023 11:02:58 +0000
  • Ironport-data: A9a23:p4bJha7JGU0zq0vwz1APxQxRtPLGchMFZxGqfqrLsTDasY5as4F+v mEdXjvVPPiLNGagKtgnOt6z8RlUvsPdnIdgQVRvqSpgHi5G8cbLO4+Ufxz6V8+wwm8vb2o8t plDNYOQRCwQZiWBzvt4GuG59RGQ7YnRGvynTraBYnoqLeNdYH9JoQp5nOIkiZJfj9G8Agec0 fv/uMSaM1K+s9JOGjt8B5mr9VU+4pwehBtC5gZlPakS5geH/5UoJMl3yZ+ZfiOQrrZ8RoZWd 86bpJml82XQ+QsaC9/Nut4XpWVTH9Y+lSDX4pZnc/DKbipq/0Te4Y5iXBYoUm9Fii3hojxE4 I4lWapc6+seFvakdOw1C3G0GszlVEFM0OevzXOX6aR/w6BaGpdFLjoH4EweZOUlFuhL7W5m2 tIydWw3fiq/iu+yn5S7VrdDlJp9BZy+VG8fkikIITDxK98DGMiGZpqQoNhS0XE3m9xEGuvYa 4wBcz1zYR/cYhpJfFAKFJY5m+TujX76G9FagAvN+exrvC6OkUooiOSF3Nn9I7RmQe18mEqCq 32A1GP+GhwAb/SUyCaf82LqjejK9c/+cNNLTuTpqKEx6LGV7lUCCEEkCWmlmKHnhxK9QNBWO VAW3AN7+MDe82TuFLERRSaQonSJoxodUNp4CPAh5UeGza+8ywSEAmkJSBZRZdpgs9U5LRQxz UOAld7tAT1psZWWRGib+7PSqim9UQAKKUcSaClCShEKi/HzrYd2gh/RQ9JLFK+uksazCTz22 yqNriU1m/MUl8Fj6kmg1VXOgjbpo4eTSAcwv13TRjj8tl8/Y5O5bYu171Sd9exHMIuSUliGu j4DhtSa6+cNS5qKkURhXdkwIV1g3N7dWBW0vLKlN8NJG+iFk5J7Qb1t3Q==
  • Ironport-hdrordr: A9a23:LLJLMqu/1L3+4Jj9ZGaTCINZ7skDRNV00zEX/kB9WHVpm62j5r iTdZsgpHzJYVoqKRMdcLO7Sc+9qBHnhPpICOAqVN/OMGaHhILCFvAE0WKN+UyEJwTOssoY8Z 1PGpIVaeEZdDNB/L/HCIXTKada/PC3tJ6Tv6P/4h5WJm9XV50=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHZJloKRT09WL2lFUW3wxQFePvpLa6ang0A
  • Thread-topic: [Multiple reverts] [RFC PATCH] build: include/compat: figure out which other compat headers are needed

On 12/01/2023 7:46 am, Jan Beulich wrote:
> On 11.01.2023 23:29, Andrew Cooper wrote:
>> For posterity,
>> https://gitlab.com/xen-project/people/andyhhp/xen/-/jobs/3585379553 is
>> the issue in question.
>>
>> In file included from arch/x86/hvm/hvm.c:82:
>> ./include/compat/hvm/hvm_op.h:6:10: fatal error: ../trace.h: No such
>> file or directory
>>     6 | #include "../trace.h"
>>       |          ^~~~~~~~~~~~
>> compilation terminated.
>> make[4]: *** [Rules.mk:246: arch/x86/hvm/hvm.o] Error 1
>> make[3]: *** [Rules.mk:320: arch/x86/hvm] Error 2
>> make[3]: *** Waiting for unfinished jobs....
>>
>>
>> All public headers use "../" relative includes for traversing the
>> public/ hierarchy.  This cannot feasibly change given our "copy this
>> into your project" stance, but it means the compat headers have the same
>> structure under compat/.
>>
>> This include is supposed to be including compat/trace.h but it was
>> actually picking up x86's asm/trace.h, hence the build failure now that
>> I've deleted the file.
>>
>> This demonstrates that trying to be clever with -iquote is a mistake. 
>> Nothing good can possibly come of having the <> and "" include paths
>> being different.  Therefore we must revert all uses of -iquote.
> I'm afraid I can't see the connection between use of -iquote and the bug
> here.

So I had concluded (wrongly) that it was to do with an asymmetry of
include paths, but it's not.  <../$x> would behave the same, even if it
is a bit more obviously wrong.

The actual problem is the use of ./ or ../ because, despite how they
read, they are never relative to the current file.  The contents between
the "" or <> is treated as a string literal and not interpreted by CPP.

So furthermore, the public headers are buggy in their use of ../ because
it is an implicit dependency on -I/path/to/xen/headers/dir/ being
earlier on the include path than other dirs with these fairly generic
and not-xen-prefixed file names.

I still think that include path asymmetry is bad idea and wants
reverting, but I agree it's not the source of this bug.

>> But, that isn't the only bug.
>>
>> The real hvm_op.h legitimately includes the real trace.h, therefore the
>> compat hvm_op.h legitimately includes the compat trace.h too.  But
>> generation of compat trace.h was made asymmetric because of 2c8fabb223.
>>
>> In hindsight, that's a public ABI breakage.  The current configuration
>> of this build of the hypervisor has no legitimate bearing on the headers
>> needing to be installed to /usr/include/xen.
>>
>> Or put another way, it is a breakage to require Xen to have
>> CONFIG_COMPAT+CONFIG_TRACEBUFFER enabled in the build simply to get the
>> public API headers generated properly.
> There are no public API headers which are generated. The compat headers
> are generate solely for Xen's internal purposes (and hence there's also
> no public ABI breakage).

Wow, I really was decaffeinated when working on this...

Yeah, it's not that either.

~Andrew

 


Rackspace

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