* [PATCH v2] libacpi: Don't build x86-only AML for ARM64 mk_dsdt
@ 2016-12-20 19:05 Boris Ostrovsky
2016-12-21 20:30 ` Stefano Stabellini
0 siblings, 1 reply; 2+ messages in thread
From: Boris Ostrovsky @ 2016-12-20 19:05 UTC (permalink / raw)
To: xen-devel, julien.grall; +Cc: wei.liu2, Boris Ostrovsky, ian.jackson, jbeulich
Commit d6ac8e22c7c5 ("acpi/x86: define ACPI IO registers for
PVH guests") broke ARM64 build of mk_dsdt.c due to introduction
of XEN_ACPI_CPU_MAP[_LEN] macros that are needed only for x86
guests.
We could fix the build by dealing specifically with those macros
but since post-MADT code is not executed on ARM64 anyway we can
compile it for x86 only.
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
v2: #ifdef for pci_hotplug_notify() and decision_tree()
that are used by x86-only code.
tools/libacpi/mk_dsdt.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/tools/libacpi/mk_dsdt.c b/tools/libacpi/mk_dsdt.c
index 9421f3f..7bb5aa0 100644
--- a/tools/libacpi/mk_dsdt.c
+++ b/tools/libacpi/mk_dsdt.c
@@ -78,6 +78,7 @@ static void pop_block(void)
printf("}\n");
}
+#ifdef CONFIG_X86
static void pci_hotplug_notify(unsigned int slt)
{
stmt("Notify", "\\_SB.PCI0.S%02X, EVT", slt);
@@ -99,6 +100,7 @@ static void decision_tree(
decision_tree(s, (s+e)/2, var, leaf);
pop_block();
}
+#endif
static struct option options[] = {
{ "maxcpu", 1, 0, 'c' },
@@ -109,10 +111,10 @@ static struct option options[] = {
int main(int argc, char **argv)
{
- unsigned int slot, dev, intx, link, cpu, max_cpus;
+ unsigned int cpu, max_cpus;
dm_version dm_version = QEMU_XEN_TRADITIONAL;
-
#if defined(CONFIG_X86)
+ unsigned int slot, dev, intx, link;
max_cpus = HVM_MAX_VCPUS;
#elif defined(CONFIG_ARM_64)
max_cpus = GUEST_MAX_VCPUS;
@@ -242,7 +244,7 @@ int main(int argc, char **argv)
pop_block();
/**** DSDT DefinitionBlock end ****/
return 0;
-#endif
+#else
/* Operation Region 'PRST': bitmask of online CPUs. */
stmt("OperationRegion", "PRST, SystemIO, %#x, %d",
@@ -524,6 +526,7 @@ int main(int argc, char **argv)
/**** DSDT DefinitionBlock end ****/
return 0;
+#endif
}
/*
--
2.7.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] libacpi: Don't build x86-only AML for ARM64 mk_dsdt
2016-12-20 19:05 [PATCH v2] libacpi: Don't build x86-only AML for ARM64 mk_dsdt Boris Ostrovsky
@ 2016-12-21 20:30 ` Stefano Stabellini
0 siblings, 0 replies; 2+ messages in thread
From: Stefano Stabellini @ 2016-12-21 20:30 UTC (permalink / raw)
To: Boris Ostrovsky; +Cc: ian.jackson, julien.grall, wei.liu2, jbeulich, xen-devel
[-- Attachment #1: Type: TEXT/PLAIN, Size: 2868 bytes --]
On Tue, 20 Dec 2016, Boris Ostrovsky wrote:
> Commit d6ac8e22c7c5 ("acpi/x86: define ACPI IO registers for
> PVH guests") broke ARM64 build of mk_dsdt.c due to introduction
> of XEN_ACPI_CPU_MAP[_LEN] macros that are needed only for x86
> guests.
>
> We could fix the build by dealing specifically with those macros
> but since post-MADT code is not executed on ARM64 anyway we can
> compile it for x86 only.
>
> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Thanks for the patch. I don't see the previous error anymore, but now I
get:
gcc -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing -Wdeclaration-after-statement -DCONFIG_ARM_64 -I/users/stefanos/xen/tools/libacpi/../../tools/include -D__XEN_TOOLS__ -o ../../dist/install/mk_dsdt mk_dsdt.c
mk_dsdt.c: In function ‘main’:
mk_dsdt.c:115:16: error: variable ‘dm_version’ set but not used [-Werror=unused-but-set-variable]
dm_version dm_version = QEMU_XEN_TRADITIONAL;
^
cc1: all warnings being treated as errors
make: *** [../../dist/install/mk_dsdt] Error 1
> v2: #ifdef for pci_hotplug_notify() and decision_tree()
> that are used by x86-only code.
>
>
> tools/libacpi/mk_dsdt.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/tools/libacpi/mk_dsdt.c b/tools/libacpi/mk_dsdt.c
> index 9421f3f..7bb5aa0 100644
> --- a/tools/libacpi/mk_dsdt.c
> +++ b/tools/libacpi/mk_dsdt.c
> @@ -78,6 +78,7 @@ static void pop_block(void)
> printf("}\n");
> }
>
> +#ifdef CONFIG_X86
> static void pci_hotplug_notify(unsigned int slt)
> {
> stmt("Notify", "\\_SB.PCI0.S%02X, EVT", slt);
> @@ -99,6 +100,7 @@ static void decision_tree(
> decision_tree(s, (s+e)/2, var, leaf);
> pop_block();
> }
> +#endif
>
> static struct option options[] = {
> { "maxcpu", 1, 0, 'c' },
> @@ -109,10 +111,10 @@ static struct option options[] = {
>
> int main(int argc, char **argv)
> {
> - unsigned int slot, dev, intx, link, cpu, max_cpus;
> + unsigned int cpu, max_cpus;
> dm_version dm_version = QEMU_XEN_TRADITIONAL;
> -
> #if defined(CONFIG_X86)
> + unsigned int slot, dev, intx, link;
> max_cpus = HVM_MAX_VCPUS;
> #elif defined(CONFIG_ARM_64)
> max_cpus = GUEST_MAX_VCPUS;
> @@ -242,7 +244,7 @@ int main(int argc, char **argv)
> pop_block();
> /**** DSDT DefinitionBlock end ****/
> return 0;
> -#endif
> +#else
>
> /* Operation Region 'PRST': bitmask of online CPUs. */
> stmt("OperationRegion", "PRST, SystemIO, %#x, %d",
> @@ -524,6 +526,7 @@ int main(int argc, char **argv)
> /**** DSDT DefinitionBlock end ****/
>
> return 0;
> +#endif
> }
>
> /*
> --
> 2.7.4
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> https://lists.xen.org/xen-devel
>
[-- Attachment #2: Type: text/plain, Size: 127 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-12-21 20:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-20 19:05 [PATCH v2] libacpi: Don't build x86-only AML for ARM64 mk_dsdt Boris Ostrovsky
2016-12-21 20:30 ` Stefano Stabellini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.