Skip to content

Commit fce5862

Browse files
Sainath Grandhiwenlingz
authored andcommitted
hv: vm_description fix for partition ACRN
1) Changed VM memory size from 2 GB to 512 MB Some platforms might not have a total of 4 GB above 4 GB in host e820 With this change, we need a total of only 1 GB above 4 GB in host e820 2) Update e820 entries for the above change 3) type fix for VM1_CPUS and VM2_CPUS Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
1 parent 38a1898 commit fce5862

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

hypervisor/partition/vm_description.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#define VM1_NUM_CPUS 2U
1717

1818
/* Logical CPU IDs assigned to this VM */
19-
int VM1_CPUS[VM1_NUM_CPUS] = {0U, 2U};
19+
uint16_t VM1_CPUS[VM1_NUM_CPUS] = {0U, 2U};
2020

2121
/*********************/
2222
/* VIRTUAL MACHINE 1 */
@@ -26,7 +26,7 @@ int VM1_CPUS[VM1_NUM_CPUS] = {0U, 2U};
2626
#define VM2_NUM_CPUS 2U
2727

2828
/* Logical CPU IDs assigned with this VM */
29-
int VM2_CPUS[VM2_NUM_CPUS] = {3U, 1U};
29+
uint16_t VM2_CPUS[VM2_NUM_CPUS] = {3U, 1U};
3030

3131
static struct vpci_vdev_array vpci_vdev_array1 = {
3232
.num_pci_vdev = 2,
@@ -133,26 +133,28 @@ const struct vm_description_array vm_desc_partition = {
133133
.vm_pcpu_ids = &VM1_CPUS[0],
134134
.vm_id = 1U,
135135
.start_hpa = 0x100000000UL,
136-
.mem_size = 0x80000000UL, /* uses contiguous memory from host */
136+
.mem_size = 0x20000000UL, /* uses contiguous memory from host */
137137
.vm_vuart = true,
138138
.bootargs = "root=/dev/sda rw rootwait noxsave maxcpus=2 nohpet console=hvc0 \
139139
console=ttyS0 no_timer_check ignore_loglevel log_buf_len=16M \
140140
consoleblank=0 tsc=reliable",
141141
.vpci_vdev_array = &vpci_vdev_array1,
142+
.mptable = &mptable_vm1,
142143
},
143144

144145
{
145146
/* Internal variable, MUSTBE init to -1 */
146147
.vm_hw_num_cores = VM2_NUM_CPUS,
147148
.vm_pcpu_ids = &VM2_CPUS[0],
148149
.vm_id = 2U,
149-
.start_hpa = 0x180000000UL,
150-
.mem_size = 0x80000000UL, /* uses contiguous memory from host */
150+
.start_hpa = 0x120000000UL,
151+
.mem_size = 0x20000000UL, /* uses contiguous memory from host */
151152
.vm_vuart = true,
152153
.bootargs = "root=/dev/sda rw rootwait noxsave maxcpus=2 nohpet console=hvc0 \
153154
console=ttyS0 no_timer_check ignore_loglevel log_buf_len=16M \
154155
consoleblank=0 tsc=reliable",
155156
.vpci_vdev_array = &vpci_vdev_array2,
157+
.mptable = &mptable_vm2,
156158
},
157159
}
158160
};
@@ -183,21 +185,21 @@ const struct e820_entry e820_default_entries[NUM_E820_ENTRIES] = {
183185
.type = E820_TYPE_RAM
184186
},
185187

186-
{ /* mptable */
188+
{ /* mptable 65536U */
187189
.baseaddr = 0xF0000U,
188190
.length = 0x10000U,
189191
.type = E820_TYPE_RESERVED
190192
},
191193

192194
{ /* mptable to lowmem */
193195
.baseaddr = 0x100000U,
194-
.length = 0x7FF00000U,
196+
.length = 0x1FF00000U,
195197
.type = E820_TYPE_RAM
196198
},
197199

198200
{ /* lowmem to PCI hole */
199-
.baseaddr = 0x80000000U,
200-
.length = 0x40000000U,
201+
.baseaddr = 0x20000000U,
202+
.length = 0xa0000000U,
201203
.type = E820_TYPE_RESERVED
202204
},
203205

0 commit comments

Comments
 (0)