From b378fecc60f74f27579a740277abbf7969b0ec91 Mon Sep 17 00:00:00 2001 From: Kostiantyn Kostiuk Date: Tue, 20 Feb 2024 14:32:57 +0200 Subject: [PATCH] Add VirtIO Viomem Driver support Signed-off-by: Kostiantyn Kostiuk --- lib/engines/hcktest/drivers/viomem.json | 11 +++++++++++ lib/setupmanagers/qemuhck/devices/virtio-mem-pci.json | 7 +++++++ lib/setupmanagers/qemuhck/qemu_machine.rb | 3 ++- 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 lib/engines/hcktest/drivers/viomem.json create mode 100644 lib/setupmanagers/qemuhck/devices/virtio-mem-pci.json diff --git a/lib/engines/hcktest/drivers/viomem.json b/lib/engines/hcktest/drivers/viomem.json new file mode 100644 index 00000000..77c11416 --- /dev/null +++ b/lib/engines/hcktest/drivers/viomem.json @@ -0,0 +1,11 @@ +{ + "name": "VirtIO Viomem Driver", + "device": "virtio-mem-pci", + "inf": "viomem.inf", + "install_method": "PNP", + "type": 0, + "support": false, + "reject_test_names": [ + "Hardware-enforced Stack Protection Compatibility Test" + ] +} diff --git a/lib/setupmanagers/qemuhck/devices/virtio-mem-pci.json b/lib/setupmanagers/qemuhck/devices/virtio-mem-pci.json new file mode 100644 index 00000000..d3bee499 --- /dev/null +++ b/lib/setupmanagers/qemuhck/devices/virtio-mem-pci.json @@ -0,0 +1,7 @@ +{ + "name": "virtio-mem-pci", + "command_line": [ + "-object memory-backend-ram,id=mem_backend,size=2G", + "-device virtio-mem-pci@device_extra_param@,memdev=mem_backend,requested-size=1G,bus=@bus_name@.0" + ] +} diff --git a/lib/setupmanagers/qemuhck/qemu_machine.rb b/lib/setupmanagers/qemuhck/qemu_machine.rb index 710e6cb4..ddb443aa 100644 --- a/lib/setupmanagers/qemuhck/qemu_machine.rb +++ b/lib/setupmanagers/qemuhck/qemu_machine.rb @@ -359,6 +359,7 @@ def full_replacement_list '@client_id@' => @client_id, '@workspace@' => @workspace_path, '@memory@' => "#{option_config('memory_gb')}G", + '@double_memory@' => "#{2 * option_config('memory_gb')}G", '@cpu@' => option_config('cpu'), '@cpu_count@' => option_config('cpu_count'), '@cpu_model@' => option_config('cpu_model'), @@ -486,7 +487,7 @@ def process_devices def base_cmd [ '@qemu_bin@ -enable-kvm -machine @machine_name@@machine_extra_param@ ', - '-m @memory@ -smp @cpu_count@,cores=@cpu_count@ ', + '-m @memory@,maxmem=@double_memory@ -smp @cpu_count@,cores=@cpu_count@ ', '-cpu @cpu_options@ -boot order=cd,menu=on ', '-nodefaults -no-user-config -usb -device usb-tablet -vnc :@vnc_id@ ', '-global kvm-pit.lost_tick_policy=discard -rtc base=localtime,clock=host,driftfix=slew ',