On 2017-10-28 03:09, Otavio Pontes wrote:
> In order to access the PCI express extended configuration space, a linux
> inmate needs to have access to the PCI mmconfig base address. As inmates
> doesn't have access to this information using ACPI, we need to export it
> using the cell comm_region.
>
> Note that the updates in Linux kernel used as inmate are also necessary
> in order to use the exported value as the PCI mmconfig base address.
>
> Signed-off-by: Otavio Pontes <[email protected]>
> ---
> hypervisor/arch/x86/control.c | 2 ++
> hypervisor/arch/x86/include/asm/jailhouse_hypercall.h | 1 +
> inmates/tools/x86/linux-loader.c | 2 ++
> tools/jailhouse-cell-linux | 2 +-
> 4 files changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/hypervisor/arch/x86/control.c b/hypervisor/arch/x86/control.c
> index a33b007..7fe701a 100644
> --- a/hypervisor/arch/x86/control.c
> +++ b/hypervisor/arch/x86/control.c
> @@ -53,6 +53,8 @@ int arch_cell_create(struct cell *cell)
>
> cell->comm_page.comm_region.pm_timer_address =
> system_config->platform_info.x86.pm_timer_address;
> + cell->comm_page.comm_region.pci_mmconfig_base =
> + system_config->platform_info.pci_mmconfig_base;
> cell->comm_page.comm_region.num_cpus = 0;
> for_each_cpu(cpu, cell->cpu_set)
> cell->comm_page.comm_region.num_cpus++;
> diff --git a/hypervisor/arch/x86/include/asm/jailhouse_hypercall.h
> b/hypervisor/arch/x86/include/asm/jailhouse_hypercall.h
> index ee97732..153fcd8 100644
> --- a/hypervisor/arch/x86/include/asm/jailhouse_hypercall.h
> +++ b/hypervisor/arch/x86/include/asm/jailhouse_hypercall.h
> @@ -101,6 +101,7 @@ struct jailhouse_comm_region {
>
> /** I/O port address of the PM timer (x86-specific). */
> __u16 pm_timer_address;
> + __u64 pci_mmconfig_base;
Doc is missing, and I would suggest to move this up, for better alignment.
> /** Number of CPUs available to the cell (x86-specific). */
> __u16 num_cpus;
> };
> diff --git a/inmates/tools/x86/linux-loader.c
> b/inmates/tools/x86/linux-loader.c
> index d4a9de7..78bb9c7 100644
> --- a/inmates/tools/x86/linux-loader.c
> +++ b/inmates/tools/x86/linux-loader.c
> @@ -27,6 +27,7 @@ struct setup_data {
> u64 next;
> u32 type;
> u32 length;
> + u64 pci_mmconfig_base;
> u16 pm_timer_address;
> u16 num_cpus;
> u8 cpu_ids[SMP_MAX_CPUS];
> @@ -45,6 +46,7 @@ void inmate_main(void)
>
> setup_data = (struct setup_data *)boot_params->setup_data;
> setup_data->pm_timer_address = comm_region->pm_timer_address;
> + setup_data->pci_mmconfig_base = comm_region->pci_mmconfig_base;
> setup_data->num_cpus = comm_region->num_cpus;
>
> smp_wait_for_all_cpus();
> diff --git a/tools/jailhouse-cell-linux b/tools/jailhouse-cell-linux
> index f453805..c49e57b 100755
> --- a/tools/jailhouse-cell-linux
> +++ b/tools/jailhouse-cell-linux
> @@ -690,7 +690,7 @@ class JailhouseCell:
>
> def x86_gen_setup_data():
> MAX_CPUS = 255
> - return struct.pack('8x4sI4x', b'JLHS', 4 + MAX_CPUS) +
> bytearray(MAX_CPUS)
> + return struct.pack('8x4sI12x', b'JLHS', 12 + MAX_CPUS) +
> bytearray(MAX_CPUS)
>
>
> # pretend to be part of the jailhouse tool
>
Looks good otherwise and makes sense to add.
Jan
--
Siemens AG, Corporate Technology, CT RDA ITP SES-DE
Corporate Competence Center Embedded Linux
--
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.