On Wed, Mar 01, 2023 at 13:34:32 +0100, Ján Tomko wrote: > Add a limit attribute to restrict the maximum physical address bits > that would be used for the guest CPU: > > <cpu mode='host-passthrough'> > <maxphysaddr mode='passthrough' limit='39'/> > </cpu> > > https://gitlab.com/libvirt/libvirt/-/issues/450 > https://bugzilla.redhat.com/show_bug.cgi?id=2171860 > > Signed-off-by: Ján Tomko <jtomko@xxxxxxxxxx> > --- > docs/formatdomain.rst | 7 ++++- > src/conf/cpu_conf.c | 7 +++++ > src/conf/cpu_conf.h | 1 + > src/conf/schemas/cputypes.rng | 5 +++ > .../qemuxml2argvdata/cpu-phys-bits-limit.xml | 20 ++++++++++++ > .../cpu-phys-bits-limit.x86_64-latest.xml | 31 +++++++++++++++++++ > tests/qemuxml2xmltest.c | 2 ++ > 7 files changed, 72 insertions(+), 1 deletion(-) > create mode 100644 tests/qemuxml2argvdata/cpu-phys-bits-limit.xml > create mode 100644 tests/qemuxml2xmloutdata/cpu-phys-bits-limit.x86_64-latest.xml - I find it weird that 'limit' is a signed integer, while 0 doesn't make sense. I guess you copied what 'bits' does, although that has the same problem. - The code doesn't validate that 'limit' is used only form mode 'passthrough'. Docs imply that it doesn't make sense elsewhere. Reviewed-by: Peter Krempa <pkrempa@xxxxxxxxxx>