[PATCH] qemu.conf: add max-ram-below-4g option

Peter Krempa pkrempa at redhat.com
Wed Apr 21 08:46:18 UTC 2021


On Wed, Apr 21, 2021 at 16:25:28 +0800, yezhiyong wrote:
> Limit the amount of ram below 4G. This helps in scenarios like
> GPU passthrough when the GPA used by DMA device is conflict with
> the decode window of a host bridge and the address translation
> request to iommu isn't launched, which causes address overlapping.
> Note that currently this can be triggered by some abnormal behavior
> of hardware.
> 
> In the general case, this option needs to be configured when virtual
> machines share the same host, which is why using qemu.conf to support
> per-host configuration.

Is this really something you want to set for EVERY VM all the time,
because it doesn't seem to me to be the case.

If there is any reason not to have this for all VMs it must not be done
via qemu.conf option but rather a XML knob.

> Signed-off-by: yezhiyong <yezhiyong at bytedance.com>
> Signed-off-by: zhenwei pi <pizhenwei at bytedance.com>
> Signed-off-by: zhangruien <zhangruien at bytedance.com>
> ---
>  src/qemu/qemu.conf      | 8 ++++++++
>  src/qemu/qemu_command.c | 4 ++++
>  src/qemu/qemu_conf.c    | 5 +++++
>  src/qemu/qemu_conf.h    | 1 +
>  4 files changed, 18 insertions(+)
> 
> diff --git a/src/qemu/qemu.conf b/src/qemu/qemu.conf
> index 8722dc169c..f09c89486e 100644
> --- a/src/qemu/qemu.conf
> +++ b/src/qemu/qemu.conf
> @@ -898,6 +898,14 @@
>  # NOTE: big files will be stored here
>  #memory_backing_dir = "/var/lib/libvirt/qemu/ram"
>  
> +# Limit the amount of ram below 4G. This helps in scenarios like
> +# GPU passthrough when the GPA used by DMA device is comflict with
> +# the decode window of a host bridge and the address translation
> +# request to iommu isn't launched, which causes address overlapping.
> +# Note that currently this can be triggered by some abnormal behavior
> +# of hardware.
> +#max_ram_below_4g = "2G"




More information about the libvir-list mailing list