From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (unknown [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id 1F5AE8017D for ; Tue, 6 Oct 2026 14:58:17 +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 696EurAP025520; Tue, 6 Oct 2026 17:56:54 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 696EurAP025520 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="lmxZuiYt" 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 696EupRk025496 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Tue, 6 Oct 2026 17:56:51 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 696EupRk025496 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-48af5a07314so2144475f8f.2 for ; Tue, 06 Oct 2026 07:56:51 -0700 (PDT) X-Forwarded-Encrypted: i=2; AKwUvBxUzsLrLuW9EKVGjHyezbsURCr85KkIVuLs8O1BhtWTdtdIuPPwCie4N68jUd4RJzsWWwrjKg==@openvz.org X-Gm-Message-State: AFq9FYJ8N7BD0UeMQ5Q5awvs+sfgO+A3tHljVazT+bwyL1SH/CL690vV 56p/79yrTu6FlfVXYWUCl4yogNT9usfOI1RsSlaXKmSgGuEYX9EFfySm5Xgmjbbt7U03InXVMKO 4Y5mFEtTPON4Kt/gwuZIUCS5QclmLaj7wI5gtuH+JcFTERPM0vz9e+w== X-Gm-Gg: AYBFou1EWDybAG0hDA2ogZKjn0UivRdncDREdrW3Tb8v4qmZvOqqxTQFaHId3LhxO7+ ExvWgrfKlVhBLYgwLzHjjL7C77xwq8nwW8yOs96MeFe2+t47ZtnZVkHae2+YR/J7QGqDOmHbAl0 dHQez2aODRX7QZrdWLExhOcBtp5uxKuwJpA9od+xFd40OQfGpG4B+sHTw87fumSBgB9bgxE/eMB knyPdGcv3v2dHjTe/nRjt5tmeA/2QfTbEQpN4cO6cq3R6ugNdZLyBISz/xEfUKT1IamwzyDjNsk qVRJ8a8/CUAZZBnZmZpf460qS5rd1M8E6O1ZbsauPHqpEiZCD6xjIZw+h+FKcv6bIR/07hwKeAf kxN7tSU8JdjAhBv9plA== X-Received: by 2002:a05:6000:26c6:b0:487:342:d141 with SMTP id ffacd0b85a97d-48c6d16f9a4mr3210125f8f.23.1791298611516; Tue, 06 Oct 2026 07:56:51 -0700 (PDT) X-Received: by 2002:a05:6000:26c6:b0:487:342:d141 with SMTP id ffacd0b85a97d-48c6d16f9a4mr3210063f8f.23.1791298610838; Tue, 06 Oct 2026 07:56:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1791298610; cv=none; d=google.com; s=arc-20260327; b=gtlACmQVZVfE8UZa2Re2PakMHLqozI+ogj+XMsiKgUBfot1zX99rVCTS6iqJxv+q3h ZkavxnRnH6ituuuw+VdR/4MCPAItv3ShHH7s426mimCxa8S/oUCUMOhFG5gWYC3HNiLp ENsfjvEcX2qDUgnIdprU1GNaKaKxhxs84k36cKS4g+v6xLHRjpK3BoiDyjRpe+0byJbx SjGvdlkv69KfdMo0Gwbbm43PFoIGmbCyhK00q+2CGuJETMtvn22cYujQw3/q/yPoO25+ iHFxSLAoLNN7HzGTXCOP3eX+lcAoViMkMrI0wdccDTTS8OWUZ6+m8d57h3deWTiCpJeG +Hxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:dkim-signature; bh=Zqa7jKfkxxlft+SetjCl3ocB/JUfbQGFi5sksAGaBHw=; fh=bRkZfFa6377EgOVW8zBDri2gGIQqe/ZeiH+ijEM/ROI=; b=c+uHpChllEx7zXcKySzNyAVzSXZgPzdtnPNSWyFdABiMdkvfDgcL5p82ETVjYCiu52 eZGVxYhcqCpWXsaySSJTT/m2d7wMxjVHS9gzv7JATsRrSW29JTdrmieyiRi5Ku8xrCUP 0XzhCZTbQFy9xdFDF0g4LM3pTVVP2kWJKKk2g/CxpDYMT6V873OYqmw0p/81UTauxZW6 Sjux2t11g+Zfo9pnQ0Edmib2mrvzfN4xLVelTnhKML5SP3eAGES/ZHXCi5KASLoOtYmA ldJuc+Ktul6MN+vmDoHH0AAlgcLtaxWlzN4BufcZH5xZJ0kOo+3aS7M/fQD46+6baz/F EhJQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=lmxZuiYt; spf=pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=khorenko@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from relay.virtuozzo.com (relay.virtuozzo.com. [130.117.225.111]) by mx.google.com with ESMTPS id ffacd0b85a97d-48b5b325201si26631021f8f.208.2026.10.06.07.56.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Oct 2026 07:56:50 -0700 (PDT) Received-SPF: pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) client-ip=130.117.225.111; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=lmxZuiYt; spf=pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=khorenko@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=Content-Type:MIME-Version:Message-Id:Date:Subject :From; bh=Zqa7jKfkxxlft+SetjCl3ocB/JUfbQGFi5sksAGaBHw=; b=lmxZuiYt919gcXATY5x JK/jdmJc/k4IGtgIJe/Cdg4gnJtzYVLh/H1h60QZhpkmAZ3/9hCjtUL3f9yLYX7gsEO5DGxzjd3rK foRu9dhuB324EinRso4mRH2/EGTy0Ze4plw8mXTHlkbrXRC1Wfion3Z7yxacGlZg/gq4ptD7dlBmj WGBmcrF9eLnaJM4epq/la8V+zuYfxrGKq/bIkRAiKnvws4uVYviY5twHqULy589m28v/c2c6gfhHq foH9BfIAYTnRp24iL7Yw/X2Lb0YCWbnpPGMfL8cAXUoFzYWpwD03Y5rMOjk2tUYZPp9Pri25ik99R uPrEu/sDRGcmZVw==; Received: from ch-demo-asa.virtuozzo.com ([130.117.225.8] helo=f0.sw.ru) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1xE6Xp-00DosW-1Z; Tue, 06 Oct 2026 16:56:40 +0200 From: Konstantin Khorenko Date: Tue, 06 Oct 2026 16:56:33 +0200 Message-Id: <20261006-b4-prep-khorenko-vstor-148656-cpuid-v1-0-741609f4f03a@virtuozzo.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIACEMxWoC/yWNQQqDMBBFryKz7pRETYi9SulC49hMhSQkKgXx7 o12+fj893bIlJgyPKodEm2cOfgC8laBdb1/E/JYGGpRaymExqHFmCji7EIiPwfc8hISytZopdH GlUfslVVd15CcTAPFVA4Tf6/KE5xlNHcJr/+Q1+FDdjkbcBw/qWaIM5AAAAA= X-Change-ID: 20261006-b4-prep-khorenko-vstor-148656-cpuid-a5c5993e1f83 To: Pavel Tikhomirov , Vasileios Almpanis X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2911; i=khorenko@virtuozzo.com; h=from:subject:message-id; bh=rVw4TGkc1BBxA2LsMuZ1bac+v6Vf3CYwC6ejmqC5B5Q=; b=owEBbQKS/ZANAwAKAVGWCkf5YVwqAcsmYgBqxQwwgt1a7aP8ixhZ9Wk76aTA1h/o+fPlNFMrA s01SGrafZeJAjMEAAEKAB0WIQRWD23IPcXT0GO9CCxRlgpH+WFcKgUCasUMMAAKCRBRlgpH+WFc Kuc8EAChbUC+oGNO3e9z6+sPreZ8w4HWETkV139g282zg8IsV608LKyM6nUbU7DyXQLWwgalKwJ QuUSPsJ2UewaHv4Pd/n9JzRtFG8GBOudqYS5CGUqkxBerBzEcjlBoAVo4DynzEirv39Z258QNrC cAFA1UEedjR8uXkUUvNtjruzZcdgx1RiEiUGNYyNMIJXDV2LnMG7C/vR1tIsItHPTKR4RLWFQfA JcS4I2Y/k4TNBSdm666bd3tUMsmN5EquLoOCj0GBzToYc5rfQyCUktW+w6o4Rqv8A+gHeJNRKlT y4tXPjCKjkizZYGdLnwt106QaW988Z2dIt/zEBi83ibIJpfGTIiDHyuSo5HnZbzck6IaLvO+Dqr xHFDvL1GfD+Aq5spHZ4+Or14Aiv7OwYb3YPq+bqwFkgAbUwUv56A+Pl+O3E5tObYQRagEYbllm4 BpI9p64lWWarFkEqtyYFG7EjHJBuiTfkJbGBXnk81rSk30zH3H37/rtyJ6Gqgn5oUZzm8Ftj1g9 Xd4VpZgpUBrsTOn88SWVmqfD0xxh1DtGo04CQ0u37KYG25Hk0Y9MFNsjEaK8q0eJtOpFZ2cKahg TAg3N5z65/BO0z9TvsAqsCMbuch9Sg1FBCfna+0BwywYf0e8vGcjDDj+w5rMP6wmB2KK1qso5+c Igi6U3PVVFCR7sA== X-Developer-Key: i=khorenko@virtuozzo.com; a=openpgp; fpr=560F6DC83DC5D3D063BD082C51960A47F9615C2A X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.1 0/5] x86/ve: CPUID override follow-ups: arm at once, prefixes, selftests 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 VSTOR-148656, every Container start dying with SIGSEGV once /proc/vz/cpuid_override is non-empty, is fixed in 22.8 by 07338fbae5a3 ("x86/traps: emulate CPUID faults for user tasks in exc_general_protection()"). Working on it turned up two more defects in the same feature, and the fact that nothing had ever exercised it. This series takes care of those. None of them is a 22.x regression, all have been there since the vz9 port. Patch 2: ve_setup_task() only sets TIF_CPUID_OVERRIDE, the MSR follows at the next context switch. A task entering a VE through unshare() or setns() executes CPUID natively until it is scheduled out and sees the host values. set_cpuid_override() flips the MSR synchronously for the current task, the way disable_cpuid() does. Patch 4: check_cpuid_fault() compares two bytes at ip with 0f a2. A CPUID with a legacy or REX prefix faults the same way, but the handler sees the prefix and the task gets SIGSEGV. Use the instruction decoder, as fixup_umip_exception() does, and advance ip by the decoded length. Patches 1, 3, 5: selftests/ve/ve_cpuid_override_test. Each kernel patch gets its own case. The test saves and restores the table around every case and tears down in the parent, because the kselftest harness skips a child-side teardown after a failed ASSERT. Tested on sqvm2-4060, the node of the failing CI run (Broadwell VM with cpuid_fault, cpupools-features 9.1.7, so the table is armed at every Container start). With only the 22.8 fix, cases 3 and 4 fail the way their patches describe: host values, and a child killed by signal 11. With the whole series all four cases pass, repeatedly and on a non-empty table, and the vzctl-pytest start cases from the original ticket pass as well. https://virtuozzo.atlassian.net/browse/VSTOR-148843 Signed-off-by: Konstantin Khorenko --- Konstantin Khorenko (5): selftests/ve: check CPUID override emulation for VE tasks x86/ve: enable CPUID faulting at once when the current task enters a VE selftests/ve: check CPUID override right after entering a VE x86/traps: decode the faulting CPUID with the instruction decoder selftests/ve: check CPUID override emulation for a prefixed CPUID arch/x86/kernel/process.c | 12 + arch/x86/kernel/traps.c | 16 +- include/linux/cpuid_override.h | 3 + kernel/ve/ve.c | 2 +- tools/testing/selftests/ve/Makefile | 1 + .../testing/selftests/ve/ve_cpuid_override_test.c | 276 +++++++++++++++++++++ 6 files changed, 303 insertions(+), 7 deletions(-) --- base-commit: f5d1fdcfffe101fe2bafa7df09d95d2e811c5c5e change-id: 20261006-b4-prep-khorenko-vstor-148656-cpuid-a5c5993e1f83 Best regards, -- Konstantin Khorenko _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel