Hi, thank you for your reply. 
I prefer, if possible, to use petalinux as a baseline to test also other 
mechanisms such as OpenAMP and kernel configurations such as the Linux 
Preempt-RT patch. 
Anyway, you were right, there was a problem in the petalinux build that 
luckily I managed to resolve. Now I'm able to boot the system but when I 
try to enable jailhouse I have the following error:

root@xilinx-zcu104-2019_1:~# jailhouse enable /zynqmp-zcu104-root.cell

Initializing Jailhouse hypervisor v0.12 on CPU 3
Code location: 0x0000ffffc0200800
Page pool usage after early setup: mem 39/994, remap 0/131072
Initializing processors:
 CPU 3... OK
 CPU 1... OK
 CPU 0... OK
 CPU 2... OK
Initializing unit: irqchip
Initializing unit: ARM SMMU v3
Initializing unit: PVU IOMMU
Initializing unit: PCI
Adding virtual PCI device 00:00.0 to cell "ZCU104-root"
/home/user/jailhouse/hypervisor/ivshmem.c:407: returning error -EINVAL
JAILHOUSE_ENABLE: Invalid argument

I used a configuration file for zcu104 that I found in a mailing list 
conversation 
https://groups.google.com/g/jailhouse-dev/c/vMTEE3pYyPg/m/UeeqcdOhBgAJ 
(It is a modified version of the Ultra96 file):
/*
 * Configuration for the ZCU104 root cell. Copied from ultra96.c
 * and changed where necessary.
 */

#include <jailhouse/types.h>
#include <jailhouse/cell-config.h>

struct {
    struct jailhouse_system header;
    __u64 cpus[1];
    struct jailhouse_memory mem_regions[3];
    struct jailhouse_irqchip irqchips[1];
    struct jailhouse_pci_device pci_devices[1];
} __attribute__((packed)) config = {
    .header = {
        .signature = JAILHOUSE_SYSTEM_SIGNATURE,
        .revision = JAILHOUSE_CONFIG_REVISION,
        .flags = JAILHOUSE_SYS_VIRTUAL_DEBUG_CONSOLE,
        .hypervisor_memory = {
            .phys_start = 0x7fc00000,
            .size =       0x00400000,
        },
        .debug_console = {
            .address = 0xff000000,
            .size = 0x1000,
            .type = JAILHOUSE_CON_TYPE_XUARTPS,
            .flags = JAILHOUSE_CON_ACCESS_MMIO |
                 JAILHOUSE_CON_REGDIST_4,
        },
        .platform_info = {
            .pci_mmconfig_base = 0xfc000000,
            .pci_mmconfig_end_bus = 0,
            .pci_is_virtual = 1,
            .arm = {
                .gic_version = 2,
                .gicd_base = 0xf9010000, /*GIC distributor register base*/
                .gicc_base = 0xf902f000, /*GIC cpu interface register base*/
                .gich_base = 0xf9040000, /*GIC virtual interface control 
register base*/
                .gicv_base = 0xf906f000, /*GIC virtual cpu interface 
register base*/
                .maintenance_irq = 25,
            },
        },
        .root_cell = {
            .name = "ZCU104-root",

            .cpu_set_size = sizeof(config.cpus),
            .num_memory_regions = ARRAY_SIZE(config.mem_regions),
            .num_irqchips = ARRAY_SIZE(config.irqchips),
            .num_pci_devices = ARRAY_SIZE(config.pci_devices),

            .vpci_irq_base = 136-32,
        },
    },

    .cpus = {
        0xf,
    },

    .mem_regions = {
        /* MMIO (permissive) */ {
            .phys_start = 0xfd000000,
            .virt_start = 0xfd000000,
            .size =          0x03000000,
            .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
                JAILHOUSE_MEM_IO,
        },
        /* RAM */ {
            .phys_start = 0x00000000,
            .virt_start = 0x00000000,
            .size =       0x7fb00000,
            .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
                JAILHOUSE_MEM_EXECUTE,
        },
        /* IVSHMEM shared memory region for 00:00.0 */ {
            .phys_start = 0x7fb00000,
            .virt_start = 0x7fb00000,
            .size =       0x00100000,
            .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE,
        },
    },

    .irqchips = {
        /* GIC */ {
            .address = 0xf9010000,
            .pin_base = 32,
            .pin_bitmap = {
                0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
            },
        },
    },

    .pci_devices = {
        /* 0000:00:00.0 */ {
            .type = JAILHOUSE_PCI_TYPE_IVSHMEM,
            .domain = 0,
            .bdf = 0x00 << 3,
            .bar_mask = {
                0xffffff00, 0xffffffff, 0x00000000,
                0x00000000, 0x00000000, 0x00000000,
            },
            .shmem_region = 2,
            .shmem_protocol = JAILHOUSE_SHMEM_PROTO_UNDEFINED,
        },
    },
};

Do you have any clues about this problem?  Maybe there are errors in the 
".pci_devices" field. 

Il giorno mercoledì 11 maggio 2022 alle 16:24:22 UTC+2 
[email protected] ha scritto:

> On 10.05.22 16:07, Daniele Ottaviano wrote:
> > Hi,
> > I'm trying to run Jailhouse over Zynq Ultrascale+ ZCU104. I have found a
> > guide showing the setup for ZCU102 but it doesn't work for me:
> > 
> https://github.com/siemens/jailhouse/blob/master/Documentation/setup-on-zynqmp-zcu102.md
>  
> > 
> > First I tried to compile jailhouse on a build created with petalinux
> > 2022 but it fails. 
> > So I decided to use the old release of petalinux 2019.1 because it works
> > according to this guide:
> > 
> https://www.erika-enterprise.com/wiki/index.php/Xilinx_ZCU102#Setup_of_the_GNU_Compiler_for_aarch64
> .
> > 
> > In this case, I'm able to compile Jailhouse but when I start the board
> > the process stops at boot time.
>
> Before even enabling Jailhouse? Then it's a Petalinux topic, I assume.
>
> > 
> > Has anyone successfully ported Jailhouse to zcu104 yet?
>
> Conceptually, it should be close to the Ultra96, thus the integration
> done in jailhouse-images - unless you really want or have to use
> petalinux as baseline. But even then, looking at configs can be helpful.
>
> Jan
>
> -- 
> Siemens AG, Technology
> 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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/9806b760-e030-4183-8d18-7bc6349a027dn%40googlegroups.com.

Reply via email to