]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
configs/README: Fix and update QEMU config and demo description
authorJan Kiszka <jan.kiszka@siemens.com>
Sun, 24 Aug 2014 22:23:39 +0000 (00:23 +0200)
committerJan Kiszka <jan.kiszka@siemens.com>
Thu, 28 Aug 2014 06:36:10 +0000 (08:36 +0200)
The config file was no longer in sync with the setup described in the
README. Morever, we should include the HDA audio device in the QEMU
command line so that the pci-demo can be run. Update and enhance the
step-wise introduction in the README accordingly.

Include the virtio-9p-pci device in the config although we are not
referring to it in the README. It's an optional device at 00:1f.7, used
for local testings only.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
README
configs/qemu-vm.c

diff --git a/README b/README
index 9de7f096072f603cd5cf6c5edd1f8bd40389bba0..a22d88bd6e3bd945e71f62e0bca4a1102d96a5ff 100644 (file)
--- a/README
+++ b/README
@@ -101,7 +101,8 @@ machine as follows:
     qemu-system-x86_64 -machine q35 -m 1G -enable-kvm -smp 4 \
         -cpu kvm64,-kvm_pv_eoi,-kvm_steal_time,-kvm_asyncpf,-kvmclock,+vmx,+x2apic \
         -drive file=LinuxInstallation.img,id=disk,if=none \
-        -device ide-hd,drive=disk -serial stdio -serial vc
+        -device ide-hd,drive=disk -serial stdio -serial vc \
+        -device intel-hda,addr=1b.0 -device hda-duplex
 
 Inside the VM, make sure that jailhouse.bin, generated by the build process,
 is available for firmware loading (typically /lib/firmware).
@@ -123,22 +124,12 @@ Next you can create a cell with a demonstration application as follows:
     jailhouse cell load apic-demo /path/to/apic-demo.bin -a 0xf0000
     jailhouse cell start apic-demo
 
-apic-demo.bin is left by the built process in the inmates/ directory. This
-application will program the APIC timer interrupt to fire at 10 Hz, measuring
-the jitter against the PM timer and displaying the result on the 
+apic-demo.bin is left by the built process in the inmates/demos/x86 directory.
+This application will program the APIC timer interrupt to fire at 10 Hz,
+measuring the jitter against the PM timer and displaying the result on the
 console. Given that this demonstration runs in a virtual machine, obviously
 no decent latencies should be expected.
 
-To demonstrate the execution of a second, non-Linux cell, issue the following
-commands:
-
-    jailhouse cell create /path/to/tiny-demo.cell
-    jailhouse cell load tiny-demo /path/to/tiny-demo.bin -a 0xf0000
-    jailhouse cell start tiny-demo
-
-The tiny-demo will use the second serial port provided by QEMU. You will find
-its output in a virtual console of the QEMU window.
-
 After creation, cells are addressed via the command line tool by providing
 their names or their runtime-assigned IDs. You can obtain information about
 active cells this way:
@@ -159,16 +150,30 @@ long as it is running, no cell reconfigurations can be performed - the
 apic-demo locks the hypervisor in this regard. In order to destroy another cell
 or create an additional one, shut down the apic-demo first.
 
+    jailhouse cell shutdown apic-demo  # call again if error is returned
+
+To demonstrate the execution of a second, non-Linux cell, issue the following
+commands:
+
+    jailhouse cell create /path/to/pci-demo.cell
+    jailhouse cell load pci-demo /path/to/pci-demo.bin -a 0xf0000
+    jailhouse cell start pci-demo
+
+The pci-demo will use the second serial port provided by QEMU. You will find
+its output in a virtual console of the QEMU window. The purpose of this demo is
+to show basic PCI device configuration and MSI handling.
+
 While cell configurations are locked, it is still possible, though, to reload
 the content of existing cell (provided they accept their shutdown first). To
 reload and restart the tiny-demo, issue the following commands:
 
-    jailhouse cell load tiny-demo /path/to/tiny-demo.bin -a 0xf0000
-    jailhouse cell start tiny-demo
+    jailhouse cell start apic-demo
+    jailhouse cell load pci-demo /path/to/pci-demo.bin -a 0xf0000
+    jailhouse cell start pci-demo
 
 Finally, Jailhouse is can be stopped completely again:
 
