From: Julien Grall <julien.grall@linaro.org>
To: parth.dixit@linaro.org, xen-devel@lists.xen.org
Cc: ian.campbell@citrix.com, Naresh Bhat <naresh.bhat@linaro.org>,
tim@xen.org, stefano.stabellini@citrix.com, jbeulich@suse.com,
christoffer.dall@linaro.org
Subject: Re: [PATCH RFC 02/35] xen: arm64: ACPI: Support common ACPI drivers
Date: Wed, 04 Feb 2015 17:36:40 +0000 [thread overview]
Message-ID: <54D258A8.4090808@linaro.org> (raw)
In-Reply-To: <1423058539-26403-3-git-send-email-parth.dixit@linaro.org>
Hi Parth,
On 04/02/2015 14:01, parth.dixit@linaro.org wrote:
> From: Naresh Bhat <naresh.bhat@linaro.org>
>
> xen hypervisor will use ACPI for initialisation in the same manner that
> current x86/x86_64 ones do. Add the calls to initialise the ACPI tables
> and load devices using the xen/drivers/acpi subsytem.
All changes in this patch are mostly unrelated, and most of them
requires an explanation why we need to it.
I would split this patch in small chunk.
See below for others comment.
> Signed-off-by: Naresh Bhat <naresh.bhat@linaro.org>
> ---
> xen/common/sysctl.c | 2 +
> xen/drivers/acpi/osl.c | 6 ++
> xen/drivers/acpi/utilities/utglobal.c | 1 +
> xen/include/asm-arm/acpi.h | 106 ++++++++++++++++++++++++++++++++++
> xen/include/asm-arm/arm64/page.h | 2 +
> 5 files changed, 117 insertions(+)
> create mode 100644 xen/include/asm-arm/acpi.h
>
> diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
> index 0cb6ee1..a700a16 100644
> --- a/xen/common/sysctl.c
> +++ b/xen/common/sysctl.c
> @@ -170,6 +170,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
> op->u.availheap.avail_bytes <<= PAGE_SHIFT;
> break;
>
> +#ifdef CONFIG_X86
> #ifdef HAS_ACPI
#if defined(CONFIG_X86) && defined(HAS_ACPI) ?
Also, this change seems to be related to the patch #1.
I would make sense to create a separate patch which will disable the
compilation of pmstate and adding this #ifdef.
> case XEN_SYSCTL_get_pmstat:
> ret = do_get_pm_info(&op->u.get_pmstat);
> @@ -181,6 +182,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
> copyback = 1;
> break;
> #endif
> +#endif
>
> case XEN_SYSCTL_page_offline_op:
> {
> diff --git a/xen/drivers/acpi/osl.c b/xen/drivers/acpi/osl.c
> index 93c983c..73da9d9 100644
> --- a/xen/drivers/acpi/osl.c
> +++ b/xen/drivers/acpi/osl.c
> @@ -96,7 +96,11 @@ acpi_os_map_memory(acpi_physical_address phys, acpi_size size)
> return __va(phys);
> return __vmap(&pfn, PFN_UP(offs + size), 1, 1, PAGE_HYPERVISOR_NOCACHE) + offs;
> }
> +#ifdef CONFIG_X86
> return __acpi_map_table(phys, size);
> +#else
> + return __va(phys);
I remembered to have a discussion about this change with Naresh few
month ago.
__va should only be used when the memory is direct-mapped to Xen (i.e
accessible directly). On ARM64, this only the case for the RAM. Can you
confirm that ACPI will always reside to the RAM?
Futhermore, the code of this function seems x86-specific. The low 1MB
may not be mapped on ARM64.
I would move the whole function (acpi_os_map_memory) per-architecture.
> +#endif
> }
> void acpi_os_unmap_memory(void __iomem * virt, acpi_size size)
> @@ -105,6 +109,7 @@ void acpi_os_unmap_memory(void __iomem * virt, acpi_size size)
> vunmap((void *)((unsigned long)virt & PAGE_MASK));
> }
>
> +#ifdef CONFIG_X86
> acpi_status acpi_os_read_port(acpi_io_address port, u32 * value, u32 width)
> {
> u32 dummy;
> @@ -140,6 +145,7 @@ acpi_status acpi_os_write_port(acpi_io_address port, u32 value, u32 width)
>
> return AE_OK;
> }
> +#endif
Why only x86? Linux seems to define it also for ARM64.
> acpi_status
> acpi_os_read_memory(acpi_physical_address phys_addr, u32 * value, u32 width)
> diff --git a/xen/drivers/acpi/utilities/utglobal.c b/xen/drivers/acpi/utilities/utglobal.c
> index 7dbc964..65c918e 100644
> --- a/xen/drivers/acpi/utilities/utglobal.c
> +++ b/xen/drivers/acpi/utilities/utglobal.c
> @@ -43,6 +43,7 @@
>
> #define DEFINE_ACPI_GLOBALS
>
> +#include <asm/system.h>
Why it's necessary?
> #include <xen/config.h>
> #include <xen/init.h>
> #include <xen/lib.h>
> diff --git a/xen/include/asm-arm/acpi.h b/xen/include/asm-arm/acpi.h
> new file mode 100644
> index 0000000..f6284b5
> --- /dev/null
> +++ b/xen/include/asm-arm/acpi.h
> @@ -0,0 +1,106 @@
> +/*
> + * Copyright (C) 2014, Naresh Bhat <naresh.bhat@linaro.org>
> + *
> + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
> + *
> + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> + */
> +
> +#ifndef _ASM_ARM64_ACPI_H
> +#define _ASM_ARM64_ACPI_H
> +
> +#include <xen/init.h>
> +
> +#define COMPILER_DEPENDENT_INT64 long long
> +#define COMPILER_DEPENDENT_UINT64 unsigned long long
> +
> +#define MAX_LOCAL_APIC 256
> +#define MAX_IO_APICS 64
> +
> +/*
> + * Calling conventions:
> + *
> + * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads)
> + * ACPI_EXTERNAL_XFACE - External ACPI interfaces
> + * ACPI_INTERNAL_XFACE - Internal ACPI interfaces
> + * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces
> + */
> +#define ACPI_SYSTEM_XFACE
> +#define ACPI_EXTERNAL_XFACE
> +#define ACPI_INTERNAL_XFACE
> +#define ACPI_INTERNAL_VAR_XFACE
> +
> +/* Asm macros */
> +#define ACPI_ASM_MACROS
> +#define BREAKPOINT3
It's never used on common code.
> +#define ACPI_DISABLE_IRQS() local_irq_disable()
> +#define ACPI_ENABLE_IRQS() local_irq_enable()
> +#define ACPI_FLUSH_CPU_CACHE() flush_cache_all()
> +
> +/* Blob handling macros */
> +#define ACPI_BLOB_HEADER_SIZE 8
> +
> +/* Basic configuration for ACPI */
> +#ifdef CONFIG_ACPI
> +extern int acpi_disabled;
> +extern int acpi_noirq;
> +extern int acpi_pci_disabled;
> +extern int acpi_strict;
I think it would be better to define common external variable in a
common headers. Although I'm an ACPI maintainers...
> +/* map logic cpu id to physical APIC id
> + * APIC = GIC cpu interface on ARM
> + */
> +extern volatile int arm_cpu_to_apicid[NR_CPUS];
> +extern int boot_cpu_apic_id;
> +#define cpu_physical_id(cpu) arm_cpu_to_apicid[cpu]
> +
> +struct acpi_arm_root {
> + paddr_t phys_address;
> + unsigned long size;
> +};
Can you document this structure?
> +extern struct acpi_arm_root acpi_arm_rsdp_info;
This external variable is defined but seem to never be used in the whole
series.
> +void arm_acpi_reserve_memory(void);
> +
> +/* Low-level suspend routine. */
> +extern int (*acpi_suspend_lowlevel)(void);
> +
> +extern void prefill_possible_map(void);
Those 3 functions are never implemented neither used.
> +#define acpi_wakeup_address (0)
This macro is never used.
> +static inline void disable_acpi(void)
> +{
> + acpi_disabled = 1;
> + acpi_pci_disabled = 1;
> + acpi_noirq = 1;
> +}
> +static inline void acpi_noirq_set(void) { acpi_noirq = 1; }
> +static inline void acpi_disable_pci(void)
> +{
> + acpi_pci_disabled = 1;
> + acpi_noirq_set();
> +}
Ditto for acpi_noirq_set and acpi_disable_pci
> +#else /* !CONFIG_ACPI */
> +#define acpi_disabled 1 /* ACPI sometimes enabled on ARM */
> +#define acpi_noirq 1 /* ACPI sometimes enabled on ARM */
> +#define acpi_pci_disabled 1 /* ACPI PCI sometimes enabled on ARM */
> +#define acpi_strict 1 /* no ACPI spec workarounds on ARM */
The comments are unclear to me here.
> +#endif
> +
> +#endif /*_ASM_ARM_ACPI_H*/
> diff --git a/xen/include/asm-arm/arm64/page.h b/xen/include/asm-arm/arm64/page.h
> index 1fd416d..13b0ea1 100644
> --- a/xen/include/asm-arm/arm64/page.h
> +++ b/xen/include/asm-arm/arm64/page.h
> @@ -1,6 +1,8 @@
> #ifndef __ARM_ARM64_PAGE_H__
> #define __ARM_ARM64_PAGE_H__
>
> +#include <asm-arm/system.h>
> +
Why?
Regards,
--
Julien Grall
next prev parent reply other threads:[~2015-02-04 17:36 UTC|newest]
Thread overview: 166+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-04 14:01 [PATCH RFC 00/35] Add ACPI support for arm64 on Xen parth.dixit
2015-02-04 14:01 ` [PATCH RFC 01/35] xen: acpi: Build numa and pmstate x86 only parth.dixit
2015-02-04 17:03 ` Julien Grall
2015-02-04 14:01 ` [PATCH RFC 02/35] xen: arm64: ACPI: Support common ACPI drivers parth.dixit
2015-02-04 17:34 ` Stefano Stabellini
2015-02-04 17:36 ` Julien Grall [this message]
2015-02-05 11:04 ` Ian Campbell
2015-02-05 11:35 ` Jan Beulich
2015-02-05 11:57 ` Ian Campbell
2015-02-05 12:01 ` Jan Beulich
2015-02-05 14:05 ` Julien Grall
2015-02-05 11:34 ` Jan Beulich
2015-02-05 11:56 ` Ian Campbell
2015-02-04 14:01 ` [PATCH RFC 03/35] xen: arm64: ACPI: Add basic ACPI initialization parth.dixit
2015-02-04 17:40 ` Stefano Stabellini
2015-02-04 21:00 ` Julien Grall
2015-02-04 14:01 ` [PATCH RFC 04/35] ACPI / ACPICA: Introduce ARM Boot Architecture Flags in FADT parth.dixit
2015-02-04 17:42 ` Stefano Stabellini
2015-02-04 21:03 ` Julien Grall
2015-02-05 11:06 ` Ian Campbell
2015-02-05 14:09 ` Julien Grall
2015-02-05 14:10 ` Julien Grall
2015-02-04 14:01 ` [PATCH RFC 05/35] ARM64 / ACPI: Parse FADT table to get PSCI flags parth.dixit
2015-02-04 17:45 ` Stefano Stabellini
2015-02-05 3:56 ` Hanjun Guo
2015-02-05 11:09 ` Ian Campbell
2015-02-04 21:14 ` Julien Grall
2015-02-04 14:01 ` [PATCH RFC 06/35] ACPI: Add Generic Interrupt and Distributor struct parth.dixit
2015-02-04 17:52 ` Stefano Stabellini
2015-02-04 21:16 ` Julien Grall
2015-02-04 14:01 ` [PATCH RFC 07/35] ACPI / ACPICA: Add new features for MADT which introduced by ACPI 5.1 parth.dixit
2015-02-04 17:52 ` Stefano Stabellini
2015-02-08 14:27 ` Tomasz Nowicki
2015-02-04 14:01 ` [PATCH RFC 08/35] ACPI / table: Print GIC information when MADT is parsed parth.dixit
2015-02-04 14:01 ` [PATCH RFC 09/35] Add cpumask_next_zero set_cpu_present and possible parth.dixit
2015-02-04 18:47 ` Stefano Stabellini
2015-02-05 11:47 ` Jan Beulich
2015-02-04 21:28 ` Julien Grall
2015-02-04 14:01 ` [PATCH RFC 10/35] asm / arm: Introduce cputype.h parth.dixit
2015-02-04 18:56 ` Stefano Stabellini
2015-02-04 21:33 ` Julien Grall
2015-02-04 14:01 ` [PATCH RFC 11/35] ARM64 / ACPI: Parse MADT to map logical cpu to MPIDR and get cpu_possible/present_map parth.dixit
2015-02-04 21:44 ` Julien Grall
2015-02-04 14:01 ` [PATCH RFC 12/35] ARM64: Initialization of cpu_logical_map(0) parth.dixit
2015-02-04 21:45 ` Julien Grall
2015-02-05 10:26 ` Stefano Stabellini
2015-02-11 5:09 ` Julien Grall
2015-02-04 14:01 ` [PATCH RFC 13/35] ACPI: Introduce acpi_parse_entries parth.dixit
2015-02-05 10:29 ` Stefano Stabellini
2015-02-11 5:26 ` Julien Grall
2015-02-04 14:01 ` [PATCH RFC 14/35] ACPI / ACPICA: Add GTDT support updated by ACPI 5.1 parth.dixit
2015-02-05 13:22 ` Stefano Stabellini
2015-02-04 14:01 ` [PATCH RFC 15/35] ARM64 / ACPI: Define ACPI_IRQ_MODEL_GIC needed for arm parth.dixit
2015-02-05 14:39 ` Stefano Stabellini
2015-02-04 14:02 ` [PATCH RFC 16/35] ARM64 / ACPI: Parse GTDT to initialize timer parth.dixit
2015-02-04 21:51 ` Julien Grall
2015-02-05 11:39 ` Ian Campbell
2015-02-05 14:26 ` Julien Grall
2015-02-05 14:51 ` Stefano Stabellini
2015-02-05 14:55 ` Ian Campbell
2015-02-05 14:46 ` Stefano Stabellini
2015-02-04 14:02 ` [PATCH RFC 17/35] pl011: Initialize serial from ACPI SPCR table parth.dixit
2015-02-04 21:57 ` Julien Grall
2015-02-05 11:42 ` Ian Campbell
2015-02-05 14:29 ` Julien Grall
2015-02-05 14:52 ` Ian Campbell
2015-02-11 6:10 ` Julien Grall
2015-02-05 15:27 ` Stefano Stabellini
2015-02-05 15:32 ` Ian Campbell
2015-02-04 14:02 ` [PATCH RFC 18/35] arm : add helper function for setting interrupt type parth.dixit
2015-02-04 21:59 ` Julien Grall
2015-02-05 15:33 ` Stefano Stabellini
2015-02-11 6:12 ` Julien Grall
2015-02-04 14:02 ` [PATCH RFC 19/35] ACPI / GICv2: Add GIC specific ACPI boot support parth.dixit
2015-02-04 14:43 ` G Gregory
2015-02-05 6:26 ` Parth Dixit
2015-02-05 3:41 ` Julien Grall
2015-02-05 15:54 ` Stefano Stabellini
2015-02-04 14:02 ` [PATCH RFC 20/35] xen/arm: Prepare a min DT for DOM0 parth.dixit
2015-02-05 3:48 ` Julien Grall
2015-02-05 15:58 ` Stefano Stabellini
2015-02-04 14:02 ` [PATCH RFC 21/35] xen/arm: Create memory node " parth.dixit
2015-02-05 3:51 ` Julien Grall
2015-02-05 16:01 ` Stefano Stabellini
2015-02-11 6:27 ` Julien Grall
2015-02-04 14:02 ` [PATCH RFC 22/35] xen/arm: Create chosen " parth.dixit
2015-02-05 16:09 ` Stefano Stabellini
2015-02-06 0:29 ` Julien Grall
2015-02-06 14:09 ` Stefano Stabellini
2015-02-04 14:02 ` [PATCH RFC 23/35] arm: acpi add status override table parth.dixit
2015-02-05 16:14 ` Stefano Stabellini
2015-02-04 14:02 ` [PATCH RFC 24/35] arm : acpi add xen environment table parth.dixit
2015-02-05 16:16 ` Stefano Stabellini
2015-02-04 14:02 ` [PATCH RFC 25/35] arm: acpi add helper functions to map memory regions parth.dixit
2015-02-05 4:03 ` Julien Grall
2015-02-05 16:21 ` Stefano Stabellini
2015-02-06 0:35 ` Julien Grall
2015-02-06 14:12 ` Stefano Stabellini
2015-02-11 6:49 ` Julien Grall
2015-02-04 14:02 ` [PATCH RFC 26/35] arm : acpi read mmio tables from uefi parth.dixit
2015-02-05 4:17 ` Julien Grall
2015-02-05 16:34 ` Stefano Stabellini
2015-02-06 0:38 ` Julien Grall
2015-02-06 14:17 ` Stefano Stabellini
2015-02-11 9:14 ` Julien Grall
2015-02-04 14:02 ` [PATCH RFC 27/35] arm: acpi map mmio regions to dom0 parth.dixit
2015-02-05 16:49 ` Stefano Stabellini
2015-02-05 19:40 ` Parth Dixit
2015-02-06 0:44 ` Julien Grall
2015-02-06 14:21 ` Stefano Stabellini
2015-02-11 9:26 ` Julien Grall
2015-02-04 14:02 ` [PATCH RFC 28/35] arm: acpi map acpi tables in dom0 parth.dixit
2015-02-05 4:29 ` Julien Grall
2015-02-05 16:55 ` Stefano Stabellini
2015-02-05 19:38 ` Parth Dixit
2015-02-06 14:23 ` Stefano Stabellini
2015-02-04 14:02 ` [PATCH RFC 29/35] arm : acpi enable PSCI and hvc in acpi FADT table parth.dixit
2015-02-05 4:33 ` Julien Grall
2015-02-05 17:12 ` Stefano Stabellini
2015-02-06 0:47 ` Julien Grall
2015-02-06 15:13 ` Stefano Stabellini
2015-02-04 14:02 ` [PATCH RFC 30/35] arm : acpi map XSDT table to dom0 parth.dixit
2015-02-05 4:46 ` Julien Grall
2015-02-05 17:24 ` Stefano Stabellini
2015-02-04 14:02 ` [PATCH RFC 31/35] arm : acpi map status override " parth.dixit
2015-02-05 5:24 ` Julien Grall
2015-02-05 10:57 ` Parth Dixit
2015-02-05 11:47 ` Ian Campbell
2015-02-11 9:45 ` Julien Grall
2015-02-12 6:50 ` Stefano Stabellini
2015-02-05 14:39 ` Julien Grall
2015-02-05 17:39 ` Stefano Stabellini
2015-02-06 0:54 ` Julien Grall
2015-02-06 14:32 ` Stefano Stabellini
2015-02-05 17:27 ` Stefano Stabellini
2015-02-04 14:02 ` [PATCH RFC 32/35] arm : acpi map xen environment " parth.dixit
2015-02-05 5:29 ` Julien Grall
2015-02-05 10:49 ` Parth Dixit
2015-02-05 17:36 ` Stefano Stabellini
2015-02-06 0:57 ` Julien Grall
2015-02-04 14:02 ` [PATCH RFC 33/35] arm : acpi enable efi for acpi parth.dixit
2015-02-05 5:31 ` Julien Grall
2015-02-05 10:32 ` Parth Dixit
2015-02-05 11:58 ` Jan Beulich
2015-02-05 12:05 ` Ian Campbell
2015-02-11 9:57 ` Julien Grall
2015-02-11 10:31 ` Jan Beulich
2015-02-11 14:34 ` Julien Grall
2015-02-11 9:51 ` Usage of efi_enabled - Was: " Julien Grall
2015-02-11 10:28 ` Jan Beulich
2015-02-11 10:49 ` Ian Campbell
2015-02-11 11:22 ` Jan Beulich
2015-02-12 4:18 ` Ian Campbell
2015-02-04 14:02 ` [PATCH RFC 34/35] arm : acpi workarounds for firmware/linux dependencies parth.dixit
2015-02-05 5:38 ` Julien Grall
2015-02-05 10:30 ` Parth Dixit
2015-02-05 14:59 ` Julien Grall
2015-02-10 9:38 ` Julien Grall
2015-02-10 10:01 ` Jan Beulich
2015-02-10 10:26 ` Julien Grall
2015-02-05 17:48 ` Stefano Stabellini
2015-02-05 19:30 ` Parth Dixit
2015-02-06 14:38 ` Stefano Stabellini
2015-02-06 14:49 ` Jan Beulich
2015-02-04 14:02 ` [PATCH RFC 35/35] xen: arm64: Add ACPI support parth.dixit
2015-02-04 16:38 ` [PATCH RFC 00/35] Add ACPI support for arm64 on Xen Julien Grall
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54D258A8.4090808@linaro.org \
--to=julien.grall@linaro.org \
--cc=christoffer.dall@linaro.org \
--cc=ian.campbell@citrix.com \
--cc=jbeulich@suse.com \
--cc=naresh.bhat@linaro.org \
--cc=parth.dixit@linaro.org \
--cc=stefano.stabellini@citrix.com \
--cc=tim@xen.org \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.