From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (mail.openvz.org [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id 770578045D for ; Thu, 29 Oct 2026 09:58:04 +0000 (UTC) Received: from mail.openvz.org (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 69T9uopn030942; Thu, 29 Oct 2026 12:56:51 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69T9uopn030942 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=default; t=1793267813; bh=v1q+psBNdSlw4eeGF5Qwx/Sb/C3UMTCW+pAJa0GzJ24=; h=From:To:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe; b=L3D/WPMOWoifeLTXClw7HC/CDmX5ekE+XegRSvS6+LmVIiGRQHepcIGC/UwRYt2Fn hqwgdalj/9ERQtWjF9hIkouJiwUdbcoZhHQ+Jfep3mQxldNqoJB+vnaF2DUovFu9uI 9CcOOvuAJG8f2ucctERXucByhC6IihUBjTGlKU18LqtrmTH2Zw4bQIAJIJQU51zkpu t5jjVWB62KPb1OfmW5mftivZ21VA3BkbOwRsMNkv9vUeGS3B18PoxCQiCaw8ZoLJKY FSqWqkE9tir5YXP1Zjkj1NwY/CQiKneyCFFPfRAvwnt/PN/licLOYYWnMCPSjYcU1W UYPoamcl4VH7w== Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 69T9unWJ030936 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Thu, 29 Oct 2026 12:56:49 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69T9unWJ030936 Authentication-Results: mail.openvz.org; dkim=pass (2048-bit key) header.d=openvz.org header.i=@openvz.org header.b="fYC6oYO6" Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-48e29c25101so1100580f8f.3 for ; Thu, 29 Oct 2026 02:56:49 -0700 (PDT) X-Gm-Message-State: AFq9FYLy+kREVrlr3H76l7pAWTgSw53xQM98ibHgCr90cJ1MDgepR5gk kDigX+Z9Vze9UpuvCS0IyXzNuESvzRuaHTb/tJp/db7pp/O7gXVBFiR2cyNS6lsZPHBpQcW9euD SpISQ8viKcXsb8wXZh3hPNeW+PH03a79tyI65kg5GDnRarIxYimRSng== X-Gm-Gg: AYBFou3md/HbFdX6/7rac1mPtHDhe7kTmDpvVpGTufNFzmlF2vB4mPMMor5aNjO19Qh Q7vcLvnzoGEbyMOrhzhJWj/FMQlb5GNMJTwQkgaeHOLywIcI3epsy7JAw90Ywe/ENES4VXBGiBM 8huITJGyuC98/oE8S3JWmUQzd1t9wLx6wPoC8+Q85AC+yuza3vBsDov3rkhWHWina6osl8J0byS fLhsHifmLuWyA93LGr1KDDgw+Jkg8pImSUsodqnIy840Nvcanfzph19AXgSS9LeiLSrisUXxawf lczdp245YQ== X-Received: by 2002:a05:6000:2081:b0:48e:68d5:81b1 with SMTP id ffacd0b85a97d-48e68d58bccmr1644946f8f.48.1793267809267; Thu, 29 Oct 2026 02:56:49 -0700 (PDT) X-Received: by 2002:a05:6000:2081:b0:48e:68d5:81b1 with SMTP id ffacd0b85a97d-48e68d58bccmr1644899f8f.48.1793267808691; Thu, 29 Oct 2026 02:56:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1793267808; cv=none; d=google.com; s=arc-20260327; b=IDuA+eUU92oJtoC3mvVfgSELM5dR4SXNmEYmItkHYHvdJUkeIAyD5b5SXT0QWFIyYI GWeVPgsH5oLJj7vL7dI2EACwFVIG42qowmsbmAmd/Xp49GSIaaWgK/R0SPXBg+8BoDlS VrJnWMbC/spZccQ8Wd7bvowj0hTRf5/+SV6gGaWzltcV0dS6TCB1gUNN6yNgcaAWNbVQ 1UIvCwRAtX1EP4TSZH+6DBcCq8Mn9pz7pdK2hVU1h+PuxIbkgR0lKS/PdWxo4dkp9Xq1 YlOl4zZ8lMeFDejl3eU6gb0QHTR93Ay+pj7KBRnWdyXWsRvrklIbizShKJbmY9+sc29r 95fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=HwXu9FLDYPTJDADK1qbfooxRByvMmrZkU9625qUuf+k=; fh=Kr/R+ZQiC/tid3qUs5C3px+AHPSuipOrrdrDcZfSlMY=; b=c6EsTY/zU0M/r309HD7gCevwb/BKktlELB6BJYcg7NF7yq5XRhGdwMWwT/oIY2vr+N loH2QtRi5Z2zDzHrlUjpP3ycc/klXBxD5QFG6HjMUDYWd640VSG9+ubgeWKNXrIfhzWO 0j/OAmmcraIkpIPgqS7soEJNE6ktfChUkZqHAG8gPiijuuXNp9cPx272LVvRd16b8wxs oJt9cKUMx7mV+JLqP/Q09CMv8uBT1k/33F3C3QWdszR/r6yUL3wubJSdNoROQ5m+u88A qUnXUrG+bU/uXZM2rMq0UPtLrKFFc8N61r2Isb9IhVpGLH0B77c5xcAI0tISl4I90peQ Vz+Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=fYC6oYO6; spf=softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:2c3:d099:6fb:56cf as permitted sender) smtp.mailfrom=den@openvz.org; dara=neutral header.i=@openvz.org Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id ffacd0b85a97d-48e55f9fadasor1282603f8f.11.2026.10.29.02.56.48 for (Google Transport Security); Thu, 29 Oct 2026 02:56:48 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:2c3:d099:6fb:56cf as permitted sender) client-ip=2a06:5b06:b600:300:2c3:d099:6fb:56cf; Authentication-Results: mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=fYC6oYO6; spf=softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:2c3:d099:6fb:56cf as permitted sender) smtp.mailfrom=den@openvz.org; dara=neutral header.i=@openvz.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=google; t=1793267808; x=1793872608; darn=openvz.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=HwXu9FLDYPTJDADK1qbfooxRByvMmrZkU9625qUuf+k=; b=fYC6oYO61LIFNIX7w5SucUMxJVCAjYkKq88jTrl8Ojlpp2roOypvmp5Hb1ujOW2IUC FSfQatx+WN7GgWCbOUc4sTeSQntt6r6TfSCeWd3HWmOavQUXCmXSytZevIKKA3d37S/y 9Cx6rH8gtmSKNAIouKRIXfWT5yib1MMJX1N4cWzqGVcHjZ8EDF0K/miYzaOc7Uwtvv0B +oYetlKlxBLSEGnYwxaGaiaDYyXR8Pr0AfPPOFQvCmvqaMpMqzUZQKUTkeBf7P1oI8+l klyMbQEfeI4mvqFJJICDRyyd6VgDOQQbBO4Zgi8oRdf3UW+uQLyi/YbRpi3GhR3/Oo+F xWRA== X-Received: by 2002:a05:6000:29d6:b0:48e:44d:5a9d with SMTP id ffacd0b85a97d-48e5d5d9164mr8368337f8f.45.1793267808103; Thu, 29 Oct 2026 02:56:48 -0700 (PDT) Received: from athena.sw.ru ([2a06:5b06:b600:300:2c3:d099:6fb:56cf]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48e3ecd3418sm29958312f8f.41.2026.10.29.02.56.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2026 02:56:47 -0700 (PDT) From: "Denis V. Lunev" To: andrey.zhadchenko@virtuozzo.com Date: Thu, 29 Oct 2026 10:56:39 +0100 Message-ID: <20261029095645.4173762-1-den@openvz.org> X-Mailer: git-send-email 2.53.0 MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.0/hci-8.1 0/6] i386: keep CPU features of guests from older nodes on vz machine types #VSTOR-152264 X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org A guest started on an older node can have a CPU feature that the destination host no longer offers: TSX disabled by microcode, a newer kernel that stops offering spec-ctrl or bus-lock-detect on AMD, or SVM leaf features that QEMU 2.12 on Vz7 kept with svm off. QEMU filters the feature on the destination, and libvirt refuses the live migration, restore or snapshot revert: guest CPU doesn't match specification: missing features: hle,rtm The guest read its CPUID at boot, so the bit has to stay until the guest restarts. Until now libvirt relaxed the check, in three places that behave differently. One of them crashes libvirtd on the destination of any migration of a host-passthrough VM with a vz7 machine type (VSTOR-152247). This series keeps the bits in QEMU instead: one x-...-compat X86CPU property per feature, all turned on by a new pc_vz_9_2_compat on vz9.2.0 and every older vz machine type. Those are the types every guest started before 8.0 runs. vz10.x types and -cpu host expansion stay strict. A property keeps a bit only when the CPU model or the command line asks for it and the host condition in the commit message holds; KVM ignores CPUID bits it does not support. Patch 1 lets a row of the vz machine type tables name a fourth compat array, which the i440fx vz7.16.0 row needs. Patches 2 to 6 add one property each: 2 hle, rtm PSBM-149402 (field: VSTOR-75689, VSTOR-105458) 3 spec-ctrl, AMD VSTOR-151770 4 bus-lock-detect, AMD VSTOR-152291 5 v-vmsave-vmload, AMD code review, nested guests on Zen 4 client parts, no field report 6 SVM leaf features, svm off PSBM-144630 The same patches apply to hci-8.0 and hci-8.1 without changes; the base given below is hci-dev. On 8.0 they also fix the migration on their own: hci-8.0 libvirt keeps its relaxations, and they no longer see a filtered bit. That covers bus-lock-detect (VSTOR-152291), which hci-8.0 libvirt does not relax. The vz7 CPU fixup there still runs on migration (with the NULL check from VSTOR-152247) and forces npt and nrip-save off, which the guest does not see, because leaf 0x8000000a is hidden without svm. Only the destination needs the new qemu-kvm: the compat acts when the incoming QEMU process starts. On hci-dev the libvirt side drops its relaxations and the qemu.d hooks in libvirt.ovz pr/den-VSTOR-152247-drop-vz-cpu-relaxations. It needs this series in qemu-kvm first. Testing: - dev-cl04, EPYC 7443P: a saved guest whose migration cookie CPU was rewritten to the shape of a Vz7 host-model guest (svm=off,npt=on,nrip-save=on, plus spec-ctrl) fails to restore without the series with "missing features: npt,nrip-save" and "missing features: spec-ctrl". With it the guest restores, the features stay on and filtered-features is empty. Stock 8.1 libvirt, which carries the same relaxations as hci-8.0, restores it with no warning as well. - sqvm2-1015, Broadwell without TSX: the VSTOR-75689 guest CPU fails with "missing features: hle,rtm" without the series and keeps hle and rtm with it. - sqvm2-1013 <-> sqvm2-1015, with the libvirt PR: live migration in both directions of a pc-i440fx-vz7.12.0 host-passthrough guest and of the VSTOR-75689 Broadwell-IBRS guest. No crash, no warning, hle/rtm kept, the CPU stays match='exact'. Stock libvirt crashes on the first of them. - hci-8.0 and hci-8.1 builds: -cpu EPYC-Milan,svm=off,npt=on, nrip-save=on,enforce and -cpu EPYC-Milan,spec-ctrl=on,enforce start on vz7.12.0, vz9.0.0 and vz9.2.0 and are refused on vz10.x. A fresh Broadwell-IBRS start with check='full' is refused on vz10.1.0. - bus-lock-detect and v-vmsave-vmload are build-tested only: no Zen 5 or Zen 4 client host was available. Signed-off-by: Denis V. Lunev Denis V. Lunev (6): i386/pc: raise the limit of compat arrays per Virtuozzo machine type to four #VSTOR-152264 i386: keep hle and rtm on Virtuozzo machine types up to vz9.2.0 #PSBM-149402 i386: keep spec-ctrl for AMD guests on vz machine types up to vz9.2.0 #VSTOR-151770 i386: keep bus-lock-detect for AMD guests on vz machine types up to vz9.2.0 #VSTOR-152291 i386: keep v-vmsave-vmload for nested AMD guests on vz types up to vz9.2.0 #VSTOR-152264 i386: keep SVM leaf features without svm on vz types up to vz9.2.0 #PSBM-144630 hw/i386/pc.c | 9 ++++++ hw/i386/pc_piix.c | 5 ++-- hw/i386/pc_q35.c | 4 +-- include/hw/i386/pc.h | 10 +++++-- target/i386/cpu.c | 67 +++++++++++++++++++++++++++++++++++++++++++- target/i386/cpu.h | 11 ++++++++ 6 files changed, 99 insertions(+), 7 deletions(-) base-commit: 0c1497c79831c1ec8efd91d5887236963adf0f18 -- 2.53.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel