* [PATCH hci-8.0/8.1 0/1] i386: fix 7.4 -> 8.0 migration of AMD guests without svm #VSTOR-154398
@ 2026-11-11 11:19 Denis V. Lunev
2026-11-11 11:19 ` [PATCH hci-8.0/8.1 1/1] i386: keep only requested SVM leaf features in x-svm-features-compat #VSTOR-154398 Denis V. Lunev
0 siblings, 1 reply; 3+ messages in thread
From: Denis V. Lunev @ 2026-11-11 11:19 UTC (permalink / raw)
To: svt-core; +Cc: andrey.drobyshev, Denis V. Lunev
hci-upgrade 7.4.0 -> 8.0.0 cannot evacuate a single node with AMD
guests: the 8.0 libvirt refuses every incoming EPYC-type guest with
guest CPU doesn't match specification: extra features: npt,nrip-save
The cause is x-svm-features-compat (e51cdbf863d on hci-8.0, 02f55118bcb
on hci-8.1). It keeps all SVM leaf bits of the CPU model when svm is
off, while QEMU 8.2 on 7.4 drops them. The patch keeps only the bits
given explicitly on the command line, which is all the Vz7 host-model
guests the compat was written for need. It applies to hci-8.1 as is;
there the Fixes: tag should name 02f55118bcb.
QEMU alone is not enough for hci-8.0. Guests started on the stock
8.0.0 QEMU already carry the model defaults in their live libvirt
definition and keep it across virsh qemu-update, so the 8.0 hotfix
also needs the libvirt side, which writes every SVM leaf feature as
disabled in the migration cookie of a guest without svm:
https://bitbucket.org/openvz/libvirt.ovz/pull-requests/398
Both must go into the same 8.0 hotfix, and the hotfix must be installed
before a node is upgraded to 8.1. hci-8.1 needs only this patch.
Tested on a nested cluster built from the product images (VHS 7.5.7,
HCI 7.4.0, 8.0.0, 8.1.0) on real Zen 3 and Zen 5 and emulated Zen 1-4
hosts, with this QEMU and the libvirt PR installed on the 8.0 nodes as
a hotfix over guests started on the stock 8.0 and moved by virsh
qemu-update: named EPYC models, host-model and host-passthrough guests,
machine types vz7.16 to vz10.1, every pair of VHS 7 / 7.4 / 8.0 / 8.1
in both directions. 4498 migrations and 1260 qemu-update runs passed
with no unexpected guest-visible CPU change. What still fails is
outside this fix: 7.4 libvirtd crashes on an incoming vz7
host-passthrough guest (VSTOR-152247, fixed on 8.0 only), and 7.4 ->
stock 8.0 itself. Full RCA and transition matrices are in VSTOR-154398:
https://virtuozzo.atlassian.net/browse/VSTOR-154398
Denis V. Lunev (1):
i386: keep only requested SVM leaf features in x-svm-features-compat
#VSTOR-154398
target/i386/cpu.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
base-commit: 9b6f7670e2712c041867b585a618bd8c3778fdad
--
2.53.0
^ permalink raw reply [flat|nested] 3+ messages in thread* [PATCH hci-8.0/8.1 1/1] i386: keep only requested SVM leaf features in x-svm-features-compat #VSTOR-154398
2026-11-11 11:19 [PATCH hci-8.0/8.1 0/1] i386: fix 7.4 -> 8.0 migration of AMD guests without svm #VSTOR-154398 Denis V. Lunev
@ 2026-11-11 11:19 ` Denis V. Lunev
2026-11-11 14:26 ` Andrey Drobyshev
0 siblings, 1 reply; 3+ messages in thread
From: Denis V. Lunev @ 2026-11-11 11:19 UTC (permalink / raw)
To: svt-core; +Cc: andrey.drobyshev, Denis V. Lunev
From: Denis V. Lunev <den@openvz.org>
x-svm-features-compat keeps every FEAT_SVM bit when svm is off,
including the defaults of the CPU model. QEMU 8.2 drops those through
the dependency on svm, and libvirt checks the QOM features of the
incoming guest against the definition sent by the source. Every AMD
named-model guest of a vz9.0-9.2 machine type without svm (the KVM
default for all named models) is refused when it comes from HCI 7.4:
guest CPU doesn't match specification: extra features: npt,nrip-save
so hci-upgrade from 7.4 cannot evacuate a single node.
The compat is only needed for Vz7 host-model guests, which run with
npt=on,nrip-save=on,svm=off given explicitly. Keep just the FEAT_SVM
bits requested by the user, both against the dependency on svm and
against the host, and let the model defaults and the bits -cpu host
takes from the host go as they do on QEMU 8.2. The guest cannot see
any of them without svm, so its CPUID does not change.
Fixes: e51cdbf863df ("i386: keep SVM leaf features without svm on vz types up to vz9.2.0 #PSBM-144630")
Signed-off-by: Denis V. Lunev <den@openvz.org>
---
target/i386/cpu.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index e22fafeaef0..6b68eebc35d 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -8998,15 +8998,15 @@ void x86_cpu_expand_features(X86CPU *cpu, Error **errp)
for (i = 0; i < ARRAY_SIZE(feature_dependencies); i++) {
FeatureDep *d = &feature_dependencies[i];
- /* CPUID leaf 0x8000000a stays empty without svm anyway */
- if (cpu->svm_features_compat && kvm_enabled() &&
- d->to.index == FEAT_SVM) {
- continue;
- }
-
if (!(env->features[d->from.index] & d->from.mask)) {
uint64_t unavailable_features = env->features[d->to.index] & d->to.mask;
+ /* CPUID leaf 0x8000000a stays empty without svm anyway */
+ if (cpu->svm_features_compat && kvm_enabled() &&
+ d->to.index == FEAT_SVM) {
+ unavailable_features &= ~env->user_features[FEAT_SVM];
+ }
+
/* Not an error unless the dependent feature was added explicitly. */
mark_unavailable_features(cpu, d->to.index,
unavailable_features & env->user_features[d->to.index],
@@ -9168,7 +9168,7 @@ static uint64_t x86_cpu_compat_kept_features(X86CPU *cpu, FeatureWord w)
}
if (cpu->svm_features_compat &&
!(env->features[FEAT_8000_0001_ECX] & CPUID_EXT3_SVM)) {
- kept = ~0ULL;
+ kept |= env->user_features[FEAT_SVM];
}
break;
default:
--
2.53.0
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH hci-8.0/8.1 1/1] i386: keep only requested SVM leaf features in x-svm-features-compat #VSTOR-154398
2026-11-11 11:19 ` [PATCH hci-8.0/8.1 1/1] i386: keep only requested SVM leaf features in x-svm-features-compat #VSTOR-154398 Denis V. Lunev
@ 2026-11-11 14:26 ` Andrey Drobyshev
0 siblings, 0 replies; 3+ messages in thread
From: Andrey Drobyshev @ 2026-11-11 14:26 UTC (permalink / raw)
To: Denis V. Lunev, svt-core
Ack
Applied to hci-8.0 and hci-dev
On 11/11/26 1:19 PM, Denis V. Lunev wrote:
> From: Denis V. Lunev <den@openvz.org>
>
> x-svm-features-compat keeps every FEAT_SVM bit when svm is off,
> including the defaults of the CPU model. QEMU 8.2 drops those through
> the dependency on svm, and libvirt checks the QOM features of the
> incoming guest against the definition sent by the source. Every AMD
> named-model guest of a vz9.0-9.2 machine type without svm (the KVM
> default for all named models) is refused when it comes from HCI 7.4:
>
> guest CPU doesn't match specification: extra features: npt,nrip-save
>
> so hci-upgrade from 7.4 cannot evacuate a single node.
>
> The compat is only needed for Vz7 host-model guests, which run with
> npt=on,nrip-save=on,svm=off given explicitly. Keep just the FEAT_SVM
> bits requested by the user, both against the dependency on svm and
> against the host, and let the model defaults and the bits -cpu host
> takes from the host go as they do on QEMU 8.2. The guest cannot see
> any of them without svm, so its CPUID does not change.
>
> Fixes: e51cdbf863df ("i386: keep SVM leaf features without svm on vz types up to vz9.2.0 #PSBM-144630")
> Signed-off-by: Denis V. Lunev <den@openvz.org>
> ---
> target/i386/cpu.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/target/i386/cpu.c b/target/i386/cpu.c
> index e22fafeaef0..6b68eebc35d 100644
> --- a/target/i386/cpu.c
> +++ b/target/i386/cpu.c
> @@ -8998,15 +8998,15 @@ void x86_cpu_expand_features(X86CPU *cpu, Error **errp)
> for (i = 0; i < ARRAY_SIZE(feature_dependencies); i++) {
> FeatureDep *d = &feature_dependencies[i];
>
> - /* CPUID leaf 0x8000000a stays empty without svm anyway */
> - if (cpu->svm_features_compat && kvm_enabled() &&
> - d->to.index == FEAT_SVM) {
> - continue;
> - }
> -
> if (!(env->features[d->from.index] & d->from.mask)) {
> uint64_t unavailable_features = env->features[d->to.index] & d->to.mask;
>
> + /* CPUID leaf 0x8000000a stays empty without svm anyway */
> + if (cpu->svm_features_compat && kvm_enabled() &&
> + d->to.index == FEAT_SVM) {
> + unavailable_features &= ~env->user_features[FEAT_SVM];
> + }
> +
> /* Not an error unless the dependent feature was added explicitly. */
> mark_unavailable_features(cpu, d->to.index,
> unavailable_features & env->user_features[d->to.index],
> @@ -9168,7 +9168,7 @@ static uint64_t x86_cpu_compat_kept_features(X86CPU *cpu, FeatureWord w)
> }
> if (cpu->svm_features_compat &&
> !(env->features[FEAT_8000_0001_ECX] & CPUID_EXT3_SVM)) {
> - kept = ~0ULL;
> + kept |= env->user_features[FEAT_SVM];
> }
> break;
> default:
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-11 14:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-11 11:19 [PATCH hci-8.0/8.1 0/1] i386: fix 7.4 -> 8.0 migration of AMD guests without svm #VSTOR-154398 Denis V. Lunev
2026-11-11 11:19 ` [PATCH hci-8.0/8.1 1/1] i386: keep only requested SVM leaf features in x-svm-features-compat #VSTOR-154398 Denis V. Lunev
2026-11-11 14:26 ` Andrey Drobyshev
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.