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

Re: [PATCH v1] x86/public: move XEN_ACPI_ in a new header


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Thu, 25 Aug 2022 07:58:12 +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=VgxjvsqUBOR+VIg2/5AwJlSAj2MGOyolHuS+MJJofw8=; b=TiC7iW/D/BR0MD+3bQc5YC7LFHKwSWOjo1qYViXWTgmlip4fDudZ1a6jR6U0I21I0Sh6tQK/AdbsDf73LAc1eqgDwB+x0wfDW5w7aVLCtdHxdIRPD89qacKqTTA79zuFzXXgJBzYKMQ8E1pntZsUut8lSQKqRzuvI01c9Hw0wZXkbZRtcZ8x3FFCMSXh+GrRtpREn3253DRgEZQxGjPEkPMAplCEfek10rQGauxnafVs5vYaVu7MPb2caLXz6oabNpKcSRifryXQygYBJH1r6Z0V57a6popmZXXAiCTXWzRmS5hyxQ274PQfX1eSJF7Nzfmo5cyYb4M2iXo/4BwyMw==
  • 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=VgxjvsqUBOR+VIg2/5AwJlSAj2MGOyolHuS+MJJofw8=; b=jr7vsyziG7Qivfahcdu+29fRalWXcof0NjRa0iSNEMq/fHP0qSYaku+5UoviJSsx5pUGccW1Dbpx5GirJcz4VkNofY0IJZRCfrLUhHIJmhGQbQobUlQzIBYyJ9XW54PdfMm/TAXCxLXuCcCt2dgnXJ9DfoEkexS7ac91SkT4XqdkgB6OPiMNwVx+4Xn01+leEL9MIPjj2JICzYwNyjtvVfEWZc3EVHuZm1rL4J+hUy/cXT2s+wNVrI/1niCueQn8uIrda70kvQXDDhb1lI5kMRj28aKPe0VOKz9Is8lO4AuvgKxFurOCXq4HzNpsWrjebJgqCBDrmnptU9iMkBuAgw==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=I+ZaA0hXkJCtuXwz+SY6LP3wdkgkn9eoo7t6qmtR7jG6msSIJyMGgh4coOlaKvHQYFgcVZNJ0LOxRQzK9T52pQR9IbdfkgkpiBHhDSelr5qAdfng+rAZd0FuGWxBJzIOY4PAPrssGR8n7cznTeyizwI1BhMXYkJnRrf59DzzA9wspteSBjg0a7C4iP/Y/rIUEo2vNWVMRflikRxaw/lpwjDnjgUf/IKQ6qNPeUNKOYDq1fWa3gjGsvkpCfP+zHmq9gKEzoKeue7PP9B5q4vWvvBZsSwL0w+UgnTSVoBjAU+TIrXJgeM287LKmS9P9Njt+ebwhcI/5hC7wW1uuyoMaQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TAYqLtisd/NLPus7mrOA60o3f6nHPudhomKoOdmMG8BDQpp6OHRq6tr+QLeATkE3Th99JLmHYUYoSJSicru7pUOjeISH9Kum5ueWwUAcsUW0v0TH9ifMJ4FwWfXuZMHBMJ1iA04r5NZXMyjG1F0guz3jwbOlwVMxzfB8dr1ghpKGAPiI4ACaD4yKOPPdmAXl1oG/by7K5h3DqyMaIkNxKayYE19IuGzL94Fq0dEmeyHG6WPqT8OCZLxrvYJUSCj4jJXuarCzEEiGgXgrC+HV15YmYZb9q0Kre+g4TKDiQ6YPSVM+K5TbTUMPPqy7ONgM4bVf69x6DkmfAPM19Th6kg==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: 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: Thu, 25 Aug 2022 07:58:38 +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: AQHYt85ufd+PwkI5IU+k+Lq2pSqnAK2/PlYAgAAC5QA=
  • Thread-topic: [PATCH v1] x86/public: move XEN_ACPI_ in a new header

Hi Jan,

