Skip to content

Commit 2da749e

Browse files
committed
Use host-passthrough mode of CPU virtualization
Signed-off-by: Panwar, Ashish <[email protected]>
1 parent 004a679 commit 2da749e

File tree

5 files changed

+15
-12
lines changed

5 files changed

+15
-12
lines changed

scripts/gen_vmconfigs.py

+11
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,15 @@ def add_memory_backing(config, main, child):
129129
page.set('size', '1048576')
130130
page.set('unit', 'KiB')
131131

132+
def add_cpu_mode(main, child):
133+
pos = list(main).index(child)
134+
remove_tag(main, 'cpu')
135+
cpu = ET.Element('cpu')
136+
main.insert(pos + 1, cpu)
137+
cpu.set('mode', 'host-passthrough')
138+
cpu.set('check', 'partial')
139+
140+
132141

133142
# -- the following tags are important
134143
# 1. os: update to booth VM with mitosis kernel
@@ -152,6 +161,8 @@ def rewrite_config(config):
152161
if child.tag == 'currentMemory':
153162
child.text = str(get_memory_size(config))
154163
add_memory_backing(config, main, child)
164+
if child.tag == 'cpu':
165+
add_cpu_mode(main, child)
155166

156167
tree.write(src)
157168

vmconfigs/samples/1GBHUGE.xml

+1-3
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@
4747
<acpi/>
4848
<apic/>
4949
</features>
50-
<cpu check="partial" match="exact" mode="custom">
51-
<model fallback="allow">EPYC-IBPB</model>
52-
</cpu>
50+
<cpu check="partial" mode="host-passthrough"/>
5351
<clock offset="utc">
5452
<timer name="rtc" tickpolicy="catchup"/>
5553
<timer name="pit" tickpolicy="delay"/>

vmconfigs/samples/2MBHUGE.xml

+1-3
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@
4747
<acpi/>
4848
<apic/>
4949
</features>
50-
<cpu check="partial" match="exact" mode="custom">
51-
<model fallback="allow">EPYC-IBPB</model>
52-
</cpu>
50+
<cpu check="partial" mode="host-passthrough"/>
5351
<clock offset="utc">
5452
<timer name="rtc" tickpolicy="catchup"/>
5553
<timer name="pit" tickpolicy="delay"/>

vmconfigs/samples/4KB.xml

+1-3
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@
4242
<acpi/>
4343
<apic/>
4444
</features>
45-
<cpu check="partial" match="exact" mode="custom">
46-
<model fallback="allow">EPYC-IBPB</model>
47-
</cpu>
45+
<cpu check="partial" mode="host-passthrough"/>
4846
<clock offset="utc">
4947
<timer name="rtc" tickpolicy="catchup"/>
5048
<timer name="pit" tickpolicy="delay"/>

vmconfigs/samples/HAWKEYE.xml

+1-3
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@
4242
<acpi/>
4343
<apic/>
4444
</features>
45-
<cpu check="partial" match="exact" mode="custom">
46-
<model fallback="allow">EPYC-IBPB</model>
47-
</cpu>
45+
<cpu check="partial" mode="host-passthrough"/>
4846
<clock offset="utc">
4947
<timer name="rtc" tickpolicy="catchup"/>
5048
<timer name="pit" tickpolicy="delay"/>

0 commit comments

Comments
 (0)