From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11021118.outbound.protection.outlook.com [52.101.70.118]) by lore.virtuozzo.com (Postfix) with ESMTPS id 33C298017D for ; Thu, 29 Oct 2026 12:33:38 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=STLL02jmO/ev+WKUdzjMD0lTUvqaGFI53UD/EetNo+N87b1BmcMzEJBdiytzwj8V6gFPvUt+5g0h1ZkY4C6NQmIUgZui0vdKQ3CKSClNQEq1MYRj4lt+xJA5MIAhVp6QcZaNsAwg0xB81dTSWUqFk13aE5NU8ClDlqkUxAJiCk900Cm8t0sOXl5GyUj8ypZJHbQ0y9xAKWQTKo893LOKxEpqlZxBrmqtwSKhwf4ChVPEbufCiuoWCKWEcodqhiecBAA61h/m96e9cQkF+locglLYukT3BmPOnhBHI9u+KfGHxb7pT9q5din4DBijE0MwWdEYJzj4WXSjl0M66e3ZVw== 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=51D8PjsVGaUmuDQRICZ4N4gCOY6Kek/6DuIZC/vO4ss=; b=ZeCLbgws1fR4VAchVKx2QvP5DpW+1wwYzmtQu6jc2xd92biFTPB1xC5+w5cjf7EZa8YvVKPTkGlX2Idv42LWIXpJr2cws5dJDRoaeVZHB6YC29SoANGLPRU+syQtqciGK80xmVZkOK/wEtNjokaodBEUt7eliaHSvlZDZEVDyVOOz+6pwylU9wRicrTDh6GCms2fZsrOc0QB0HuWX68BJBTHpnwNTE3G1qOnqYQK5q4cIgIYMydSAufxFe7ClIWMSV6vHxBHMSF1JrPWPY/h0VYuzJ0Bh0TipAHPqOwu2uyOZYV4i92mQX6IZA8JYfPeLIzt67vnby38G7XjzMzUDA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 69.169.224.5) smtp.rcpttodomain=virtuozzo.com smtp.mailfrom=eu-central-1.amazonses.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=sashiko.virtuozzo.com; dkim=pass (signature was verified) header.d=sashiko.virtuozzo.com; dkim=pass (signature was verified) header.d=amazonses.com; 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=51D8PjsVGaUmuDQRICZ4N4gCOY6Kek/6DuIZC/vO4ss=; b=EM8dwQCHnoSkRGr5taBBj8t6OlQly483emktXfVOsfyjiXoTynZ1JY3CaCcx6Ad72Zak9cP8CE4HwzwxlKlJ9qkUNRZtBEeoHC05sH3HuMCW9ZlZgTN8Ttrxzc7ILYF1HJ+OvNwQ3HWvV1yx6PGq8OL01zDRxpJHmqV+Q+sDBEc= Received: from DU7P195CA0027.EURP195.PROD.OUTLOOK.COM (2603:10a6:10:54d::20) by DU4PR08MB11718.eurprd08.prod.outlook.com (2603:10a6:10:646::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.546.21; Thu, 29 Oct 2026 12:33:35 +0000 Received: from DB3PEPF0000885D.eurprd02.prod.outlook.com (2603:10a6:10:54d:cafe::d) by DU7P195CA0027.outlook.office365.com (2603:10a6:10:54d::20) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.546.22 via Frontend Transport; Thu, 29 Oct 2026 12:33:35 +0000 Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 69.169.224.5) smtp.mailfrom=eu-central-1.amazonses.com; dkim=pass (signature was verified) header.d=sashiko.virtuozzo.com;dkim=pass (signature was verified) header.d=amazonses.com;dmarc=pass action=none header.from=sashiko.virtuozzo.com; Received-SPF: Pass (protection.outlook.com: domain of eu-central-1.amazonses.com designates 69.169.224.5 as permitted sender) receiver=protection.outlook.com; client-ip=69.169.224.5; helo=b224-5.smtp-out.eu-central-1.amazonses.com; pr=C Received: from b224-5.smtp-out.eu-central-1.amazonses.com (69.169.224.5) by DB3PEPF0000885D.mail.protection.outlook.com (10.167.242.8) 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:33:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=23yjbh4k34hwzfubhuiim7m4inbd3ick; d=sashiko.virtuozzo.com; t=1793277214; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=wa0uLyCcLRZbJvhFFI0Iq2KFc+kYywCUn5xtu2mGfY8=; b=JDJAv3z4HMg+HaVbslbgBDeGC6hkV8C0L1Ub1R8sxDSwEXlfLjGIJqQv5QQMXRbM umewI1Yl0W4S1oTgicE/40rV4MVKrYx4gZ4J0yIIzGnBmevkCBP+FvPxeHEfIXQS/TF 8uAKbqRZhYpTF9L9iGYTy9FKZNmB6yU3ejBubTSBCDtixlor/qcO9K7xXuj/5jlFaxN SR2MyGLhDcuH2SKzN/rVwvl8YtpWrl/Wj6oPzQxTu8GVPXsKr5HN1xWmJabp15i2XcM DQ/Yw1OewR/62jU0ufwwfHVU+ROeFzBXN4XrlLPMIoG81yf+dc8VZPtaZEXVlhI0zFN WT1BgFHK1Q== DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=qftdzk2dqsatjnlrq4r5brjbihpfcrsh; d=amazonses.com; t=1793277214; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date:Feedback-ID; bh=wa0uLyCcLRZbJvhFFI0Iq2KFc+kYywCUn5xtu2mGfY8=; b=jvK/TtPx4qvMtkDuzMLOugoeKanpRDX4Hy79VLmEhyMRJU6WKdYiYVi+SwzZuxNd hvbCP4zfzzTCNDkMCFuBSORwZnKagvJDMpKX2sRZsn0GhVvbufa18GgAkidSYB/oZ/C KvSOaVKr4oyLfuIZgjKTNkGdRyl/ZFMAmhR+STlo= Message-ID: <010701a187a6be34-2223c9d8-df88-40c5-b4b6-e74f4769315e-000000@eu-central-1.amazonses.com> From: no-reply@sashiko.virtuozzo.com Subject: Re: [PATCH v3 hci-8.0/hci-8.1 6/6] i386: keep SVM leaf features without svm on vz types up to vz9.2.0 #PSBM-144630 To: andrey.zhadchenko@virtuozzo.com, "Denis V. Lunev" Cc: den@openvz.org, svt-core@virtuozzo.com In-Reply-To: <20261029122527.365104-7-den@openvz.org> References: <20261029122527.365104-1-den@openvz.org> <20261029122527.365104-7-den@openvz.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 29 Oct 2026 12:33:34 +0000 Feedback-ID: ::1.eu-central-1.2wRQJBpg9g1fGRYexx3dUuYGS25Bux+2TEOx72/m6U4=:AmazonSES X-SES-Outgoing: 2026.10.29-69.169.224.5 X-EOPAttributedMessage: 0 X-EOPTenantAttributedMessage: 0bc7f26d-0264-416e-a6fc-8352af79c58f:0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB3PEPF0000885D:EE_|DU4PR08MB11718:EE_ MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 82ba1ac4-a0c2-4f80-72d4-08df35b8d976 X-LD-Processed: 0bc7f26d-0264-416e-a6fc-8352af79c58f,ExtAddr X-MS-Exchange-AtpMessageProperties: SA List-Id: svt-core@virtuozzo.com X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|61400799027|48200799018|32142699015|9140799003|10067099003|261026135527099003|261028144727099003|261026140227099003|13003099007|261022105027099003|261009223027099003|261021123027099003|5063699009|261026121527099003|56012099006|4143699003|5113699003|4113699003|18002099003|22082099003|16102099003|55112099003; X-Microsoft-Antispam-Message-Info: 5odTsAAQT5h6SjodonLrD3tXcRWeR2t0Pd3Or8dei0yyQ9yRLGXPxMcNJdUMRDgSiR3ClEcmv9dTDSzF+qpTA+C0qr+GskXj1wZ9CnoljdsMWq2V0wO4LikGO26e1DL8YzGRzUjVr2mrl4jyiqJzA+wor1t0Izo6i4iWLzkrjJqV1udHgT7ZUpq5W3bCYAw+iVoVIL6+IxB2xglJiy7PuDbvyhOBY//gmnDAMN/bsgsWW10R+2f6rsvCuOIDZOm4OZ+sTyseMYEvGgVXdtfloYAs7a5TeR4Sj6XWhrlBt1walKoM2d7fnzoh6uurJjTKz3zNUmOscdfVAWQj/Vm1qVpjFGdyCvwvewoTl9LcMBXNPD6WPv1xd0iPYNO5p2YvL3Dn8RYQDaDbTS34kB2emj9qY1bEWBt2D+AiRGJrVHozFQv5e9Mn8MrC94Cmkqwd6x2m/1xw3JGsG0O9qlxDPoLayCUlGJQjLycYXltRKuB/3cdodftw3TtNq0iCSzdzUJveprKs+yJJ9YAnGyIFm5TqWLh23poEKeLqlhQw8lqg5RXDyqzSaAEGYJGhymyxzlakCFzLfp+W9SN8WuFIX43sEykahj6o1gWcOsMEINCJA6023+LHMSCvnqZ+YDTb2d4XZsHhWnQ9vvjub8OcBVsQlVbcXdeqR/ln9sE5GsadDKsh8vm54F1zp85jd2iW7JDmHJUgDJNEtB3goJ2PIgKzKBTqQnZOhWkUJaO5WbbIyl689StXn5Ivf6t+dM1Udr73ZlmJsNjAyMiKUg9N2Rt+56GAIIOHwx/7jlskAQJicE3or8MpuwqjxfaCBTyVFqYo8CH+o/jXAHBvsltSr7Niaw7qoOk2PLt/dSXkjjKydnPDoln53waL1hQNWchEcosBTq9LD6QJH7Gf12gBdg== X-Forefront-Antispam-Report: CIP:69.169.224.5;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:b224-5.smtp-out.eu-central-1.amazonses.com;PTR:b224-5.smtp-out.eu-central-1.amazonses.com;CAT:NONE;SFS:(13230040)(376014)(61400799027)(48200799018)(32142699015)(9140799003)(10067099003)(261026135527099003)(261028144727099003)(261026140227099003)(13003099007)(261022105027099003)(261009223027099003)(261021123027099003)(5063699009)(261026121527099003)(56012099006)(4143699003)(5113699003)(4113699003)(18002099003)(22082099003)(16102099003)(55112099003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: nB/YILJtg1LuY8oi/7aZKttW2PVRJlDgEgdlWQRU19kka2EdE5YsSeqIEHQWDSM/P/ockpYuQW7zkd3L7+rnXTj98WyfUKhMGlIIahR2Sy7Yk/US4iOuDL7yofr0g/sRjLvD0Jclz8Gf99Yd4KGMLj34zfXwi8K3UXxIb5KxfKoxfp52yxFf0dIZcEeN6QYv3N3ISeNfMNE3wWWdIYd4UhSbDEmfEtQ/YDjqdoOi3I/dpBVdWeVuaFh1ismCNqBJcbze9eEIg7OaJgAeOjbo6frjzAqlnIMJysmxSeMxknfcmtNXS6807qv60FnPqJFcZijVEYOpdTMhVJfGm471jSUM7UQpY9H4EkdhP9qFeV2G6CzSTCIE2zmPsN7IqgfwkMjl0t4OmpBI6MD0gyz8rNC3wBzsXJ1kpV3UKqOGdO3JEIiU1zRcAeiZcUvy0dT5 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:33:34.7672 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 82ba1ac4-a0c2-4f80-72d4-08df35b8d976 X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-AuthSource: DB3PEPF0000885D.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU4PR08MB11718 Thank you for your contribution! Sashiko AI review found 1 potential issue(= s) to consider: - [Low] i386: x86_cpu_compat_kept_features() keeps SVM leaf bits after svm = is host-filtered -- commit cc8f40cd79cdf926fae1c7d33e11aa26bbf6654b Author: Denis V. Lunev i386: keep SVM leaf features without svm on vz types up to vz9.2.0 #PSBM-14= 4630 This adds an x-svm-features-compat CPU property and enables it in pc_vz_9_2_compat. Under KVM, requested SVM leaf features are kept when svm is off, both against the feature dependency on svm and against the host feature filter. > diff --git a/target/i386/cpu.c b/target/i386/cpu.c > --- a/target/i386/cpu.c > +++ b/target/i386/cpu.c [ ... ] > @@ -9138,6 +9145,10 @@ static uint64_t x86_cpu_compat_kept_features(X86CP= U *cpu, FeatureWord w) > if (cpu->v_vmsave_vmload_compat && IS_AMD_CPU(env)) { > kept =3D CPUID_SVM_V_VMSAVE_VMLOAD; > } > + if (cpu->svm_features_compat && > + !(env->features[FEAT_8000_0001_ECX] & CPUID_EXT3_SVM)) { > + kept =3D ~0ULL; > + } > break; > default: > break; [Severity: Low] Can this condition tell "svm=3Doff was requested" apart from "svm=3Don was requested but the host filtered it"? x86_cpu_compat_kept_features() reads env->features[FEAT_8000_0001_ECX] when it is called from x86_cpu_filter_features(): uint64_t unavailable_features =3D requested_features & ~host_feat & ~x86_cpu_compat_kept_features(cpu, w); mark_unavailable_features(cpu, w, unavailable_features, prefix); In the FeatureWord enum, FEAT_8000_0001_ECX comes before FEAT_SVM, so the loop filters FEAT_8000_0001_ECX first. If the user requested svm=3Don, for example through a host-model CPU, and the host lacks nested SVM, for example kvm_amd nested=3D0, mark_unavailable_features() clears CPUID_EXT3_SVM first. When the loop then reaches FEAT_SVM, the check above sees the svm bit already cleared and sets kept =3D ~0ULL. Every requested FEAT_SVM bit that the host doesn't support is then neither cleared nor reported. This goes beyond the stated "svm off" scope in the commit message. The guest-visible CPUID looks unchanged, because cpu_x86_cpuid() returns zeros for leaf 0x8000000a without svm. The svm bit is still reported as unavailable, so enforce still fails. The xlevel adjustment happens in x86_cpu_expand_features() before filtering. What does change is that npt, nrip-save and the other SVM leaf features are no longer listed as filtered, and env->features[FEAT_SVM] keeps unsupported bits. Would it be better to record whether svm was requested off before x86_cpu_filter_features() runs, or to check env->user_features, instead of reading the already-filtered env->features value? --=20 Sashiko AI review =C2=B7 https://sashiko.vzint.dev/#/patchset/2026102912252= 7.365104-1-den@openvz.org?part=3D6