From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <010701a187776fe1-35b2ecf3-067f-4999-bb60-4973438b5ff3-000000@eu-central-1.amazonses.com> Received: from AM0PR02CU008.outbound.protection.outlook.com (mail-westeuropeazon11023078.outbound.protection.outlook.com [52.101.72.78]) by lore.virtuozzo.com (Postfix) with ESMTPS id 486BE8045D for ; Thu, 29 Oct 2026 11:41:59 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=twMAwwIuINqx16f5c3aqwtS9rIDdasTAiXEBuai4abQGXulZyJz1Zh2Ti+2iJOdCXO5R58YxkmJr7OKffSDy1aXIwETIgNCCsJHWUjAF7gn7G2vmuNSyV30j0DMOnIg6EMGB+CPXutVnuO64wAblr9UpyUQzx7MPW8NX7nZUQEgq5ZNNBLI02w3+EBeswmDyCcGJb9e42Iv6nbmse0jEAolfbwvkTcaDjymb7tFnshs7E6JZxCywWrhLkJ1r1477ytyvQvhvilqVdyjmfotaHrj9IFaQJMKwZhK6PuET37pSuZvhlVwJSpd6gInxwITWpQAz39UgQ9Bar1fQ9hrItA== 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=gvNzbK7cX5yU6iRNhWigAEfsOXrYZnoWDpGCtgmE1Vw=; b=srWRilrKvFSRMfWp42cVC8jnF2IaZ8c/lOmKMzHDDoTG1FjpcHpZH7/fROd5+JuH1WqW7Mcpo8O2yPpDHMQ9L/Pfi/lO6GdXVIF1KTge+y8lM8Lzt4u++Ct5fpc3wQRRThghDPI4gS4pSZe7yhCk6nu3c+c5LoN1v8OwVxaCopKkjRa5eIKg0wpN3n/DFEnBIzTKV5A/9Ply1z/wlk8ESLbkT0vnfzek8IR/yAvgt/xxVePDfrO2+VxdmtPeGo72vOLn8OPP34tTGbl8HP4sdV8Dhf+DGYLsfBhIcELD+Las7ba6kBpfDWXMkoj6qPOsbxKfPb94oBHjdr5D7aYIuQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 69.169.224.2) 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=gvNzbK7cX5yU6iRNhWigAEfsOXrYZnoWDpGCtgmE1Vw=; b=fwwxJMbrugIyXNsR0G18dNxqcOljPA6MdolPPtxjivCtylp+A1wOf9IyhwSlR0zQoFkmVjBhuTQK5SHLPrEVMfpFOrTeaL6iG3X3Ciz/yYwuYHcKnCbw+HEbj711V5cu/lIzU7vgWCWa7V2PxoKx1n8auFbzvbO28+iCSyiKb3w= Received: from AS4PR10CA0001.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:5dc::17) by AMDPR08MB11483.eurprd08.prod.outlook.com (2603:10a6:20b:716::21) 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 11:41:54 +0000 Received: from AMS1EPF0000008D.eurprd05.prod.outlook.com (2603:10a6:20b:5dc:cafe::65) by AS4PR10CA0001.outlook.office365.com (2603:10a6:20b:5dc::17) 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 11:41:54 +0000 Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 69.169.224.2) 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.2 as permitted sender) receiver=protection.outlook.com; client-ip=69.169.224.2; helo=b224-2.smtp-out.eu-central-1.amazonses.com; pr=C Received: from b224-2.smtp-out.eu-central-1.amazonses.com (69.169.224.2) by AMS1EPF0000008D.mail.protection.outlook.com (10.167.242.84) 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:41:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=23yjbh4k34hwzfubhuiim7m4inbd3ick; d=sashiko.virtuozzo.com; t=1793274114; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=N5i70GMransFgaMpNMw5wfECW71D6cpjA5GjZnQnbjw=; b=17I87u57MEumqHoki5yPbokvqMxqZtAlCAguWiD0DSyioZH0pRNpMuza05XxeZRQ Qxv3FL6sjUkveSArSX7MJ/3nfp1rLc9yRALFRmnglYixQjWmqlSBZPjHQri0CQ7bXIG IjNo+StY7HW98OPTSjniFUlIo8vWo+kV8gldet0BjEu8B/tJRdj71TinAOBcz41lvxC W2QWIa5/Wv+iRpER1tpp1t2D/Dm3vxXrWayiUPOKPKGfX59by7i2FFNxOJLRtOuc7QY Iq+zZGr8onr/XGcfp5AM20Yk+WJ3DvPXWFo++uK+UAsb9TR+ND7du1D+QScrwib78fx Y1che1LcTw== DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=qftdzk2dqsatjnlrq4r5brjbihpfcrsh; d=amazonses.com; t=1793274114; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date:Feedback-ID; bh=N5i70GMransFgaMpNMw5wfECW71D6cpjA5GjZnQnbjw=; b=Dzld4atwmr424WAkeATO4XdmMnvqEltlmJ0Y/bMVB87++qfVUOtzhMObhamTNEo0 A50EHMgXZ/4PWmOVAJrX8xxBloANfF1juYc+k9XqgNNyEf9SM9gpUaogLAKtQ3edUWD /sVbYDjVtfdcsru8AkQNdzhJ7MNJeGiKcaAGrXOQ= Message-ID: <010701a187776fe1-35b2ecf3-067f-4999-bb60-4973438b5ff3-000000@eu-central-1.amazonses.com> From: no-reply@sashiko.virtuozzo.com Subject: Re: [PATCH v2 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: "Denis V. Lunev" , andrey.zhadchenko@virtuozzo.com Cc: khorenko@virtuozzo.com, svt-core@virtuozzo.com, den@openvz.org In-Reply-To: <20261029113436.93521-7-den@openvz.org> References: <20261029113436.93521-1-den@openvz.org> <20261029113436.93521-7-den@openvz.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 29 Oct 2026 11:41:54 +0000 Feedback-ID: ::1.eu-central-1.2wRQJBpg9g1fGRYexx3dUuYGS25Bux+2TEOx72/m6U4=:AmazonSES X-SES-Outgoing: 2026.10.29-69.169.224.2 X-EOPAttributedMessage: 0 X-EOPTenantAttributedMessage: 0bc7f26d-0264-416e-a6fc-8352af79c58f:0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AMS1EPF0000008D:EE_|AMDPR08MB11483:EE_ MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: c6740c7e-0377-4891-434f-08df35b1a17e X-LD-Processed: 0bc7f26d-0264-416e-a6fc-8352af79c58f,ExtAddr X-MS-Exchange-AtpMessageProperties: SA List-Id: svt-core@virtuozzo.com X-MS-Exchange-Transport-Rules-Loop: 1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|61400799027|32142699015|376014|48200799018|9140799003|261028144727099003|260925021911599003|260925021311599003|260925022911599003|4143699003|5063699009|5023799004|56012099006|261009223027099003|261022105027099003|261021123027099003|261021121427099003|261026135527099003|261026140227099003|261026121527099003|10067099003|18002099003|55112099003|22082099003|16102099003|4113699003|5113699003|13003099007; X-Microsoft-Antispam-Message-Info: P3UkLJjdTMj2x7zQnEiHNh/jMJzc9LQHAFHmP14KC5TWawsVNLIcRdAtZ/GqhQjnJbyQg3kqUADrdOJO1lMHuz88GJe2vOwnJ5t9weG/CJPLeY8lBwlO/QFDDpynCgxVBWEij77u1Z8KRTH17RLf4qReXgno/k5rmeWH2tQN/VVQQ/RpQdYCCv1Py3P2AOnnu8PVz7ghseHf19sxBHW8AIGdbmAON2q2Jl/t81YFj2fGFAyT650/xbX09cdv+mxsNisYM2W0WEqiZt0Q9ClapcXvv71MqBnTBj0a8H/4bGBMViMN0KeBn22NvRRw8X2DazDlOQVnjdml7NQ8lxfD+MfsObMiA8Tu0fUKHHMXY+x+QpSxZgfKZOYEPqHjwS5/1QTM9/eOZpmu4rWmmSLJmiJHdG5iOL2A5payHfQPmuO30e+OuPxcqdTnuyo+36VJr/NGB++/Bh1hX5WI3KW2ulIHB2kQZ7K1qfxgPJcCNBB0VoVaDnctrCz9SVg6wThizNObbAERPlMdnGJB4VmZQbtiyibv2JOEEpVWA3Csfn3RMyxiTFlPn9Yum5ayhWKbo6s7iHorqWe3tPk9DqAA91XeFvjqUxT4uJELiW0j/2B8okr/G7bX9k9WeLZwEwKHJV5tuG6HrCV2Co52misScv57FCjGVHy4Dw2UCihWeuXHfqeH9AZW1cs4jhFSGuIdKykbv6P4beRBNDgmu/tY9Egxb5VXsgH7Jw2tLdoRI53IPI/MGNJnhLohlnde8k2iv275+5uvceSrqz3pv23LLrZdORYXfqvPXPjFLa5ac4TKC4yLsRRmocSCUMVTI7lv22rOvVUng7XswVBdStkV5bucWEQbjSn+IP7Ur19z3K/jXLeNyADhyQnQ3XTjfkCPmW38Hz+SqQT6SBakP1Yd+fJaKMb2AiLXb1zssMfyxh0= X-Forefront-Antispam-Report: CIP:69.169.224.2;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:b224-2.smtp-out.eu-central-1.amazonses.com;PTR:b224-2.smtp-out.eu-central-1.amazonses.com;CAT:NONE;SFS:(13230040)(61400799027)(32142699015)(376014)(48200799018)(9140799003)(261028144727099003)(260925021911599003)(260925021311599003)(260925022911599003)(4143699003)(5063699009)(5023799004)(56012099006)(261009223027099003)(261022105027099003)(261021123027099003)(261021121427099003)(261026135527099003)(261026140227099003)(261026121527099003)(10067099003)(18002099003)(55112099003)(22082099003)(16102099003)(4113699003)(5113699003)(13003099007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: nOQRsyLhSFVOlqEoARi8x7ss0SRpF++QykAu2QPILb/9zFThjiRVS2wCC7h7oZMvESdftNr5mnMUtDdSIqqUvXlUMLNil3v2nU4lRQaN5F1miNPmuR/Zr8ok7AeeaWGcTbkMqT1wCC50Lzdnk2V0iT3VxSl6BUB8d9cfUJcBZTety4zXE/5F3wNx9cA/foEmlUSMcFXfMeqq5kI5ICFGtxphzw7sqQqvwmzTA2b9/pkcU79pjG9Zzb7kJBCYupnOmQCxUbJJ+xU/Q6VtPMXbm23uDLTDp+qkLLawNFRNAr47662BshmJoH2hVE1o6chI+XFZXeBEpTn4Aa6G1ap3OQePaElwySOVzmsI3Ahz4GvULUjIf2MwOSxu6TEIbjw3LSU+eK24mMJRZ1duAb8l9Cz4107TIfTQVXJ4c+blbV0sjcteSyAr6C4WPxAsUs/L X-ExternalRecipientOutboundConnectors: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2026 11:41:54.4179 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c6740c7e-0377-4891-434f-08df35b1a17e X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-AuthSource: AMS1EPF0000008D.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-Transport-CrossTenantHeadersStamped: AMDPR08MB11483 Thank you for your contribution! Sashiko AI review found 1 potential issue(= s) to consider: - [Low] i386: svm-features-compat keeps all FEAT_SVM bits, not only request= ed ones -- commit 9fd87512847e5481366616a7120c63227cf34e0f Author: Denis V. Lunev i386: keep SVM leaf features without svm on vz types up to vz9.2.0 #PSBM-14= 4630 This commit adds the x-svm-features-compat CPU property and enables it in pc_vz_9_2_compat. Under KVM, SVM leaf features (CPUID 0x8000000a) are kept when svm is off, both against the svm dependency and against the host. > diff --git a/target/i386/cpu.c b/target/i386/cpu.c > --- a/target/i386/cpu.c > +++ b/target/i386/cpu.c [ ... ] > @@ -8996,6 +8996,13 @@ void x86_cpu_expand_features(X86CPU *cpu, Error **= errp) > =20 > for (i =3D 0; i < ARRAY_SIZE(feature_dependencies); i++) { > FeatureDep *d =3D &feature_dependencies[i]; > + > + /* CPUID leaf 0x8000000a stays empty without svm anyway */ > + if (cpu->svm_features_compat && kvm_enabled() && > + d->to.index =3D=3D FEAT_SVM) { > + continue; > + } > + [Severity: Low] The commit message says that "requested SVM leaf features stay when svm is off". Does this skip go further than that? This continue applies to every FEAT_SVM dependency entry. In x86_cpu_expand_features(), when xcc->max_features is set (-cpu host or -cpu max), the earlier loop ORs x86_cpu_get_supported_feature_word() into env->features[FEAT_SVM] for bits the user did not set. With svm=3Doff on an AMD KVM host with nested SVM, those host-derived bits = are no longer cleared by the svm dependency. The skip also bypasses mark_unavailable_features() for explicitly requested SVM leaf features. > if (!(env->features[d->from.index] & d->from.mask)) { > uint64_t unavailable_features =3D env->features[d->to.index]= & d->to.mask; [ ... ] > @@ -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; Is it intended that kept =3D ~0ULL keeps every FEAT_SVM bit against the hos= t? The result is masked only with env->features[w]. Nothing limits it to explicitly requested bits, and there is no IS_AMD_CPU() check. The neighbouring compat cases use IS_AMD_CPU() or IS_INTEL_CPU(). As a result, x86_cpu_adjust_feat_level(cpu, FEAT_SVM) can see a non-zero env->features[FEAT_SVM] and raise cpuid_min_xlevel to 0x8000000a. The kept bits can also show up in the QOM feature properties and in query-cpu-model-expansion. Guest CPUID leaf 0x8000000a itself stays zero, since cpu_x86_cpuid() returns zeros without svm. Would it make sense to restrict the kept mask to env->user_features[FEAT_SVM] and to add a vendor check, so the behaviour matches the commit message? --=20 Sashiko AI review =C2=B7 https://sashiko.vzint.dev/#/patchset/2026102911343= 6.93521-1-den@openvz.org?part=3D6