From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from DB3PR0202CU003.outbound.protection.outlook.com (mail-northeuropeazon11020097.outbound.protection.outlook.com [52.101.84.97]) by lore.virtuozzo.com (Postfix) with ESMTPS id D000A80E7E for ; Thu, 29 Oct 2026 12:25:35 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MxIYXD0YTUuo4+HNiBsUyzXg08ah7lmLz6mjAj1XXaoZ6HBAJPyNpUFsdls9WL0qwPLl0Lh01vygwxuxS+ui0y4/1h0CxsSehW9Pbp0/7tbP+lFHZf4g5JBEI9KqmeNWoqtgPzsWooMpk19P0HkF1d7tK3kF61zsaqfNyygqV3I1RRtwt1ZjeYSMi2UUZXl80+naF6SknlmyaMs2RXWc6aQfJRPz3wxJE1mkMG3v//HzLoiQUjcFy9AGUWCX7Al1LecAFNTSQrv28q5/+nyfU7bglMdG6jC5F0k6PInxy0Kg18/ElXvFMoImcGFVq4jo8JxE9d9aiUQ9y3Fs8E1teA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=92da2g+Lx+WhWrPrZqdFyHvz4V7hwCRxpoZSyhchn7U=; b=iTRvdPiBH01NeLzjJY9Yg3SYMFxQsimD3IH73oYoEDZxVyiLibt1HRKMpH0CrivDm31hAO7HgNRz+3IN27zx8gX8/vDBh5J9jO3SAuNQshj2yBkdI4efK/fh73B87oI376/XsCFLHBUxY8ynP97X2GH7qcuLXpwauNvWv1TriDovQI3MNPuIs7cuLR0a0NwBYzEf3HRASD8Y+bgbMllr2lwucmIqoGSJIDPmCLBJxFF9dv+Qw/hXW1wg4m37Q9SOE7Jv7XSfUa2/BFwv3r709aL1I5blKGybZ/dr01Xk8sUEC4eY3RsjV2HFuEbiMzgacYgwvAbb8zdb4TGROFq4zw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 2a00:1450:4864:20::32a) smtp.rcpttodomain=virtuozzo.com smtp.mailfrom=openvz.org; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=openvz.org; dkim=pass (signature was verified) header.d=openvz.org; arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.onmicrosoft.com; s=selector2-virtuozzo-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=92da2g+Lx+WhWrPrZqdFyHvz4V7hwCRxpoZSyhchn7U=; b=RsLuTxmxoxEDHNEIkT9uAIL9J32svFKguwgc3+5eXzDnbzRevnPiu0St82nOLfHbaB031qrPugpQNcjuqXJDZRe2BiHz07jlVXG3PGm5N5UHg3A89I6OkzM8pgRk6epe4Py1+iGSogM+KhtCONNTDAuJl8LOxXyfLmJaVx+SDUw= Received: from PAZP264CA0010.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:21::15) by BR0PR08MB497313.eurprd08.prod.outlook.com (2603:10a6:2c8:32::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.569.8; Thu, 29 Oct 2026 12:25:32 +0000 Received: from MI3PEPF00008551.eurprd05.prod.outlook.com (2603:10a6:102:21:cafe::a5) by PAZP264CA0010.outlook.office365.com (2603:10a6:102:21::15) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.569.8 via Frontend Transport; Thu, 29 Oct 2026 12:25:32 +0000 Authentication-Results: spf=pass (sender IP is 2a00:1450:4864:20::32a) smtp.mailfrom=openvz.org; dkim=pass (signature was verified) header.d=openvz.org;dmarc=pass action=none header.from=openvz.org; Received-SPF: Pass (protection.outlook.com: domain of openvz.org designates 2a00:1450:4864:20::32a as permitted sender) receiver=protection.outlook.com; client-ip=2a00:1450:4864:20::32a; helo=mail-wm1-x32a.google.com; pr=C Received: from mail-wm1-x32a.google.com (2a00:1450:4864:20::32a) by MI3PEPF00008551.mail.protection.outlook.com (2603:10a6:298:1::85) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.569.4 via Frontend Transport; Thu, 29 Oct 2026 12:25:31 +0000 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4a208d93758so21208585e9.3 for ; Thu, 29 Oct 2026 05:25:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=google; t=1793276731; x=1793881531; darn=virtuozzo.com; 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=92da2g+Lx+WhWrPrZqdFyHvz4V7hwCRxpoZSyhchn7U=; b=njidLj1BIomv8gVLYYD/pNnLsBEAeBWDRqB+Gc75hcamCltvT2W/etWiiX5ereYK/v Q2ycEJI4OaC/5n+5YHu+MOygQHY3JO7WmK2XZOrG3VlVFIAxLFO+Q+scOKhphASOThY1 EWZkA7tpPuan6+kGJUjAxEQRq36eSp62l7cDpqqyOIE1+7l7Hnmw+dDB7k89MobWZLaC iMED8ThzvrfoLymwrxzVGmSZda86B7D+Uidt/6y5ipb+PQGqn0VkfLUwUscaOkKkB12g m5EmRqWewjvSlWOsNZs302/8+E80mmyyEecdIUSEksrXY/abwPG2TYa5k3q0F8XmFZUE j7Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793276731; x=1793881531; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=92da2g+Lx+WhWrPrZqdFyHvz4V7hwCRxpoZSyhchn7U=; b=EfxWKQXu2wg7j4bFITKavXgg4ZY/TXd+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oCMiA== X-Received: by 2002:a05:600c:3e0b:b0:4a6:42cc:bf7b with SMTP id 5b1f17b1804b1-4a963ffcf7bmr122150935e9.3.1793276729879; Thu, 29 Oct 2026 05:25:29 -0700 (PDT) Received: from athena.sw.ru ([2a06:5b06:b600:300:f4be:f111:4ee0:40d3]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4aa80285b88sm62423205e9.14.2026.10.29.05.25.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2026 05:25:29 -0700 (PDT) From: "Denis V. Lunev" To: andrey.zhadchenko@virtuozzo.com Cc: svt-core@virtuozzo.com, den@openvz.org Subject: [PATCH v3 hci-8.0/hci-8.1 0/6] i386: keep CPU features of guests from older nodes on vz machine types #VSTOR-152264 Date: Thu, 29 Oct 2026 13:25:21 +0100 Message-ID: <20261029122527.365104-1-den@openvz.org> X-Mailer: git-send-email 2.53.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-EOPTenantAttributedMessage: 0bc7f26d-0264-416e-a6fc-8352af79c58f:0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MI3PEPF00008551:EE_|BR0PR08MB497313:EE_ X-MS-Office365-Filtering-Correlation-Id: 9f8d2dc6-689f-4698-e059-08df35b7b960 X-LD-Processed: 0bc7f26d-0264-416e-a6fc-8352af79c58f,ExtAddr X-MS-Exchange-AtpMessageProperties: SA X-MS-Exchange-SenderADCheck: 0 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|704161211799003|61400799027|43022699015|376014|48200799018|6059299003|9140799003|82310400026|261028144727099003|260925022911599003|260925021911599003|260925021311599003|5063699009|56012099006|5023799004|261009223027099003|261021123027099003|261026140227099003|261026121527099003|261026135527099003|261021121427099003|261022105027099003|10067099003|55112099003|18002099003|16102099003; X-Microsoft-Antispam-Message-Info: AZaapDpS1g6HCLQTXu0bZtP1RwPfguGxRcLnz84C9r0IuXZUerIhoi8vFmZiXF00+cTWh95R7mGDEtvBJgCW7rHqCiAgXqoApDJl8DlbvxUaI5wGL3nwq/Xni3Drh0o3LEQB0aH+BCP5VQQLJYFZ0PhOowSTRtoFIXIEKW9Z6dmSuOdD3YVlmv41oIhwp2MGTqY1DKfs1X3/ky53XBwyCVVAoPKM0nA7K4/47biN3STyfdn++J7Yww4KLAIQDxh/jG7vHeDenIyWSNqW3VBNCpIaskr/2qhQCJbFau5FY4NKF3yerckST9qR6ld8LVem9w5PCzjSS06YmTeqY2BxqaufP817NWO8+CdS6mD2f7c+0j3hXZuDLEVj+a4Dms9ouPve0PnQByQg7WI2i5qVbT111qeIXoDQ99/1GFj9HkFIf2cKp7bMCKTh4WuMlbROX7VaoyjEkd2AJx+ciL4WSoV0CEu1x9mxq+WvWAK3RGNyG+AgrMaQkhen+DNvx74lP6I8LBG1plfs0mASM2n1yS95XErbxlyZfI+MLqL5f6/Wusvmm0rxLYS01hV/b216KKa5TMrtwiTqhg9+r+jYgp8qTa3BJBdlTuj+nj4H+RaYFmQURrpKx6sCIyRCQ/GKD09uK/9n+F0Tjwfv7LTMEA9KE7s7SLzu7ttjuzhL+PutPzu3tbaOYDmNM1p7IcQ/4gjV8saVWnWGxLNeQZgVZkFEuPqe0NnmDV2FW7llOVwhIwu423Shm83pHIxTD1buL3HO28Yli6hPUlYNUIzXTgRCWm1jMbspiFW70tD+oBGmEygL8ZoqfeIJ0shZUWe3Xj1D+BqOwbDV/h5inr0nXrG59KBwpBf4+TNutsKqlBLAgAU59XvkgNyuPX+lYFET X-Forefront-Antispam-Report: CIP:2a00:1450:4864:20::32a;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail-wm1-x32a.google.com;PTR:mail-wm1-x32a.google.com;CAT:NONE;SFS:(13230040)(704161211799003)(61400799027)(43022699015)(376014)(48200799018)(6059299003)(9140799003)(82310400026)(261028144727099003)(260925022911599003)(260925021911599003)(260925021311599003)(5063699009)(56012099006)(5023799004)(261009223027099003)(261021123027099003)(261026140227099003)(261026121527099003)(261026135527099003)(261021121427099003)(261022105027099003)(10067099003)(55112099003)(18002099003)(16102099003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +tQXCUAdoloYdLsoV1u8J3A3Exdp2Hc2XiN+XNZ3CJeorK7Tkd7cNn8cJ8vp4A2ze0MxBjD89hIPfE48mi6eQThBsO2askYx+rAzrobu3a+h1wpm6kL/o+SHi6+gtMNv5i8kAXrAy8KoDee9ZLdMVmM2glekbpumQZNxAGNXPXpnI7AbehdVeIjqFPBu1Y3ugJaNdHAofrpfiT5ZMb9jO+vctg7wz5z7JV8/xr36iwLfXDItvMdDF8AmPaM/UdtINCoJO39mJ4MZu2nxIysA5amMBrPyGkpMRDOUafxU73UMNXCvMVd6b9AzBJyOBQ4TxmW6eqyRUSqKGFejbjL1WPLYx0V1ar2Qvp2UPm5oKA5AGmzjUpKH/1VNTELdt2ok4OupLmxK8acVEoDcbAfgKwtZJRRBWhcNCHcQz369HBTdMV9zZjdz6SmgHmtO2QS9 X-ExternalRecipientOutboundConnectors: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-Auto-Response-Suppress: DR, OOF, AutoReply X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2026 12:25:31.4879 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9f8d2dc6-689f-4698-e059-08df35b7b960 X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-AuthSource: MI3PEPF00008551.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-Transport-CrossTenantHeadersStamped: BR0PR08MB497313 List-Id: 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. Release 7.x ships up to vz9.1.0, and vz9.2.0 is the last type based on a RHEL 9 machine type. 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 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. - both builds, TCG: -cpu EPYC-Milan,svm=off warns about the same features on vz9.2.0 as on vz10.0.0, none from leaf 0x8000000a. - both builds, qtest-x86_64: ivshmem-test, test-hmp and qom-test fail as on the base (qemu_ram_free assertion, isapc aborting at start). - both builds, spec-ctrl on vz9.2.0 and vz7.16.0: EPYC-Milan with spec-ctrl=on,enforce starts, also with only one of ibrs, amd-stibp and amd-ssbd left; EPYC-IBPB, or EPYC-Milan without ibpb or without all three, is refused. Everything 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. Changes v2 -> v3: - 3/6: keep spec-ctrl only when the guest also has the amd-* bits that give it the MSRs, not only the host (Andrey) - 2/6: pc_vz_9_2_compat first in the vz7.16.0 row (Andrey); TSX_CTRL makes XBEGIN abort, not #UD, and libvirt check='partial' still refuses a fresh start - 5/6, 6/6: commit messages clarified - R-b on 1/6, A-b on 2/6, 4/6, 5/6 and 6/6 Changes v1 -> v2: - 6/6: keep SVM leaf features past the svm dependency under KVM only, TCG warned about them - 2/6, 6/6, cover: commit messages clarified after the Sashiko review v2: http://lore.virtuozzo.com/qemu/20261029113436.93521-1-den@openvz.org/ v1: http://lore.virtuozzo.com/kernel/20261029095645.4173762-1-den@openvz.org/ 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 | 68 +++++++++++++++++++++++++++++++++++++++++++- target/i386/cpu.h | 11 +++++++ 6 files changed, 100 insertions(+), 7 deletions(-) base-commit: 0c1497c79831c1ec8efd91d5887236963adf0f18 -- 2.53.0