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 49E40802A5 for ; Tue, 6 Oct 2026 08:31:47 +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 6968URDc022661; Tue, 6 Oct 2026 11:30:28 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6968URDc022661 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="SEGybl4t" Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6968UPVC022657 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Tue, 6 Oct 2026 11:30:26 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6968UPVC022657 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-48c415561aaso1667317f8f.1 for ; Tue, 06 Oct 2026 01:30:26 -0700 (PDT) X-Forwarded-Encrypted: i=2; AKwUvByEVSo02/ZBch2H8cj/I+x3+QvCha/T3H2ET2MNgnOeBB/p7CGuEpJerXIy4htV5FWu6TTAIQ==@openvz.org X-Gm-Message-State: AFq9FYJcWdi6aEUG0M6nBjUyIx6kvyV92vaunKuYXNuwVP4CcJ1LR7tt Eir1qm0Fos4G2iDG9LNrS/lAUZ+xaGjaXnrNW3lS5UKSx2ZcmaPmojNHY+/EmYxZiqFHK8IG4Dl ONmR4opvvEANvAcTK9hc1ySJtjcX0mbWo81I3uCzZxU6t3EhybkBuIQ== X-Gm-Gg: AYBFou06w+R0/LT3hLL4HUjHLBtg+JeE5kywbeyzfs4Wa48TJrxeu0SbvFpjUCG7yFj tXlsnCsmj7H2ZJYYnX4nT1PxikXBrtc883/OnKi13qNtUFgseqj5vTzCIbMZdOIU4hJcwmkZhEJ id57zowM5jsBF+gDy31TvEukI+qgp7PenJNC5WY1H95Ub2tsDZbCfcsLL3N2rWt6/OaldRqei8L IZuxQa4Pwl05No14VOZrMdYXKG30oe328+6NhtheNL3xf9WwYZbl1KIkkrHkexwRPVVPInQT+B3 WYn9wOOTJFeOJt9LymwjZ8kKTx/zPHdOO9JcG2sCRUsnUh7cLNbV2PvS2JYHAqaHijF/c+5pZpL dmEfBPekiaUmjsM4u X-Received: by 2002:a5d:5847:0:b0:487:c43:e606 with SMTP id ffacd0b85a97d-48c6d1588cemr1427827f8f.15.1791275425557; Tue, 06 Oct 2026 01:30:25 -0700 (PDT) X-Received: by 2002:a5d:5847:0:b0:487:c43:e606 with SMTP id ffacd0b85a97d-48c6d1588cemr1427732f8f.15.1791275424725; Tue, 06 Oct 2026 01:30:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1791275424; cv=none; d=google.com; s=arc-20260327; b=fx2FYSkMkqqq0YBPm1eoxaIswfOChLf55nahcqm6U3yeGWAyOw1b2UB1GilXTYf49H E1Klt5kLD+JqUwqjWshDGCyl0DRWXDXxH2coh6nravd1No4PK1E7yGnD5xns7UgsP4Zx Foy/SiR2Cz6OXPd9r5TA8RFXwY8pO6HOhpYWAqugUiLv53SDPuulgxPfTKcfpVbAs7ap eaJP1x7dvLZYK0uexYQFkhF+4yqQ2Ij5c9a6q3P5OxrZtAGfHbFcyuyJTFQ6GP/hFKNp 7y0G9TL+GfSP/HjyH8scoVvAPiJvq1B/sWpnuyYVl1UCISxsNSS4MyRrYR7/XPldAxzG 9GMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:dkim-signature; bh=7ciM+sbPmzFtJl7MUN6p9OTSia/qevCit/a2RYlpj+g=; fh=Az4IssEK0fJEva1PRtKZ8zefzB6iKhOYeiE3FUjflpc=; b=eZiLFPYW9qyAQRoOp/6m5CGtep3zJen9HiLpiQAVdWvH/pcvGYDT71VGdwiJjDOk4T B4QGhs4kRYDV9ULnEpxBNszhGR6v3BsHhifBBSZl20sUMCJvwtBO/iHmxS9gRfRiEDv8 5TqWp8d4dIm0DPwU5val5CRFtF0b++K6ln+eNAkn1RVqE/DKxUNsOoHMH953i0pCpJeQ bRBq5WN0AvY6YazTMKS5wweHVDzN3LOYfYBSk0ggHnCNBNKm/3m0Ppum5yNBSm7NiMs5 KMYk40Bn4j82h/Z8jZ+A/6f1HtSNJr7HiR5bO2Fui8G2whMC2qrV7tfvYSF3UYCZ0Kns W48A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=SEGybl4t; 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-48b717a2ee0si22100931f8f.85.2026.10.06.01.30.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Oct 2026 01:30:24 -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=SEGybl4t; 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=Message-Id:Content-Type:MIME-Version:Subject:Date :From; bh=7ciM+sbPmzFtJl7MUN6p9OTSia/qevCit/a2RYlpj+g=; b=SEGybl4tolLzJfOA8c4 Qf+LSroBCN42tN9ypghSzmrFSZc0sDsyAECcYiXUVtAug8XgIbiUZArIl0LnPQ3qvhQhMeD1Awfwc i1jxYOnFDSgWlMCQT9KFfPS29HoOOEUji1kQlPs43wAV/Y6pGN6DYtWbgEQcYSGN1BUtTXtL8w4fL F1rvKruraRmzV9y5iD1B0mUTYl17R4JWcIEaiUVXKgpdjD++GaA6eIu+d5Lm2YD/0Ud57liJVzLLc TjzrOrg43P59EtSMwG/HZ+WJk6aUIh418b/8yeUnPnqJGk3CgrsNaQlMN/GIdyEw1zvwScHY6MmUI IT5BbeB5kdkrihQ==; 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 1xE0Vr-006OiD-0c; Tue, 06 Oct 2026 10:30:14 +0200 From: Konstantin Khorenko Date: Tue, 06 Oct 2026 10:30:19 +0200 MIME-Version: 1.0 Message-Id: <20261006-b4-prep-khorenko-vstor-148656-just-cpuid-v1-1-6f2a2a6deef3@virtuozzo.com> X-B4-Tracking: v=1; b=H4sIAJqxxGoC/yWNQQ6CMBBFr0Jm7Zi2qRW9inEBZbADCSWdlpgQ7 m7V5cvPf28HocQkcG92SLSxcFwq6FMDPnTLi5CHymCUcVoph73FNdGKc4iJljniJjkm1LZ1F4d TkYx+LTzgtevM6G7WqtZD1dXXyO9f6gHBM7ZnDc//IKWfyOdvCI7jA7GxlN2VAAAA X-Change-ID: 20261006-b4-prep-khorenko-vstor-148656-just-cpuid-7aa2f694408c To: Vasileios Almpanis X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2654; i=khorenko@virtuozzo.com; h=from:subject:message-id; bh=iGFvUFXd1lZTl5ZkvMnNlYOGj+1qk+zVteIVdr9cyC0=; b=owEBbQKS/ZANAwAKAVGWCkf5YVwqAcsmYgBqxLGeW/gwJZ6VCM4+p4fYmQ+I61KmiNq72WPpA sXfF73kQm6JAjMEAAEKAB0WIQRWD23IPcXT0GO9CCxRlgpH+WFcKgUCasSxngAKCRBRlgpH+WFc KsiND/942i6GbdjrJKrIjnhUJjyihzqF58eJozuaVt32QS7MVLVViSV3mZqTHw49Owrj+27nzoD o99QFPN7GT0UdYNQo0OAKDzBlAT8C64WsEhcZoSj5xwzKfYLu5du4zaCB2wlQK2MrL+0Ba2qVP6 mHWYFc5fCBMdO3SzTdH/t5cS4kSgLw/t/3aM6xC8s19331ZNLLYtb4pn+onYWnCufowippRfu9g oiZvj15ZXNK3/ASy3UVIdibYQVBAlyMmdv1ZPzZOEIwWcQXqYDL2GvjTm2DUB8Nz9FNL7EPRI76 oe8rPX6plNBNGe6dteRU4MpbaSmjaygKZMCZQm0GXW+pMnBQ00++OsrUe2xbztQXr40DLeXtCU6 MSxlbxs9MOFx6+7U6qzvI/3/lEB+HtR8A0lPtKAbSvWK/eHB/BY/7FckxMLr+MJvsgriCbc30C6 0+YbmopaQwZO6kHK2dyuBIHg7NokD30D9OsxbY2FkmzGJA1HIWX7qelgC+ZBlzemQPFGtoomn/c E8e21myYjTkGly07cpWo6WJa7E37Bj53hAXjq3u8BT/99Qtgl21d9IQyqnJempJp46FplTCTmAY kbphJRPflTgDfpXM1K+1Ato/iWwB80b3ZM0xONjU9WF/UectxtBZve4RF15IMAMNV0CudiyNFiH CFFsPUuWotMh5qA== X-Developer-Key: i=khorenko@virtuozzo.com; a=openpgp; fpr=560F6DC83DC5D3D063BD082C51960A47F9615C2A X-OZ-Fwd: true Cc: "Denis V. Lunev" , devel@openvz.org Subject: [Devel] [PATCH hci-8.1] x86/traps: emulate CPUID faults for user tasks in exc_general_protection() 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 A non-empty /proc/vz/cpuid_override table makes ve_setup_task() set TIF_CPUID_OVERRIDE on every task entering a VE, so the CPU raises #GP on each CPUID the task executes and check_cpuid_fault() is supposed to emulate the instruction with the table values. The call sits after the user-mode branch of exc_general_protection(), which ends in gp_user_force_sig_segv() and goto exit, so it is reached only for a kernel-mode #GP, where CPUID never faults. Every Container task dies with SIGSEGV on the first CPUID of glibc init_cpu_features() instead of getting the override: traps: bash[179661] general protection fault ip:7fa8b470357f ... in ld-linux-x86-64.so.2[1857f,...] The original vz8 patch was written for 4.18, where do_general_protection() handled kernel mode first and the call landed on the user path. The vz9 port kept the relative position after upstream had reversed the order of the two branches. Move the call into the user-mode branch, before the signal is sent. check_cpuid_fault() still declines tasks with TIF_NOCPUID, so arch_prctl(ARCH_SET_CPUID, 0) keeps its SIGSEGV semantics. Fixes: 1033fe455434 ("arch/x86: introduce cpuid override") https://virtuozzo.atlassian.net/browse/VSTOR-148656 Feature: x86: cpu pools (cpuid override) Signed-off-by: Konstantin Khorenko --- During this bug investigation i have found several other issues relarted to cpuid virtualization, so thye will be covered by another series, and this particular patch fixes the blocker alone and in the minimal way. --- arch/x86/kernel/traps.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c index 7c2320c46abf0..8074387bf4f43 100644 --- a/arch/x86/kernel/traps.c +++ b/arch/x86/kernel/traps.c @@ -798,6 +798,9 @@ DEFINE_IDTENTRY_ERRORCODE(exc_general_protection) if (fixup_vdso_exception(regs, X86_TRAP_GP, error_code, 0)) goto exit; + if (check_cpuid_fault(regs, error_code)) + goto exit; + gp_user_force_sig_segv(regs, X86_TRAP_GP, error_code, desc); goto exit; } @@ -805,9 +808,6 @@ DEFINE_IDTENTRY_ERRORCODE(exc_general_protection) if (gp_try_fixup_and_notify(regs, X86_TRAP_GP, error_code, desc, 0)) goto exit; - if (check_cpuid_fault(regs, error_code)) - goto exit; - if (error_code) snprintf(desc, sizeof(desc), "segment-related " GPFSTR); else --- base-commit: dcd9000e6b239a27d1450a9ac7927a41596733e8 change-id: 20261006-b4-prep-khorenko-vstor-148656-just-cpuid-7aa2f694408c Best regards, -- Konstantin Khorenko _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel