<div dir="ltr">I agree with you. If it is added to the XML file, where should it be placed? I think the following may be OK:<br><div><domain><br>  ...<br>  <maxMemory slots='16' unit='KiB'>1524288</maxMemory><br>  <memory unit='KiB'>524288</memory><br>  <currentMemory unit='KiB'>524288</currentMemory><br>  <below4gMemory unit='GiB'>2</below4gMemory><br>  ...<br></domain><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Peter Krempa <<a href="mailto:pkrempa@redhat.com">pkrempa@redhat.com</a>> 于2021年4月21日周三 下午4:46写道:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Wed, Apr 21, 2021 at 16:25:28 +0800, yezhiyong wrote:<br>
> Limit the amount of ram below 4G. This helps in scenarios like<br>
> GPU passthrough when the GPA used by DMA device is conflict with<br>
> the decode window of a host bridge and the address translation<br>
> request to iommu isn't launched, which causes address overlapping.<br>
> Note that currently this can be triggered by some abnormal behavior<br>
> of hardware.<br>
> <br>
> In the general case, this option needs to be configured when virtual<br>
> machines share the same host, which is why using qemu.conf to support<br>
> per-host configuration.<br>
<br>
Is this really something you want to set for EVERY VM all the time,<br>
because it doesn't seem to me to be the case.<br>
<br>
If there is any reason not to have this for all VMs it must not be done<br>
via qemu.conf option but rather a XML knob.<br>
<br>
> Signed-off-by: yezhiyong <<a href="mailto:yezhiyong@bytedance.com" target="_blank">yezhiyong@bytedance.com</a>><br>
> Signed-off-by: zhenwei pi <<a href="mailto:pizhenwei@bytedance.com" target="_blank">pizhenwei@bytedance.com</a>><br>
> Signed-off-by: zhangruien <<a href="mailto:zhangruien@bytedance.com" target="_blank">zhangruien@bytedance.com</a>><br>
> ---<br>
>  src/qemu/qemu.conf      | 8 ++++++++<br>
>  src/qemu/qemu_command.c | 4 ++++<br>
>  src/qemu/qemu_conf.c    | 5 +++++<br>
>  src/qemu/qemu_conf.h    | 1 +<br>
>  4 files changed, 18 insertions(+)<br>
> <br>
> diff --git a/src/qemu/qemu.conf b/src/qemu/qemu.conf<br>
> index 8722dc169c..f09c89486e 100644<br>
> --- a/src/qemu/qemu.conf<br>
> +++ b/src/qemu/qemu.conf<br>
> @@ -898,6 +898,14 @@<br>
>  # NOTE: big files will be stored here<br>
>  #memory_backing_dir = "/var/lib/libvirt/qemu/ram"<br>
>  <br>
> +# Limit the amount of ram below 4G. This helps in scenarios like<br>
> +# GPU passthrough when the GPA used by DMA device is comflict with<br>
> +# the decode window of a host bridge and the address translation<br>
> +# request to iommu isn't launched, which causes address overlapping.<br>
> +# Note that currently this can be triggered by some abnormal behavior<br>
> +# of hardware.<br>
> +#max_ram_below_4g = "2G"<br>
<br>
</blockquote></div>