From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from PA4PR04CU001.outbound.protection.outlook.com (mail-francecentralazon11023100.outbound.protection.outlook.com [40.107.162.100]) by lore.virtuozzo.com (Postfix) with ESMTPS id C039C80F9C for ; Thu, 29 Oct 2026 11:34:47 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HfjSyJT0LZ26joeR0UX/y3Wf7LejvhpsEFk7m14xmvT4WXWoWKKyuIxvGlnBR8TeIMfyJYawt17iHYrjcFWc7yHUVXekWp2N601fbN0Jey4i+6DstrcZDlqxby77v8IZiLowCAojPC3E7YLch3T643Sql52pEDTC/HI6z+lBOZOJ0mHYZkRh0b1CHzOdWZjnIPI6kgJIaN/cvPrP1yrwqvucgyR2uAjT+jyxMfpuI0JU6CSZ8ywnha374XODOF3IKoD5k2G5tHA+uqqgXAymdgy68z18S3dnM8O8MrlvuiOFaj6gygvK4e6szXoKk5dry82wkDRrAfsm2qOqCG6nAw== 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=Tl3rElnr+wYQy2tIXDP9akMU9j/VvFnU/wtP9jAbPUg=; b=ELPFts/iREvYXo2MB4tpDx7veLwnMfxlvuNH5CaFOI5/KsoUznJeuT03qd3mBoaMT8kpApWEAneMCFnM4XztJofkP1KzBGEASfCp6LXsOBacry7NHypHYl8g+hmGDL3iWPbRqtL3DlMda/ou0s8/qcUAqwSbvuLf3qTKHftFjH+Lh2gGDNqxkJAPJQjllfFihOmjVg02VtfMaLNHKZ5JwwtGQM87Z0LmaTAir4Gn4lk7XbknyVe1/ars9r3xZI6IL0mAkiXdhScSumf3bI4wp6BowqeSmyDG8MNpruCe4Y4fZElugEh30xWLfGilHqxKdEqV/MrB2tLn34y1WSAWdw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 2a00:1450:4864:20::52b) 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=Tl3rElnr+wYQy2tIXDP9akMU9j/VvFnU/wtP9jAbPUg=; b=nLBZFpjoze9/gtNxRAmiWf7Nn5dAmhSa8DW3JhsH8TxOF75FEqLTAgQ6fgULJ4Tqop04DG5VX7KoViFyjaPJtRmpKQCsxb48nPoFEcoVOp5/BEl1P7MNIXCqwBe1nV6i1B4KuBPxYfRsV/3szoGvZYDU13TarI4ZuyOmH1C/dqk= Received: from PR3P251CA0004.EURP251.PROD.OUTLOOK.COM (2603:10a6:102:b5::16) by AS2PR08MB9104.eurprd08.prod.outlook.com (2603:10a6:20b:5fe::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.546.22; Thu, 29 Oct 2026 11:34:41 +0000 Received: from ZR1PEPF0000E45F.eurprd04.prod.outlook.com (2603:10a6:102:b5:cafe::2) by PR3P251CA0004.outlook.office365.com (2603:10a6:102:b5::16) 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 11:34:41 +0000 Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 2a00:1450:4864:20::52b) 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::52b as permitted sender) receiver=protection.outlook.com; client-ip=2a00:1450:4864:20::52b; helo=mail-ed1-x52b.google.com; pr=C Received: from mail-ed1-x52b.google.com (2a00:1450:4864:20::52b) by ZR1PEPF0000E45F.mail.protection.outlook.com (2603:10a6:918::137) 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 11:34:40 +0000 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-6b1a86c0316so3032144a12.0 for ; Thu, 29 Oct 2026 04:34:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=google; t=1793273680; x=1793878480; 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=Tl3rElnr+wYQy2tIXDP9akMU9j/VvFnU/wtP9jAbPUg=; b=E5l+QKyoQlj212CPRLSF0zwuNtx2RtXSHbL/0NoID0eOFeE1wIXbLmyxYD5VbLlswQ 84TbBCBVU+h62KLKxMMwPxoZt+6rItFl3gZ3UMNZGuFL3h/m0FMejV/rE8i83wb3u3O1 tQh8xRfh/6wD48c5K/BdArN7TLm3aMcPjEE8iULVlmoYHixdbHYOBIOrG5V9LU3fd+Fj oGvgK3xoVAqrqTfgY9FxU/Y4+Bj0xR/4kRnrsuFfdiz7Rq4wFKblzIeKpNCorejElHmt EQIn10sbVcQYX6JB5xgE9eypJ1GJt9u1Nj3rskKGqyP22Jav+5xie4ad8Z8/KthItH6+ exew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793273680; x=1793878480; 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=Tl3rElnr+wYQy2tIXDP9akMU9j/VvFnU/wtP9jAbPUg=; b=DD1t7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adAeMQed11vQqGhG789kRvNKIlnp8ni4LJmeFV0H15+Fbq/RnqPVuaw AVQ1PpeNpgfETyKa+6F7v5D9/y/3otRWFerAQwip1zaL/DJ8Y7YCoGCEr5wuQAtrJnR+q6P1CMA ZcWf5UomxQdg1WN0lZFNHRR4EQ== X-Received: by 2002:a17:906:ef03:b0:c41:4d5:e97c with SMTP id a640c23a62f3a-c49be04243bmr408743166b.37.1793273679951; Thu, 29 Oct 2026 04:34:39 -0700 (PDT) Received: from athena.sw.ru ([2a06:5b06:b600:300:f4be:f111:4ee0:40d3]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48e3ebcb958sm33967211f8f.21.2026.10.29.04.34.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2026 04:34:39 -0700 (PDT) From: "Denis V. Lunev" To: andrey.zhadchenko@virtuozzo.com Cc: khorenko@virtuozzo.com, svt-core@virtuozzo.com, den@openvz.org Subject: [PATCH v2 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 12:34:30 +0100 Message-ID: <20261029113436.93521-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: ZR1PEPF0000E45F:EE_|AS2PR08MB9104:EE_ X-MS-Office365-Filtering-Correlation-Id: 5c25e957-1090-42dc-3d5f-08df35b09efb 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|6059299003|9140799003|48200799018|82310400026|261026135527099003|5023799004|261028144727099003|260925021911599003|260925021311599003|261026140227099003|260925022911599003|5063699009|261009223027099003|261021123027099003|261022105027099003|10067099003|261021121427099003|56012099006|18002099003|55112099003|261026121527099003|16102099003|13003099007; X-Microsoft-Antispam-Message-Info: ZGhJcI7Q6lhM706qfOe8syymmlPZqevmJ9ZWBWFF6VrZnqwX1DxfgngD4RzkJp/j+bPAg5mYhlgdjCditcRyx+R+zd98mSVI2Zy/FccHnGnZo9OxSwEUYBTMWFsizCOFBC9anPd3UD4g2X40CquSWBRQdpA3JksZpWfFH9EYZSqKlrgDOXIBeMGdhzdj64q5MlShb9asRi1rg+4snM0KPqAURzmkul0AdUygT6Hm6qzOvZwldS0rhP69qHO++5odG8EngBEio2hsRKtR96Uzw8gICiZatSodNwvZW3OQx6ig/zcgHmpv9A/ERMEN0H1mMJ4Mr+W15AwBgAzxhavHG4Y+CCRkU1o8ENJbTQ7rtrnJhZFDto37ySlZkisl7Qvxf6HZpHu85n3LqN26fhulqcFlGTNynOV/m755LHMsR516pno7Cw1QAyvdtERATSWqHXHZ8g+NgljsqSMuMmpejGxRJNCNF21kl20aIGsjq7XtXP/FOfZcnQlWEV7mhppvq+TBWawCpJyyZsLezB4ar63jCfk25Ita3ueWGZPvk9Qvm6LTtX8eeEGPOUHwEfecaihQFQ16KKCiDy6KSfC0mO56KrptMDQ/qz6lFeVh742RUtvz4qPsjj7ganYcPylQ0x2UQbdd2ec5td1RP6WvbAVZIxITKTae4eVasZtwn5oHhlkXX6WC/Ox8xOZCJAWMNGQfwpa5ZfaBlYr/Q0epk8RWba9vOY1kMX4vxqQgQd+ky252fBq3waGWUJirwzyb60Px2rAIEKlQBQgNNAH/mvdp6KK/99FXWWZtt7Gl48ATsxdJvQNWg44qYlDzqytFp5pDNMckbTh4gz9Px5J4YstXthUMr5+4OcE5V1nMHDGBxdxlzmu+pArF/spseb/q X-Forefront-Antispam-Report: CIP:2a00:1450:4864:20::52b;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail-ed1-x52b.google.com;PTR:mail-ed1-x52b.google.com;CAT:NONE;SFS:(13230040)(704161211799003)(61400799027)(43022699015)(376014)(6059299003)(9140799003)(48200799018)(82310400026)(261026135527099003)(5023799004)(261028144727099003)(260925021911599003)(260925021311599003)(261026140227099003)(260925022911599003)(5063699009)(261009223027099003)(261021123027099003)(261022105027099003)(10067099003)(261021121427099003)(56012099006)(18002099003)(55112099003)(261026121527099003)(16102099003)(13003099007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fhbUYpdfkIyo5mqPBlpOCsfHtAYsdvhLkKOi1rgx9oOJcx40c96pF0bJdRflkH9EbI3l9Pz6ce4rCCQXieoHuPd7VSlPj1zTa8D2e3AKfhEvQNczc+J3m5mZJ1m+urEGA2jm/kfoiqqqCPa7C/urAW7fGetdBoyw/Pg6H6ia/AyAgoF0nQSMT7z2Nn/AMAoXR24fTwCmExcg8mds0HPSBL6c6Vo3muKJWnZxiIiYVFX3hA/JolDP1ZVRW9dHixoCOskND+V3AUG/LRYrfmUR782bEcoA3NE6/3CEWSf1gLLUQ7HTdmwN7L2u27H4tskTFA8JBPXkf2iBLqMRLflvl7HPe7RunXScmdl4J7wJ3ICmTWKxHWrdKiRW7im/Gj7LIVKZxVlWPpB46YMeY1zsqbboh12OlKhMF1PYsRJJq/EQvC+iFc5W3EXXjZ+3BWWz 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 11:34:40.6235 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5c25e957-1090-42dc-3d5f-08df35b09efb X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-AuthSource: ZR1PEPF0000E45F.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB9104 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 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. - 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). - bus-lock-detect and v-vmsave-vmload are build-tested only: no Zen 5 or Zen 4 client host was available. 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 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