- Jan 13, 2022
-
-
Dmitry Petrov authored
This change adds support for horizontal scroll to ps/2 mouse device code. The code is implemented to match the logic of linux kernel which is used as a reference. Signed-off-by:
Dmitry Petrov <dpetroff@gmail.com> Message-Id: <20220108153947.171861-2-dpetroff@gmail.com> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Satyeshwar Singh authored
Previously, the large modes (>1080p) that were generated by Qemu in its EDID were all 50 Hz. If we provide them to a Guest OS and the user selects one of these modes, then the OS by default only gets 50 FPS. This is especially true for Windows OS. With this patch, we are now exposing a 3840x2160@60 Hz which will allow the guest OS to get 60 FPS. Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by:
Satyeshwar Singh <satyeshwar.singh@intel.com> Message-Id: <20211116221103.27128-1-dongwon.kim@intel.com> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Daniel P. Berrangé authored
Currently QEMU defaults to a resolution of 1024x768 when exposing EDID info to the guest OS. The EDID default info is important as this will influence what resolution many guest OS will configure the screen with on boot. It can also potentially influence what resolution the firmware will configure the screen with, though until very recently EDK2 would not handle EDID info. One important thing to bear in mind is that the default graphics card driver provided by Windows will leave the display set to whatever resolution was enabled by the firmware on boot. Even if sufficient VRAM is available, the resolution can't be changed without installing new drivers. IOW, the default resolution choice is quite important for usability of Windows. Modern real world monitor hardware for desktop/laptop has supported resolutions higher than 1024x768 for a long time now, perhaps as long as 15+ years. There are quite a wide variety of native resolutions in use today, however, and in wide screen form factors the height may not be all that tall. None the less, it is considered that there is scope for making the QEMU default resolution slightly larger. In considering what possible new default could be suitable, choices considered were 1280x720 (720p), 1280x800 (WXGA) and 1280x1024 (SXGA). In many ways, vertical space is the most important, and so 720p was discarded due to loosing vertical space, despite being 25% wider. The SXGA resolution would be good, but when taking into account window titlebars/toolbars and window manager desktop UI, this might be a little too tall for some users to fit the guest on their physical montior. This patch thus suggests a modest change to 1280x800 (WXGA). This only consumes 1 MB per colour channel, allowing double buffered framebuffer in 8 MB of VRAM. Width wise this is 25% larger than QEMU's current default, but height wise this only adds 5%, so the difference isn't massive on the QEMU side. Overall there doesn't appear to be a compelling reason to stick with 1024x768 resolution. Signed-off-by:
Daniel P. Berrangé <berrange@redhat.com> Reviewed-by:
Gerd Hoffmann <kraxel@redhat.com> Message-Id: <20211129140508.1745130-1-berrange@redhat.com> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Philippe Mathieu-Daudé authored
vga_mmio_init() is used only one time and not very helpful, inline and remove it. Reviewed-by:
BALATON Zoltan <balaton@eik.bme.hu> Signed-off-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by:
Thomas Huth <thuth@redhat.com> Message-Id: <20211206224528.563588-5-f4bug@amsat.org> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Philippe Mathieu-Daudé authored
Introduce TYPE_VGA_MMIO, a sysbus device. While there is no change in the vga_mmio_init() interface, this is a migration compatibility break of the MIPS Acer Pica 61 Jazz machine (pica61). Suggested-by:
Thomas Huth <thuth@redhat.com> Reviewed-by:
BALATON Zoltan <balaton@eik.bme.hu> Signed-off-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by:
Thomas Huth <thuth@redhat.com> Message-Id: <20211206224528.563588-4-f4bug@amsat.org> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Philippe Mathieu-Daudé authored
Inline vga_mm_init() in vga_mmio_init() to simplify the next patch review. Kind of. Reviewed-by:
BALATON Zoltan <balaton@eik.bme.hu> Reviewed-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20211206224528.563588-3-f4bug@amsat.org> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Philippe Mathieu-Daudé authored
There is no ISA bus part in the MMIO VGA device, so rename: * hw/display/vga-isa-mm.c -> hw/display/vga-mmio.c * CONFIG_VGA_ISA_MM -> CONFIG_VGA_MMIO * ISAVGAMMState -> VGAMmioState * isa_vga_mm_init() -> vga_mmio_init() Reviewed-by:
BALATON Zoltan <balaton@eik.bme.hu> Reviewed-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20211206224528.563588-2-f4bug@amsat.org> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Gerd Hoffmann authored
Otherwise we run the error handling code even for successful requests. Fixes: 13b250b1 ("uas: add stream number sanity checks.") Reported-by:
Guenter Roeck <linux@roeck-us.net> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com> Reviewed-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20211210080659.2537084-1-kraxel@redhat.com>
-
Volker Rümelin authored
Quote from: High Definition Audio Specification 1.0a, section 3.3.35 Offset 80: {IOB}SDnCTL Stream Reset (SRST): Writing a 1 causes the corresponding stream to be reset. The Stream Descriptor registers (except the SRST bit itself) ... are reset. Change the code to reset the Stream Descriptor Control and Status registers except the SRST bit. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/757 Signed-off-by:
Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20211226154017.6067-3-vr_qemu@t-online.de> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Zhenwei Pi authored
A device of USB video class usually uses larger desc structure, so use larger buffer to avoid failure. (dev-video.c is ready) This is an unlikely code path: 1, during guest startup, guest tries to probe device. 2, run 'lsusb' command in guest(or other similar commands). Reviewed-by:
Daniel P. Berrangé <berrange@redhat.com> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by:
zhenwei pi <pizhenwei@bytedance.com> Message-Id: <20220112015835.900619-1-pizhenwei@bytedance.com> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Dario Binacchi authored
Linux need to fill up the HID descriptor in order to let the driver be emulated. The descriptor was downloaded from [1]. The patch was tested with evtest tool on top of qemu 5.2.0 with linux kernel 4.19.208. [1] https://github.com/linuxwacom/wacom-hid-descriptors/tree/master/Wacom%20PenPartner Signed-off-by:
Michael Trimarchi <michael@amarulasolutions.com> Co-developed-by:
Michael Trimarchi <michael@amarulasolutions.com> Signed-off-by:
Dario Binacchi <dario.binacchi@amarulasolutions.com> Message-Id: <20220112090125.381364-1-dario.binacchi@amarulasolutions.com> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
- Jan 10, 2022
-
-
Michael S. Tsirkin authored
This reverts commit bf1d85c1. Fixes: bf1d85c1 ("virtio: introduce macro IRTIO_CONFIG_IRQ_IDX") Cc: "Cindy Lu" <lulu@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Michael S. Tsirkin authored
This reverts commit e3480ef8. Fixes: e3480ef8 ("virtio-pci: decouple notifier from interrupt process") Cc: "Cindy Lu" <lulu@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Michael S. Tsirkin authored
This reverts commit 316011b8. Fixes: 316011b8 ("virtio-pci: decouple the single vector from the interrupt process") Cc: "Cindy Lu" <lulu@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Michael S. Tsirkin authored
This reverts commit 634f7c89. Fixes: 634f7c89 ("vhost-vdpa: add support for config interrupt") Cc: "Cindy Lu" <lulu@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Michael S. Tsirkin authored
This reverts commit 081f864f. Fixes: 081f864f ("virtio: add support for configure interrupt") Cc: "Cindy Lu" <lulu@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Michael S. Tsirkin authored
This reverts commit f7220a7c. Fixes: f7220a7c ("vhost: add support for configure interrupt") Cc: "Cindy Lu" <lulu@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Michael S. Tsirkin authored
This reverts commit 497679d5. Fixes: 497679d5 ("virtio-net: add support for configure interrupt") Cc: "Cindy Lu" <lulu@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Michael S. Tsirkin authored
This reverts commit d48185f1. Fixes: d48185f1 ("virtio-mmio: add support for configure interrupt") Cc: "Cindy Lu" <lulu@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Michael S. Tsirkin authored
This reverts commit d5d24d85. Fixes: d5d24d85 ("virtio-pci: add support for configure interrupt") Cc: "Cindy Lu" <lulu@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
- Jan 09, 2022
-
-
Mark Cave-Ayland authored
The macfb VRAM memory region was configured with coalescing rather than dirty memory logging enabled, causing some areas of the screen not to redraw after a full screen update. Signed-off-by:
Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Fixes: 8ac919a0 ("hw/m68k: add Nubus macfb video card") Reviewed-by:
Laurent Vivier <laurent@vivier.eu> Message-Id: <20220108164147.30813-1-mark.cave-ayland@ilande.co.uk> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
Laurent Vivier authored
"qemu-system-m68k -M q800 -bios /dev/null" crashes with a segfault in q800_init(). This happens because the code doesn't check that rom_ptr() returned a non-NULL pointer . To avoid NULL pointer, don't allow 0 sized file and use bios_size with rom_ptr(). Resolves: https://gitlab.com/qemu-project/qemu/-/issues/756 Reported-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Laurent Vivier <laurent@vivier.eu> Reviewed-by:
Thomas Huth <thuth@redhat.com> Reviewed-by:
Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Message-Id: <20220107105049.961489-1-laurent@vivier.eu> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
Laurent Vivier authored
Signed-off-by:
Laurent Vivier <laurent@vivier.eu> Reviewed-by:
Thomas Huth <thuth@redhat.com> Reviewed-by:
Cornelia Huck <cohuck@redhat.com> Message-Id: <20211218114340.1856757-1-laurent@vivier.eu>
-
- Jan 08, 2022
-
-
Alistair Francis authored
When realising the SoC use error_fatal instead of error_abort as the process can fail and report useful information to the user. Currently a user can see this: $ ../qemu/bld/qemu-system-riscv64 -M sifive_u -S -monitor stdio -display none -drive if=pflash QEMU 6.1.93 monitor - type 'help' for more information (qemu) Unexpected error in sifive_u_otp_realize() at ../hw/misc/sifive_u_otp.c:229: qemu-system-riscv64: OTP drive size < 16K Aborted (core dumped) Which this patch addresses Reported-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Alistair Francis <alistair.francis@wdc.com> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Tested-by:
Bin Meng <bmeng.cn@gmail.com> Message-Id: <20220105213937.1113508-8-alistair.francis@opensource.wdc.com>
-
Alistair Francis authored
We can remove the original sifive_plic_irqs_pending() function and instead just use the sifive_plic_claim() function (renamed to sifive_plic_claimed()) to determine if any interrupts are pending. This requires move the side effects outside of sifive_plic_claimed(), but as they are only invoked once that isn't a problem. We have also removed all of the old #ifdef debugging logs, so let's cleanup the last remaining debug function while we are here. Signed-off-by:
Alistair Francis <alistair.francis@wdc.com> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Message-Id: <20220105213937.1113508-5-alistair.francis@opensource.wdc.com>
-
Alistair Francis authored
Signed-off-by:
Alistair Francis <alistair.francis@wdc.com> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Message-Id: <20220105213937.1113508-4-alistair.francis@opensource.wdc.com>
-
Alistair Francis authored
Signed-off-by:
Alistair Francis <alistair.francis@wdc.com> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Message-Id: <20220105213937.1113508-3-alistair.francis@opensource.wdc.com>
-
Alistair Francis authored
Signed-off-by:
Alistair Francis <alistair.francis@wdc.com> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Message-Id: <20220105213937.1113508-2-alistair.francis@opensource.wdc.com>
-
Jim Shu authored
It's obvious that PDMA supports 64-bit access of 64-bit registers, and in previous commit, we confirm that PDMA supports 32-bit access of both 32/64-bit registers. Thus, we configure 32/64-bit memory access of PDMA registers as valid in general. Signed-off-by:
Jim Shu <jim.shu@sifive.com> Reviewed-by:
Frank Chang <frank.chang@sifive.com> Reviewed-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by:
Alistair Francis <alistair.francis@wdc.com> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Tested-by:
Bin Meng <bmeng.cn@gmail.com> Message-id: 20220104063408.658169-3-jim.shu@sifive.com Signed-off-by:
Alistair Francis <alistair.francis@wdc.com>
-
Jim Shu authored
Real PDMA supports high 32-bit read/write memory access of 64-bit register. The following result is PDMA tested in U-Boot on Unmatched board: 1. Real PDMA allows high 32-bit read/write to 64-bit register. => mw.l 0x3000000 0x0 <= Disclaim channel 0 => mw.l 0x3000000 0x1 <= Claim channel 0 => mw.l 0x3000010 0x80000000 <= Write low 32-bit NextDest (NextDest = 0x280000000) => mw.l 0x3000014 0x2 <= Write high 32-bit NextDest => md.l 0x3000010 1 <= Dump low 32-bit NextDest 03000010: 80000000 => md.l 0x3000014 1 <= Dump high 32-bit NextDest 03000014: 00000002 => mw.l 0x3000018 0x80001000 <= Write low 32-bit NextSrc (NextSrc = 0x280001000) => mw.l 0x300001c 0x2 <= Write high 32-bit NextSrc => md.l 0x3000018 1 <= Dump low 32-bit NextSrc 03000010: 80001000 => md.l 0x300001c 1 <= Dump high 32-bit NextSrc 03000014: 00000002 2. PDMA transfer from 0x280001000 to 0x280000000 is OK. => mw.q 0x3000008 0x4 <= NextBytes = 4 => mw.l 0x3000004 0x22000000 <= wsize = rsize = 2 (2^2 = 4 bytes) => mw.l 0x280000000 0x87654321 <= Fill test data to dst => mw.l 0x280001000 0x12345678 <= Fill test data to src => md.l 0x280000000 1; md.l 0x280001000 1 <= Dump src/dst memory contents 280000000: 87654321 !Ce. 280001000: 12345678 xV4. => md.l 0x3000000 8 <= Dump PDMA status 03000000: 00000001 22000000 00000004 00000000 ......."........ 03000010: 80000000 00000002 80001000 00000002 ................ => mw.l 0x3000000 0x3 <= Set channel 0 run and claim bits => md.l 0x3000000 8 <= Dump PDMA status 03000000: 40000001 22000000 00000004 00000000 ...@..."........ 03000010: 80000000 00000002 80001000 00000002 ................ => md.l 0x280000000 1; md.l 0x280001000 1 <= Dump src/dst memory contents 280000000: 12345678 xV4. 280001000: 12345678 xV4. Signed-off-by:
Jim Shu <jim.shu@sifive.com> Reviewed-by:
Frank Chang <frank.chang@sifive.com> Reviewed-by:
Alistair Francis <alistair.francis@wdc.com> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Tested-by:
Bin Meng <bmeng.cn@gmail.com> Message-id: 20220104063408.658169-2-jim.shu@sifive.com Signed-off-by:
Alistair Francis <alistair.francis@wdc.com>
-
Stefan Berger authored
Add missing TPM device identification objects _STR and _UID. They will appear as files 'description' and 'uid' under Linux sysfs. Following inspection of sysfs entries for hardware TPMs we chose uid '1'. Cc: Shannon Zhao <shannon.zhaosl@gmail.com> Cc: Michael S. Tsirkin <mst@redhat.com> Cc: Igor Mammedov <imammedo@redhat.com> Cc: Ani Sinha <ani@anisinha.ca> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/708 Signed-off-by:
Stefan Berger <stefanb@linux.ibm.com> Reviewed-by:
Ani Sinha <ani@anisinha.ca> Reviewed-by:
Shannon Zhao <shannon.zhaosl@gmail.com> Message-id: 20211223022310.575496-3-stefanb@linux.ibm.com Message-Id: <20220104175806.872996-3-stefanb@linux.ibm.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com> Reviewed-by:
Igor Mammedov <imammedo@redhat.com>
-
Daniil Tatianin authored
In case of an error during initialization in vhost_dev_init, vhostfd is closed in vhost_dev_cleanup. Remove close from err_virtio as it's both redundant and causes a double close on vhostfd. Signed-off-by:
Daniil Tatianin <d-tatianin@yandex-team.ru> Message-Id: <20211129125204.1108088-1-d-tatianin@yandex-team.ru> Reviewed-by:
Stefano Garzarella <sgarzare@redhat.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Daniil Tatianin authored
vhost_dev_init calls vhost_dev_cleanup on error, which closes vhostfd, don't double close it. Signed-off-by:
Daniil Tatianin <d-tatianin@yandex-team.ru> Message-Id: <20211129132358.1110372-2-d-tatianin@yandex-team.ru> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Daniil Tatianin authored
vhost_dev_init calls vhost_dev_cleanup in case of an error during initialization, which zeroes out the entire vsc->dev as well as the vsc->dev.vqs pointer. This prevents us from properly freeing it in free_vqs. Keep a local copy of the pointer so we can free it later. Signed-off-by:
Daniil Tatianin <d-tatianin@yandex-team.ru> Message-Id: <20211129132358.1110372-1-d-tatianin@yandex-team.ru> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Thomas Huth authored
When running "qemu-system-x86_64 -M pc,help" I noticed that some properties were still missing their description. Add them now so that users get at least a slightly better idea what they are all about. Signed-off-by:
Thomas Huth <thuth@redhat.com> Message-Id: <20211206134255.94784-1-thuth@redhat.com> Reviewed-by:
Igor Mammedov <imammedo@redhat.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Ani Sinha authored
Get rid of the static variable that keeps track of whether hotplug has been disabled on the root pci bus. Simply use qbus_is_hotpluggable() api to perform the same check. This eliminates additional if conditional and simplifies the function. Signed-off-by:
Ani Sinha <ani@anisinha.ca> Message-Id: <1640764674-7784-1-git-send-email-ani@anirban.org> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Igor Mammedov authored
if QEMU is started with used provided SLIC table blob, -acpitable sig=SLIC,oem_id='CRASH ',oem_table_id="ME",oem_rev=00002210,asl_compiler_id="",asl_compiler_rev=00000000,data=/dev/null it will assert with: hw/acpi/aml-build.c:61:build_append_padded_str: assertion failed: (len <= maxlen) and following backtrace: ... build_append_padded_str (array=0x555556afe320, str=0x555556afdb2e "CRASH ME", maxlen=0x6, pad=0x20) at hw/acpi/aml-build.c:61 acpi_table_begin (desc=0x7fffffffd1b0, array=0x555556afe320) at hw/acpi/aml-build.c:1727 build_fadt (tbl=0x555556afe320, linker=0x555557ca3830, f=0x7fffffffd318, oem_id=0x555556afdb2e "CRASH ME", oem_table_id=0x555556afdb34 "ME") at hw/acpi/aml-build.c:2064 ... which happens due to acpi_table_begin() expecting NULL terminated oem_id and oem_table_id strings, which is normally the case, but in case of user provided SLIC table, oem_id points to table's blob directly and as result oem_id became longer than expected. Fix issue by handling oem_id consistently and make acpi_get_slic_oem() return NULL terminated strings. PS: After [1] refactoring, oem_id semantics became inconsistent, where NULL terminated string was coming from machine and old way pointer into byte array coming from -acpitable option. That used to work since build_header() wasn't expecting NULL terminated string and blindly copied the 1st 6 bytes only. However commit [2] broke that by replacing build_header() with acpi_table_begin(), which was expecting NULL terminated string and was checking oem_id size. 1) 602b4582 ("acpi: Permit OEM ID and OEM table ID fields to be changed") 2) Fixes: 4b56e1e4 ("acpi: build_fadt: use acpi_table_begin()/acpi_table_end() instead of build_header()") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/786 Signed-off-by:
Igor Mammedov <imammedo@redhat.com> Message-Id: <20211227193120.1084176-2-imammedo@redhat.com> Reviewed-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by:
Denis Lisov <dennis.lissov@gmail.com> Tested-by:
Alexander Tsoy <alexander@tsoy.me> Cc: qemu-stable@nongnu.org Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Jason Wang authored
When scalable mode is enabled, the passthrough more is not determined by the context entry but PASID entry, so switch to use the logic of vtd_dev_pt_enabled() to determine the passthrough mode in vtd_do_iommu_translate(). Signed-off-by:
Jason Wang <jasowang@redhat.com> Message-Id: <20220105041945.13459-2-jasowang@redhat.com> Reviewed-by:
Peter Xu <peterx@redhat.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
David Hildenbrand authored
Set the new default to "auto", keeping it set to "off" for compat machines. This property is only available for x86 targets. Reviewed-by:
Michal Privoznik <mprivozn@redhat.com> Reviewed-by:
Pankaj Gupta <pankaj.gupta@ionos.com> Signed-off-by:
David Hildenbrand <david@redhat.com> Message-Id: <20211217134039.29670-4-david@redhat.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
David Hildenbrand authored
With VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE, we signal the VM that reading unplugged memory is not supported. We have to fail feature negotiation in case the guest does not support VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE. First, VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE is required to properly handle memory backends (or architectures) without support for the shared zeropage in the hypervisor cleanly. Without the shared zeropage, even reading an unpopulated virtual memory location can populate real memory and consequently consume memory in the hypervisor. We have a guaranteed shared zeropage only on MAP_PRIVATE anonymous memory. Second, we want VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE to be the default long-term as even populating the shared zeropage can be problematic: for example, without THP support (possible) or without support for the shared huge zeropage with THP (unlikely), the PTE page tables to hold the shared zeropage entries can consume quite some memory that cannot be reclaimed easily. Third, there are other optimizations+features (e.g., protection of unplugged memory, reducing the total memory slot size and bitmap sizes) that will require VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE. We really only support x86 targets with virtio-mem for now (and Linux similarly only support x86), but that might change soon, so prepare for different targets already. Add a new "unplugged-inaccessible" tristate property for x86 targets: - "off" will keep VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE unset and legacy guests working. - "on" will set VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE and stop legacy guests from using the device. - "auto" selects the default based on support for the shared zeropage. Warn in case the property is set to "off" and we don't have support for the shared zeropage. For existing compat machines, the property will default to "off", to not change the behavior but eventually warn about a problematic setup. Short-term, we'll set the property default to "auto" for new QEMU machines. Mid-term, we'll set the property default to "on" for new QEMU machines. Long-term, we'll deprecate the parameter and disallow legacy guests completely. The property has to match on the migration source and destination. "auto" will result in the same VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE setting as long as the qemu command line (esp. memdev) match -- so "auto" is good enough for migration purposes and the parameter doesn't have to be migrated explicitly. Reviewed-by:
Michal Privoznik <mprivozn@redhat.com> Signed-off-by:
David Hildenbrand <david@redhat.com> Message-Id: <20211217134039.29670-3-david@redhat.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-