> On 25 Aug 2022, at 08:47, Jan Beulich <jbeulich@xxxxxxxx> wrote:
> 
> On 24.08.2022 17:29, Bertrand Marquis wrote:
>> When Xen is compiled for x86 on an arm machine, libacpi build is failing
>> due to a wrong include path:
>> - arch-x86/xen.h includes xen.h
>> - xen.h includes arch-arm.h (as __i386__ and __x86_64__ are not defined
>> but arm ones are).
>> 
>> To solve this issue move XEN_ACPI_ definitions in a new header
>> guest-acpi.h that can be included cleanly by mk_dsdt.c
>> 
>> Previous users needing any of the XEN_ACPI_ definitions will now need to
>> include arch-x86/guest-acpi.h instead of arch-x86/xen.h
>> 
>> Fixes: d6ac8e22c7c5 ("acpi/x86: define ACPI IO registers for PVH
>> guests")
> 
> Nit: Please don't wrap this line.

Ok

> 
>> Signed-off-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>
>> ---
>> The x86 header is including ../xen.h before the ifndef/define so that it
>> gets included back by xen.h. This is wrongly making the assumption that
>> we are using an x86 compiler which is not the case when building the
>> tools for x86 on an arm host.
>> Moving the definitions to an independent header is making things cleaner
>> but some might need to include a new header but the risk is low.
>> 
>> For the release manager:
>> - risk: very low, the definitions moved are only used in mk_dsdt and
>> external users would just have to include the new header.
>> - advantage: we can now compile xen for x86 on arm build machines
> 
> You will want to actually Cc him on v2, so he can ack the change (or
> not).

Ack

> 
>> --- /dev/null
>> +++ b/xen/include/public/arch-x86/guest-acpi.h
>> @@ -0,0 +1,50 @@
>> +/******************************************************************************
>> + * arch-x86/xen-acpi.h
> 
> Stale file name.

Right, forgot to change the content after renaming, will fix.

> 
>> + * XEN ACPI interface to x86 Xen.
> 
> Perhaps also here s/XEN/Guest/.

Ok.

> 
>> + * Permission is hereby granted, free of charge, to any person obtaining a 
>> copy
>> + * of this software and associated documentation files (the "Software"), to
>> + * deal in the Software without restriction, including without limitation 
>> the
>> + * rights to use, copy, modify, merge, publish, distribute, sublicense, 
>> and/or
>> + * sell copies of the Software, and to permit persons to whom the Software 
>> is
>> + * furnished to do so, subject to the following conditions:
>> + *
>> + * The above copyright notice and this permission notice shall be included 
>> in
>> + * all copies or substantial portions of the Software.
>> + *
>> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 
>> OR
>> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
>> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
>> THE
>> + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
>> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
>> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
>> + * DEALINGS IN THE SOFTWARE.
>> + *
>> + */
>> +
>> +#ifndef __XEN_PUBLIC_ARCH_X86_XEN_ACPI_H__
>> +#define __XEN_PUBLIC_ARCH_X86_XEN_ACPI_H__
> 
> Please make the guard match the file name.

Yes

> 
>> +#if defined(__XEN__) || defined(__XEN_TOOLS__)
> 
> While separating it out, may I suggest to limit this to just the tool
> stack? There's no use of these #define-s in the hypervisor, and none
> is to be expected. (Of course this will want justifying this way in
> the description.)

Ok

Thanks for the review
Cheers
Bertrand

> 
> Jan
> 
>> +/* Location of online VCPU bitmap. */
>> +#define XEN_ACPI_CPU_MAP             0xaf00
>> +#define XEN_ACPI_CPU_MAP_LEN         ((HVM_MAX_VCPUS + 7) / 8)
>> +
>> +/* GPE0 bit set during CPU hotplug */
>> +#define XEN_ACPI_GPE0_CPUHP_BIT      2
>> +
>> +#endif
>> +
>> +#endif /* __XEN_PUBLIC_ARCH_X86_XEN_ACPI_H__ */




 


Rackspace

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