diff options
Diffstat (limited to 'meta-xilinx-virtualization/recipes-devtools/qemu/qemu-xilinx-7.1/0003-hw-i386-xen-rearrange-xen_hvm_init_pc.patch')
-rw-r--r-- | meta-xilinx-virtualization/recipes-devtools/qemu/qemu-xilinx-7.1/0003-hw-i386-xen-rearrange-xen_hvm_init_pc.patch | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/meta-xilinx-virtualization/recipes-devtools/qemu/qemu-xilinx-7.1/0003-hw-i386-xen-rearrange-xen_hvm_init_pc.patch b/meta-xilinx-virtualization/recipes-devtools/qemu/qemu-xilinx-7.1/0003-hw-i386-xen-rearrange-xen_hvm_init_pc.patch new file mode 100644 index 00000000..1113cf39 --- /dev/null +++ b/meta-xilinx-virtualization/recipes-devtools/qemu/qemu-xilinx-7.1/0003-hw-i386-xen-rearrange-xen_hvm_init_pc.patch | |||
@@ -0,0 +1,106 @@ | |||
1 | From 4472924c800e9dbf46e4c2432565d3e406b35d27 Mon Sep 17 00:00:00 2001 | ||
2 | From: Vikram Garhwal <vikram.garhwal@amd.com> | ||
3 | Date: Fri, 1 Jul 2022 16:32:33 -0700 | ||
4 | Subject: [PATCH 03/16] hw/i386/xen: rearrange xen_hvm_init_pc | ||
5 | |||
6 | Move references to: | ||
7 | - xen_get_vmport_regs_pfn | ||
8 | - xen_suspend_notifier | ||
9 | - xen_wakeup_notifier | ||
10 | - xen_ram_init | ||
11 | |||
12 | towards the end of the function. This is done to keep the the common | ||
13 | ioreq functions in one place which will be moved to new function in next | ||
14 | patch in order to make it useful to ARM machines also. | ||
15 | |||
16 | Signed-off-by: Vikram Garhwal <vikram.garhwal@amd.com> | ||
17 | Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com> | ||
18 | Reviewed-by: Stefano Stabellini <stefano.stabellini@xilinx.com> | ||
19 | --- | ||
20 | hw/i386/xen/xen-hvm.c | 49 ++++++++++++++++++++++--------------------- | ||
21 | 1 file changed, 25 insertions(+), 24 deletions(-) | ||
22 | |||
23 | diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c | ||
24 | index e4293d6d66..b27484ad22 100644 | ||
25 | --- a/hw/i386/xen/xen-hvm.c | ||
26 | +++ b/hw/i386/xen/xen-hvm.c | ||
27 | @@ -1416,12 +1416,6 @@ void xen_hvm_init_pc(PCMachineState *pcms, MemoryRegion **ram_memory) | ||
28 | state->exit.notify = xen_exit_notifier; | ||
29 | qemu_add_exit_notifier(&state->exit); | ||
30 | |||
31 | - state->suspend.notify = xen_suspend_notifier; | ||
32 | - qemu_register_suspend_notifier(&state->suspend); | ||
33 | - | ||
34 | - state->wakeup.notify = xen_wakeup_notifier; | ||
35 | - qemu_register_wakeup_notifier(&state->wakeup); | ||
36 | - | ||
37 | /* | ||
38 | * Register wake-up support in QMP query-current-machine API | ||
39 | */ | ||
40 | @@ -1432,23 +1426,6 @@ void xen_hvm_init_pc(PCMachineState *pcms, MemoryRegion **ram_memory) | ||
41 | goto err; | ||
42 | } | ||
43 | |||
44 | - rc = xen_get_vmport_regs_pfn(xen_xc, xen_domid, &ioreq_pfn); | ||
45 | - if (!rc) { | ||
46 | - DPRINTF("shared vmport page at pfn %lx\n", ioreq_pfn); | ||
47 | - state->shared_vmport_page = | ||
48 | - xenforeignmemory_map(xen_fmem, xen_domid, PROT_READ|PROT_WRITE, | ||
49 | - 1, &ioreq_pfn, NULL); | ||
50 | - if (state->shared_vmport_page == NULL) { | ||
51 | - error_report("map shared vmport IO page returned error %d handle=%p", | ||
52 | - errno, xen_xc); | ||
53 | - goto err; | ||
54 | - } | ||
55 | - } else if (rc != -ENOSYS) { | ||
56 | - error_report("get vmport regs pfn returned error %d, rc=%d", | ||
57 | - errno, rc); | ||
58 | - goto err; | ||
59 | - } | ||
60 | - | ||
61 | /* Note: cpus is empty at this point in init */ | ||
62 | state->cpu_by_vcpu_id = g_new0(CPUState *, max_cpus); | ||
63 | |||
64 | @@ -1486,7 +1463,6 @@ void xen_hvm_init_pc(PCMachineState *pcms, MemoryRegion **ram_memory) | ||
65 | #else | ||
66 | xen_map_cache_init(NULL, state); | ||
67 | #endif | ||
68 | - xen_ram_init(pcms, ms->ram_size, ram_memory); | ||
69 | |||
70 | qemu_add_vm_change_state_handler(xen_hvm_change_state_handler, state); | ||
71 | |||
72 | @@ -1513,6 +1489,31 @@ void xen_hvm_init_pc(PCMachineState *pcms, MemoryRegion **ram_memory) | ||
73 | QLIST_INIT(&xen_physmap); | ||
74 | xen_read_physmap(state); | ||
75 | |||
76 | + state->suspend.notify = xen_suspend_notifier; | ||
77 | + qemu_register_suspend_notifier(&state->suspend); | ||
78 | + | ||
79 | + state->wakeup.notify = xen_wakeup_notifier; | ||
80 | + qemu_register_wakeup_notifier(&state->wakeup); | ||
81 | + | ||
82 | + rc = xen_get_vmport_regs_pfn(xen_xc, xen_domid, &ioreq_pfn); | ||
83 | + if (!rc) { | ||
84 | + DPRINTF("shared vmport page at pfn %lx\n", ioreq_pfn); | ||
85 | + state->shared_vmport_page = | ||
86 | + xenforeignmemory_map(xen_fmem, xen_domid, PROT_READ|PROT_WRITE, | ||
87 | + 1, &ioreq_pfn, NULL); | ||
88 | + if (state->shared_vmport_page == NULL) { | ||
89 | + error_report("map shared vmport IO page returned error %d handle=%p", | ||
90 | + errno, xen_xc); | ||
91 | + goto err; | ||
92 | + } | ||
93 | + } else if (rc != -ENOSYS) { | ||
94 | + error_report("get vmport regs pfn returned error %d, rc=%d", | ||
95 | + errno, rc); | ||
96 | + goto err; | ||
97 | + } | ||
98 | + | ||
99 | + xen_ram_init(pcms, ms->ram_size, ram_memory); | ||
100 | + | ||
101 | /* Disable ACPI build because Xen handles it */ | ||
102 | pcms->acpi_build_enabled = false; | ||
103 | |||
104 | -- | ||
105 | 2.17.1 | ||
106 | |||