-    jailhouse disable
+    jailhouse disable  # call again on error due to running apic-demo
 
 All non-Linux cells running at that point will be destroyed, and resources
 will be returned to Linux.
index e9335f46c6d940b55f297ddd85b162258e5d64b6..e1e9c66c4143944e888a4f5c6c6b5c737c3aa395 100644 (file)
 struct {
        struct jailhouse_system header;
        __u64 cpus[1];
-       struct jailhouse_memory mem_regions[9];
+       struct jailhouse_memory mem_regions[10];
        struct jailhouse_irqchip irqchips[1];
        __u8 pio_bitmap[0x2000];
-       struct jailhouse_pci_device pci_devices[6];
-       struct jailhouse_pci_capability pci_caps[3];
+       struct jailhouse_pci_device pci_devices[7];
+       struct jailhouse_pci_capability pci_caps[5];
 } __attribute__((packed)) config = {
        .header = {
                .hypervisor_memory = {
@@ -103,17 +103,24 @@ struct {
                        .size = 0x10000,
                        .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE,
                },
-               /* MemRegion: febf0000-febf0fff : 0000:00:01.0 */
+               /* MemRegion: febf0000-febf3fff : ICH HD audio */
                {
                        .phys_start = 0xfebf0000,
                        .virt_start = 0xfebf0000,
+                       .size = 0x4000,
+                       .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE,
+               },
+               /* MemRegion: febf4000-febf4fff : 0000:00:01.0 */
+               {
+                       .phys_start = 0xfebf4000,
+                       .virt_start = 0xfebf4000,
                        .size = 0x1000,
                        .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE,
                },
-               /* MemRegion: febf2000-febf2fff : ahci */
+               /* MemRegion: febf5000-febf5fff : ahci */
                {
-                       .phys_start = 0xfebf2000,
-                       .virt_start = 0xfebf2000,
+                       .phys_start = 0xfebf5000,
+                       .virt_start = 0xfebf5000,
                        .size = 0x1000,
                        .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE,
                },
@@ -165,15 +172,14 @@ struct {
                        .domain = 0x0000,
                        .bdf = 0x0010,
                },
-               { /* virtio-9p-pci */
+               { /* ICH HD audio */
                        .type = JAILHOUSE_PCI_TYPE_DEVICE,
                        .domain = 0x0000,
-                       .bdf = 0x0018,
+                       .bdf = 0x00d8,
                        .caps_start = 0,
-                       .num_caps = 1,
-                       .num_msix_vectors = 2,
-                       .msix_region_size = 0x1000,
-                       .msix_address = 0xfebf1000,
+                       .num_caps = 2,
+                       .num_msi_vectors = 1,
+                       .msi_64bits = 1,
                },
                { /* ISA bridge */
                        .type = JAILHOUSE_PCI_TYPE_DEVICE,
@@ -194,13 +200,28 @@ struct {
                        .domain = 0x0000,
                        .bdf = 0x00fb,
                },
+               { /* virtio-9p-pci */
+                       .type = JAILHOUSE_PCI_TYPE_DEVICE,
+                       .domain = 0x0000,
+                       .bdf = 0x00ff,
+                       .caps_start = 4,
+                       .num_caps = 1,
+                       .num_msix_vectors = 2,
+                       .msix_region_size = 0x1000,
+                       .msix_address = 0xfebf6000,
+               },
        },
 
        .pci_caps = {
-               { /* virtio-9p-pci */
-                       .id = 0x11,
+               { /* ICH HD audio */
+                       .id = 0x5,
+                       .start = 0x60,
+                       .len = 14,
+                       .flags = JAILHOUSE_PCICAPS_WRITE,
+               },
+               { /* non-cap registers: HDCTL, TCSEL, DCKCTL, DCKSTS */
                        .start = 0x40,
-                       .len = 12,
+                       .len = 0x10,
                        .flags = JAILHOUSE_PCICAPS_WRITE,
                },
                { /* AHCI */
@@ -215,5 +236,11 @@ struct {
                        .len = 14,
                        .flags = JAILHOUSE_PCICAPS_WRITE,
                },
+               { /* virtio-9p-pci */
+                       .id = 0x11,
+                       .start = 0x40,
+                       .len = 12,
+                       .flags = JAILHOUSE_PCICAPS_WRITE,
+               },
        },
 };