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 EE4228045D for ; Thu, 29 Oct 2026 09:58:26 +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 69T9vEAd031024; Thu, 29 Oct 2026 12:57:14 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69T9vEAd031024 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=default; t=1793267836; bh=f926RDLB4H70+NMNJ2JcQSDNXUU+vmfSLGowW9F3m4Q=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe; b=dACWfHBxCLwQ19Q7MvpNFo75ECSV7qfEFge/qfFkhudYgwxfCDGP0WfJ66mtUQLP5 JYb6V2I0BzqSLqmhJZKuYr+6xcsnMpc2/HmE2pFlzyerHyfipiZ36QTOZp4owZMSZt MPNZaIOq1hL6Tcscim8Xnf6dFtOT91Q4thEKK7Apvqn/M1RbWnyCu7B5MSXvnD5n3m vBjzOt9kOKciTUJ1n6W+TJMHXnWiAu1fCXcXKtXwVws2GNYjdbplZa8UfVcHKd7NYL 9yG/3z8kPrIaAeZYM4MSnzUjpoLUqCdxbf/CWiGmb8SZrBzSkhUN/vUc94A3eESmb0 OpjuZRzrE0GJg== 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 69T9utnK030972 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Thu, 29 Oct 2026 12:56:55 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69T9utnK030972 Authentication-Results: mail.openvz.org; dkim=pass (2048-bit key) header.d=openvz.org header.i=@openvz.org header.b="ekjttijD" Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-48c46582442so1282740f8f.0 for ; Thu, 29 Oct 2026 02:56:55 -0700 (PDT) X-Gm-Message-State: AFq9FYJp/eI9wyGaeSJOFJEZXwaxaroWBmBrZ/FLajg6P/6Evq8czWLj 3C7zfeaEtu79RRNs+z6dFNS7AvwB7rC6HzVrUEVAGMXjjwbOxmF/rKGgR3/aDfbyCYL9CCUAs0v +xv2rLXXHU4FynSAfQZU1Sr2NMizn5nbPJp1LGMx0G7TNaPepAMW1PA== X-Gm-Gg: AYBFou1CL6xUYTxDrUv+uxlj9+ObkZ6CDAlgoXWRgWR0SBtWFChSTGsfzORkgK7IBmw 4fKjfMZGsTEGkXZUZLQHYj49EdITJaKLEpvb0mAn/J5F3CGo14bEUQuiAtIE+k3kPcNWx+DdXrF yDYol+bEGgB796ug5NDA4tpjUIOjXhT/0zN3hN7gBHAWhHcT0WIthk1WQMi91SpYoW9vEpF9XoS 28K84MLQaxooh35UrCI7JroXf25/KV113eOmV76G4tdawk5vjxPuvlU4EvXQNT8B8RqR1MXyxGM gyefETBHvw== X-Received: by 2002:a05:6000:98d:b0:48d:dec7:974c with SMTP id ffacd0b85a97d-48e5d567ed1mr11694724f8f.7.1793267815082; Thu, 29 Oct 2026 02:56:55 -0700 (PDT) X-Received: by 2002:a05:6000:98d:b0:48d:dec7:974c with SMTP id ffacd0b85a97d-48e5d567ed1mr11694690f8f.7.1793267814637; Thu, 29 Oct 2026 02:56:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1793267814; cv=none; d=google.com; s=arc-20260327; b=V17iIM0jmDSOVt4/+g1t4oV+PtZRcAwE4cs864MiJem2FWzjyaKO3E5o7mQzvHyfYq U89kdvehWvvj/HoQUH9gY2SYcv7hGh0iDIBN+qlBaKPFhajhaRboKBV0rNyGZ6G9klIt ai3fDxKLGmPu3dZUCFOQufzSvUwaF60yFFOIF3wF8xOOjgVzrtSLPW2cSaDijkA/tDtH ZXlsi5m8/BVmp8DVZ1LnqsSsb2wG/HTT0czQ/mnBlzqcQFbj3DJQEv61HGs4IZ7eVg4V Za5/i2L5m63flGlbKe8lltIhGpZkVa77qX5syomOLg3AlODce+wrzoQI99qb5Anocs5f Ufzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=ZKoSDl67lmrepuVY81r98bi+BFaHDaFIXm8PDXkJoZg=; fh=Kr/R+ZQiC/tid3qUs5C3px+AHPSuipOrrdrDcZfSlMY=; b=h6whK7Ke8xlsQDeNlzV+xoTk5R98EM1HSe+GkHW6HV2Y4ITikS3dH6roouFGdmyg0v W5E2UnanQFFVHnbHzYJ1s6PtT0fw01tlvUf5YhJqxYZ2mpWLfCatiew+9+/kgpfHiw0x q9v9fLk5z3gCGh7D3oiBUmeU1dQef/gVp6hGCdCjQfaVAimUv8TAPUVrLOvjOQPrbdoM XW6OPpjoj7ZTxxAO6vdu/4ouxZHcuY3fzacNoHd4ox4iEgVyRGlVbXvjfIOrGWo1iEWf JfDagXE271TgVEjswglK3O5SBKyymw+4QKw5+bTUSNS6qfQc29lBQpd7w/roAkMe1JvL xEZg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=ekjttijD; 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-48e3ebcd21asor3157400f8f.5.2026.10.29.02.56.54 for (Google Transport Security); Thu, 29 Oct 2026 02:56:54 -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=ekjttijD; 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=1793267814; x=1793872614; darn=openvz.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=ZKoSDl67lmrepuVY81r98bi+BFaHDaFIXm8PDXkJoZg=; b=ekjttijDBe9jm90qTp2H4CSUfVi6umxv6L/D/y0SV+xTdarSWqOCEJy9JItSlnGvy5 5O+xYyDPsB6RH/mp2ZHUs+BLsJrMAEEniXGxYXP1fn+rCst4jnpA1fTXG0jl7Ehux5xd PepPL3F+ykEHDNvHFPcDmHqr/rTy12McUqnqszN4ocM1jO9UH3XupHksb3mUmP4QQtYN 2TxM6EvRdA1iXbA9q1XgYUq/xFZASs6nN/bXbUfE5sq7lDQaZ7OyJrqvUxMyILjTZHUd G4UhFvOVQzIuqqwHVhZa5HclsBAOBJNQf7tWDuJv2m94xdLh+rIKmMf5lcM25I2BnZdy Yp/w== X-Received: by 2002:a05:6000:200c:b0:48b:116d:56fb with SMTP id ffacd0b85a97d-48e5d567e85mr11820993f8f.1.1793267814091; Thu, 29 Oct 2026 02:56:54 -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.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2026 02:56:53 -0700 (PDT) From: "Denis V. Lunev" To: andrey.zhadchenko@virtuozzo.com Date: Thu, 29 Oct 2026 10:56:45 +0100 Message-ID: <20261029095645.4173762-7-den@openvz.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261029095645.4173762-1-den@openvz.org> References: <20261029095645.4173762-1-den@openvz.org> MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH 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 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 From: Denis V. Lunev Since commit 730319aef0f ("i386: Mask SVM features if nested SVM is disabled", QEMU 5.1) the features of CPUID leaf 0x8000000a are dropped when svm is off. QEMU 2.12 on Vz7 kept them, and a Vz7 host-model guest runs with svm=off,npt=on,nrip-save=on. Moving it to a newer QEMU fails in libvirt (PSBM-144630): guest CPU doesn't match specification: missing features: npt,nrip-save Add x-svm-features-compat and turn it on in pc_vz_9_2_compat: requested SVM leaf features stay when svm is off, both against the dependency on svm and against the host. The guest sees no difference, because cpu_x86_cpuid() reports leaf 0x8000000a only with svm, in QEMU 2.12 as now. Signed-off-by: Denis V. Lunev --- hw/i386/pc.c | 1 + target/i386/cpu.c | 12 ++++++++++++ target/i386/cpu.h | 1 + 3 files changed, 14 insertions(+) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 5b2b2de4064..9b6b51bd5f7 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -553,6 +553,7 @@ GlobalProperty pc_vz_9_2_compat[] = { { TYPE_X86_CPU, "x-spec-ctrl-compat", "on" }, { TYPE_X86_CPU, "x-bus-lock-detect-compat", "on" }, { TYPE_X86_CPU, "x-v-vmsave-vmload-compat", "on" }, + { TYPE_X86_CPU, "x-svm-features-compat", "on" }, }; const size_t pc_vz_9_2_compat_len = G_N_ELEMENTS(pc_vz_9_2_compat); diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 52d7ffcb9ac..0ac6fdd19c7 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -8996,6 +8996,12 @@ void x86_cpu_expand_features(X86CPU *cpu, Error **errp) for (i = 0; i < ARRAY_SIZE(feature_dependencies); i++) { FeatureDep *d = &feature_dependencies[i]; + + /* CPUID leaf 0x8000000a stays empty without svm anyway */ + if (cpu->svm_features_compat && d->to.index == FEAT_SVM) { + continue; + } + if (!(env->features[d->from.index] & d->from.mask)) { uint64_t unavailable_features = env->features[d->to.index] & d->to.mask; @@ -9138,6 +9144,10 @@ static uint64_t x86_cpu_compat_kept_features(X86CPU *cpu, FeatureWord w) if (cpu->v_vmsave_vmload_compat && IS_AMD_CPU(env)) { kept = CPUID_SVM_V_VMSAVE_VMLOAD; } + if (cpu->svm_features_compat && + !(env->features[FEAT_8000_0001_ECX] & CPUID_EXT3_SVM)) { + kept = ~0ULL; + } break; default: break; @@ -10109,6 +10119,8 @@ static const Property x86_cpu_properties[] = { bus_lock_detect_compat, false), DEFINE_PROP_BOOL("x-v-vmsave-vmload-compat", X86CPU, v_vmsave_vmload_compat, false), + DEFINE_PROP_BOOL("x-svm-features-compat", X86CPU, + svm_features_compat, false), }; #ifndef CONFIG_USER_ONLY diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 4f8bcbe600a..97e38013e46 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -2340,6 +2340,7 @@ struct ArchCPU { bool spec_ctrl_compat; bool bus_lock_detect_compat; bool v_vmsave_vmload_compat; + bool svm_features_compat; /* Number of physical address bits supported */ uint32_t phys_bits; -- 2.53.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel