]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
my tries
authorMaxim Baryshnikov <barysmax@fel.cvut.cz>
Thu, 18 Feb 2016 15:21:43 +0000 (16:21 +0100)
committerMaxim Baryshnikov <barysmax@fel.cvut.cz>
Thu, 18 Feb 2016 15:21:43 +0000 (16:21 +0100)
configs/hpet-inmate-config.c [new file with mode: 0644]
configs/qemu-vm.c
inmates/demos/x86/Makefile

diff --git a/configs/hpet-inmate-config.c b/configs/hpet-inmate-config.c
new file mode 100644 (file)
index 0000000..df6a03e
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * Jailhouse, a Linux-based partitioning hypervisor
+ *
+ * Minimal configuration for demo inmates, 1 CPU, 1 MB RAM, 1 serial port
+ *
+ * Copyright (c) Siemens AG, 2013
+ *
+ * Authors:
+ *  Jan Kiszka <jan.kiszka@siemens.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2.  See
+ * the COPYING file in the top-level directory.
+ */
+
+#include <linux/types.h>
+#include <jailhouse/cell-config.h>
+
+#define ARRAY_SIZE(a) sizeof(a) / sizeof(a[0])
+
+struct {
+       struct jailhouse_cell_desc cell;
+       __u64 cpus[1];
+       struct jailhouse_memory mem_regions[4];
+       __u8 pio_bitmap[0x2000];
+       struct jailhouse_pci_device pci_devices[1];
+       struct jailhouse_pci_capability pci_caps[0];
+} __attribute__((packed)) config = {
+       .cell = {
+               .signature = JAILHOUSE_CELL_DESC_SIGNATURE,
+               .name = "hpet-demo",
+
+               .cpu_set_size = sizeof(config.cpus),
+               .num_memory_regions = ARRAY_SIZE(config.mem_regions),
+               .num_irqchips = 0,
+               .pio_bitmap_size = ARRAY_SIZE(config.pio_bitmap),
+               .num_pci_devices = ARRAY_SIZE(config.pci_devices),
+               .num_pci_caps = ARRAY_SIZE(config.pci_caps),
+       },
+
+       .cpus = {
+               0x8,
+       },
+
+       .mem_regions = {
+               /* low RAM */ {
+                       .phys_start = 0x3b600000,
+                       .virt_start = 0,
+                       .size = 0x00100000,
+                       .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
+                               JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_DMA |
+                               JAILHOUSE_MEM_LOADABLE,
+               },
+               /* communication region */ {
+                       .virt_start = 0x00100000,
+                       .size = 0x00001000,
+                       .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
+                               JAILHOUSE_MEM_COMM_REGION,
+               },
+               /* RAM */ {
+                       .phys_start = 0x3f200000,
+                       .virt_start = 0x3f200000,
+                       .size = 0xddf000,
+                       .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
+                               JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_DMA,
+               },
+               // /* ACPI */ {
+               //      .phys_start = 0x3ffdf000,
+               //      .virt_start = 0x3ffdf000,
+               //      .size = 0x30000,
+               //      .flags = JAILHOUSE_MEM_READ |
+               //              JAILHOUSE_MEM_ROOTSHARED,
+               // },
+               /* MemRegion: fed00000-fed003ff : PNP0103:00 */
+               {
+                       .phys_start = 0xfed00000,
+                       .virt_start = 0xfed00000,
+                       .size = 0x1000,
+                       .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
+                               JAILHOUSE_MEM_ROOTSHARED,
+               },
+       },
+
+       .pio_bitmap = {
+               [     0/8 ...  0x3f7/8] = -1,
+               [ 0x3f8/8 ...  0x3ff/8] = 0, /* serial1 */
+               [ 0x400/8 ... 0xe00f/8] = -1,
+               [0xe010/8 ... 0xe017/8] = 0, /* OXPCIe952 serial1 */
+               [0xe018/8 ... 0xffff/8] = -1,
+       },
+
+       .pci_devices = {
+               {
+                       .type = JAILHOUSE_PCI_TYPE_IVSHMEM,
+                       .domain = 0x0,
+                       .bdf = (0x08<<3),
+                       .bar_mask = {
+                               0xffffff00, 0xffffffff, 0x00000000,
+                               0x00000000, 0xffffffe0, 0xffffffff,
+                       },
+                       .shmem_region = 3,
+                       .num_msix_vectors = 1,
+               },
+       },
+};
\ No newline at end of file
index f95b1f64ff650ec2585bd3c8e27ec1a3c8d46c59..5825dfefa6df2f46a165930a270c7448ebf522dd 100644 (file)
@@ -37,7 +37,7 @@ struct {
        struct jailhouse_memory mem_regions[13];
        struct jailhouse_irqchip irqchips[1];
        __u8 pio_bitmap[0x2000];
-       struct jailhouse_pci_device pci_devices[8];
+       struct jailhouse_pci_device pci_devices[9];
        struct jailhouse_pci_capability pci_caps[5];
 } __attribute__((packed)) config = {
        .header = {
@@ -191,7 +191,7 @@ struct {
                [ 0x3b0/8 ...  0x3df/8] = 0, /* VGA */
                [ 0x3e0/8 ...  0x3ef/8] = -1,
                [ 0x3f0/8 ...  0x3f7/8] = 0, /* floppy */
-               [ 0x3f8/8 ...  0x3ff/8] = -1,
+               [ 0x3f8/8 ...  0x3ff/8] = -1/*0*/,
                [ 0x400/8 ...  0x407/8] = 0xfb, /* invalid but accessed by X */
                [ 0x408/8 ... 0x5657/8] = -1,
                [0x5658/8 ... 0x565f/8] = 0xf0, /* vmport */
@@ -249,6 +249,19 @@ struct {
                        .msix_region_size = 0x1000,
                        .msix_address = 0xfebf6000,
                },
+               //added by me ---------------------------------
+               {
+                       .type = JAILHOUSE_PCI_TYPE_IVSHMEM,
+                       .domain = 0x0,
+                       .bdf = (0x08<<3),
+                       .bar_mask = {
+                               0xffffff00, 0xffffffff, 0x00000000,
+                               0x00000000, 0xffffffe0, 0xffffffff,
+                       },
+                       .shmem_region = 11,
+                       .num_msix_vectors = 1,
+               },
+               //--------------------------------------------------
                {
                        .type = JAILHOUSE_PCI_TYPE_IVSHMEM,
                        .domain = 0x0,
@@ -260,6 +273,7 @@ struct {
                        .shmem_region = 12,
                        .num_msix_vectors = 1,
                },
+               
        },
 
        .pci_caps = {
index 8defc67cee57b34c72cbe2b04d7a5ed4b4cbcf2b..ea72fba7f26d984913757a29824fdcae4b62d917 100644 (file)
@@ -13,7 +13,8 @@
 include $(INMATES_LIB)/Makefile.lib
 
 INMATES := tiny-demo.bin apic-demo.bin ioapic-demo.bin 32-bit-demo.bin \
-       pci-demo.bin e1000-demo.bin ivshmem-demo.bin smp-demo.bin
+       pci-demo.bin e1000-demo.bin ivshmem-demo.bin smp-demo.bin \
+       hpet-inmate.bin
 
 tiny-demo-y    := tiny-demo.o
 apic-demo-y    := apic-demo.o
@@ -22,6 +23,7 @@ pci-demo-y    := pci-demo.o
 e1000-demo-y   := e1000-demo.o
 ivshmem-demo-y := ivshmem-demo.o
 smp-demo-y     := smp-demo.o
+hpet-inmate-y  := hpet-inmate.o
 
 $(eval $(call DECLARE_32_BIT,32-bit-demo))
 32-bit-demo-y  := 32-bit-demo.o