On x86, we already use the communication region to pass platform specific information.
On ARM, the version and location of the GIC is such an information. Use the communication region to pass the location of GIC registers. As this is a arm-common information, introduce arm-common/asm/jailhouse_hypercall.h Signed-off-by: Ralf Ramsauer <[email protected]> --- hypervisor/arch/arm-common/control.c | 8 ++++ .../arch/arm-common/asm/jailhouse_hypercall.h | 43 +++++++++++++++++++ include/arch/arm/asm/jailhouse_hypercall.h | 3 ++ include/arch/arm64/asm/jailhouse_hypercall.h | 3 ++ 4 files changed, 57 insertions(+) create mode 100644 include/arch/arm-common/asm/jailhouse_hypercall.h diff --git a/hypervisor/arch/arm-common/control.c b/hypervisor/arch/arm-common/control.c index 9bf7e895..8b247ee1 100644 --- a/hypervisor/arch/arm-common/control.c +++ b/hypervisor/arch/arm-common/control.c @@ -195,6 +195,14 @@ bool arch_handle_phys_irq(struct per_cpu *cpu_data, u32 irqn, int arch_cell_create(struct cell *cell) { + struct jailhouse_comm_region *comm_region = + &cell->comm_page.comm_region; + + comm_region->gic_version = system_config->platform_info.arm.gic_version; + comm_region->gicd_base = system_config->platform_info.arm.gicd_base; + comm_region->gicc_base = system_config->platform_info.arm.gicc_base; + comm_region->gicr_base = system_config->platform_info.arm.gicr_base; + return arm_paging_cell_init(cell); } diff --git a/include/arch/arm-common/asm/jailhouse_hypercall.h b/include/arch/arm-common/asm/jailhouse_hypercall.h new file mode 100644 index 00000000..a4fb1360 --- /dev/null +++ b/include/arch/arm-common/asm/jailhouse_hypercall.h @@ -0,0 +1,43 @@ +/* + * Jailhouse, a Linux-based partitioning hypervisor + * + * Copyright (c) OTH Regensburg, 2018 + * + * Authors: + * Ralf Ramsauer <[email protected]> + * + * This work is licensed under the terms of the GNU GPL, version 2. See + * the COPYING file in the top-level directory. + * + * Alternatively, you can use or redistribute this file under the following + * BSD license: + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#define COMM_REGION_COMMON_PLATFORM_INFO \ + __u8 gic_version; \ + __u64 gicd_base; \ + __u64 gicc_base; \ + __u64 gicr_base; diff --git a/include/arch/arm/asm/jailhouse_hypercall.h b/include/arch/arm/asm/jailhouse_hypercall.h index e4eca625..7b00f873 100644 --- a/include/arch/arm/asm/jailhouse_hypercall.h +++ b/include/arch/arm/asm/jailhouse_hypercall.h @@ -36,6 +36,8 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ +#include "../arm-common/asm/jailhouse_hypercall.h" + #define JAILHOUSE_HVC_CODE 0x4a48 #define JAILHOUSE_CALL_INS ".arch_extension virt\n\t" \ @@ -56,6 +58,7 @@ struct jailhouse_comm_region { COMM_REGION_GENERIC_HEADER; + COMM_REGION_COMMON_PLATFORM_INFO; }; static inline __u32 jailhouse_call(__u32 num) diff --git a/include/arch/arm64/asm/jailhouse_hypercall.h b/include/arch/arm64/asm/jailhouse_hypercall.h index 86ce6716..5994e1a0 100644 --- a/include/arch/arm64/asm/jailhouse_hypercall.h +++ b/include/arch/arm64/asm/jailhouse_hypercall.h @@ -36,6 +36,8 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ +#include "../arm-common/asm/jailhouse_hypercall.h" + #define JAILHOUSE_HVC_CODE 0x4a48 #define JAILHOUSE_CALL_INS "hvc #0x4a48" @@ -54,6 +56,7 @@ struct jailhouse_comm_region { COMM_REGION_GENERIC_HEADER; + COMM_REGION_COMMON_PLATFORM_INFO; }; static inline __u64 jailhouse_call(__u64 num) -- 2.17.0 -- You received this message because you are subscribed to the Google Groups "Jailhouse" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
