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 664968017D for ; Tue, 6 Oct 2026 22:14:31 +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 696MDHKF028375; Wed, 7 Oct 2026 01:13:18 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 696MDHKF028375 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="ufZHsq5R" Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 696MD0xH028332 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Wed, 7 Oct 2026 01:13:00 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 696MD0xH028332 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4a009f82bedso15553825e9.0 for ; Tue, 06 Oct 2026 15:13:00 -0700 (PDT) X-Forwarded-Encrypted: i=2; AKwUvBymKx3xv10AkG6kriGrhgewEY/B3c8xjf9a87h9T7HlaGTkRDjPbZiAZZpQVE6BAXG/PL3vXw==@openvz.org X-Gm-Message-State: AFuF++muoec4aiEbn+C6hp/xPqpNTa4U1aC5FsRfCXAa8vZH3ljJ2sqv 6xPePz/wJcS/h0QfjM5K9AdyRdFvh0Y1ry91mCFpPrz3SLeRh/gmue6pZWXw6rfxnPS6gpG7d2R dPnutKtyQeL6PrU7LH2alSlp803Lw1aDCgi8oOilb3S7KmjMhGIVDRA== X-Gm-Gg: AYBFou3AdmJgwGUvZ6/nQYXUoT3wp/whK68311xYSlI2C87jXWzMjhANhnG6xJQ2c1C nbUE+2TZCUujehbH3wAap2L/mQe7OMfBqiRRbuEOJfNgX7js0cub+fCGjF1oknjL4oRWt8KUfmm 84qoJsrXf2164Aj5iCW9RQf6zn87jJglaaO1AdQwjQfPbJp2FYzF+bfB+xTaUA2/WToCELuxW04 TuThIjqFfLqV11KDFR4gsR4NimM0Nu3G6MFU0LZ25HxEUhtuwlOxBjiGI4HnHL9NotUOucVLKVz pIEW+X1f+viCIqp/jTs+53HUuRzqt5zMRjnVXAPk2SJ8OEwqs8xnpSbNwdfZOgoK+vicUWdsaXT /ALYzK1YbWTpFKCTc X-Received: by 2002:a05:600c:6095:b0:4a0:2835:6fd3 with SMTP id 5b1f17b1804b1-4a18041c519mr3146045e9.17.1791324779861; Tue, 06 Oct 2026 15:12:59 -0700 (PDT) X-Received: by 2002:a05:600c:6095:b0:4a0:2835:6fd3 with SMTP id 5b1f17b1804b1-4a18041c519mr3145725e9.17.1791324779363; Tue, 06 Oct 2026 15:12:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1791324779; cv=none; d=google.com; s=arc-20260327; b=h4trS1+P05EoZQkXAocSkLCK46ts7eBJ/pSmtfESngzS+mBmL6AC78xkqra382oisq wa4lDdluRwyXuKNf4U3l6J+3i/zSGJJrY/gk/qIwhNboipq+E4DjnJfbP57gVD79KJy8 JV5JUUn039jZVy2/yHzctsMOpO+Ah8+UrHooV03MsL3MDLkhy9QTKmd6sXqur7/MsD5k zoXyAAv+9h7bBCnSdVZv1EEnRS+FjH20/XSWuWwogAVWK8IhfcVip6ufTJ+m9t9+F0c0 qnnz1hxftxnWAiTcFxG30xFYJ5PG8IQxciJPT0oGNqnszpR5Li1TsoQfni99wpU9VNfq TDUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=X95n0bIp2s6/Q7z3IqSg7S08NB2iiJH5NWmOygQWA5E=; fh=bRkZfFa6377EgOVW8zBDri2gGIQqe/ZeiH+ijEM/ROI=; b=aQKsxcdFiPVlVKqpQF0wogV7+7sDmYRruBJSpfOkrNnik94ggZFcS87d65myOuPahb +MnZF/eoO9gIGZRfAp5TqUISlQBvWsySYMiBbzEpxzki3EHnEQzCD63OHCwJp9IBcSTx mpIoRvNRHbOYk+lMhwIr/1DERn+SnsY7NDXQzXkmKSk2TwaWtwjLUCU9X2MsveOSJgEE 6ND9P44FtnuldgbZD+ai0/ynZrZqOjNZjabNW0yUI+qRT9v4HRcC4xMrygHuGOX91PsV /HoYyYtdtpWgzbWUAXiE8nkXg+cP8MuD2Cu2GQO1NXrATVl9VksqKZVpK6OTdXROz0A3 3kTQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=ufZHsq5R; 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 5b1f17b1804b1-4a178ca9076si84298805e9.11.2026.10.06.15.12.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Oct 2026 15:12:59 -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=ufZHsq5R; 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=X95n0bIp2s6/Q7z3IqSg7S08NB2iiJH5NWmOygQWA5E=; b=ufZHsq5R14z8pZDsi/L Ctc2g7nCnU/0q2sZOuiTOMSoxmP38lSDJf5cSbxWuCSjOUbdhhJkMI9w/7Ar7reQyvrEyZQpwRp/l oN3mMnIOUc1elyYB+sbjNEkGKevjVFwwB4Sz1tst7VlAPTnNKCdJkI7yQ84sTEtzPwmqrwrpCeCfB Hc1wyOYdkzLiknwN12W92ouvMXrsVB+S6f9LDt18jdhpn6KEDj8iMCTLFV1w+tF6fciCgI7GjMCjl ie1gr/eW2cMSxGtD2reeUiC9HHaDe1EwBIZELqZsxhEai/AvDsmqtZK4cUlF0SVhe/ambaDJuRwGM qy/2qBWRfXgfxWA==; 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 1xEDLt-004aGG-2T; Wed, 07 Oct 2026 00:12:48 +0200 From: Konstantin Khorenko Date: Wed, 07 Oct 2026 00:12:55 +0200 MIME-Version: 1.0 Message-Id: <20261007-b4-prep-khorenko-vstor-148656-cpuid-v4-5-bf16c29bea24@virtuozzo.com> References: <20261007-b4-prep-khorenko-vstor-148656-cpuid-v4-0-bf16c29bea24@virtuozzo.com> In-Reply-To: <20261007-b4-prep-khorenko-vstor-148656-cpuid-v4-0-bf16c29bea24@virtuozzo.com> To: Pavel Tikhomirov , Vasileios Almpanis X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2187; i=khorenko@virtuozzo.com; h=from:subject:message-id; bh=4gMJMUYNkZP+eTImcC5g7nc2LYLlDczt5WO8atOdYss=; b=owEBbQKS/ZANAwAKAVGWCkf5YVwqAcsmYgBqxXJp+tyfSVDoEHSWwCFOaOlQApzFKgdZ91Y50 EITf8f6KfCJAjMEAAEKAB0WIQRWD23IPcXT0GO9CCxRlgpH+WFcKgUCasVyaQAKCRBRlgpH+WFc KugXEAC8Qx6BP8Rm/Fu5imzJXbmT3KQUabTRbYq0KNzko20OrakdLNtmFxy/8/Sikfp3BGVcEL7 oy03pNyOxt6qT9aV+I8Lfd84L8WTy7DR8FhSwawWWm6iXMSJBCC+oT7/R9gYO5A4vRcl6sX47Wg 5WTcWgJIO53FYVb6VsQ9LGGLx3p1H8KvZeuFjXcOmIA13dQYgJjOEqNHW1E1ra44BzesiGAAZUo 2N2PxckZBrisyRaLZmt8LbojOAANNzvs22FQ/b3aN7sG7P319uWVI3Bh4XK7t7vwKdX2aycFGzx R5m01ROzOvfiJYirvw+ZdBpa7nvMBYJ5ALcJEVj6wCswUg+TsBLCX6UJ6uhKtsJTpqcZrTRQi3+ sn0MVAp8Fg529DNdRqsOus54lOYTUNLXgEiOfyafCb58EGrgdpvJ0ww9YS6bHmbEMvWZk6+0C1o 8xSZ86d8bEAMpPzBC8whAvCip1eYemGYghkvHN153AEJtD1GcgMRyBvRRRAR0Mnr+lfTawurWVc Bf65aMb+666hao7QuAvWmjwIj+U38QVIUAJAeINGepWd6t/KxHRsQbObY6Th1o5QTh4k7NqrzNs Jjcpcnd06AfYqZiY0KzlOsRRx1UopJo3uUG3Kr1ggzHuyLnPQVQ+g/8B9s28pSn7ZmK8FjqwnOf OhUxgbc7EwNBKsw== 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 v4 5/5] selftests/ve: check CPUID override emulation for a prefixed CPUID 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 Execute CPUID with an operand-size prefix, which the CPU ignores, and expect the table values. Before the kernel change the #GP handler matched only the bare opcode and the child died with SIGSEGV. https://virtuozzo.atlassian.net/browse/VSTOR-148843 Feature: x86: cpu pools (cpuid override) Signed-off-by: Konstantin Khorenko --- .../testing/selftests/ve/ve_cpuid_override_test.c | 29 +++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/ve/ve_cpuid_override_test.c b/tools/testing/selftests/ve/ve_cpuid_override_test.c index d940acc7ee792..a640f6b9f2f14 100644 --- a/tools/testing/selftests/ve/ve_cpuid_override_test.c +++ b/tools/testing/selftests/ve/ve_cpuid_override_test.c @@ -48,9 +48,18 @@ static void do_cpuid(unsigned int leaf, struct cpuid_regs *r) : "a" (leaf), "c" (0)); } +/* CPUID with an operand-size prefix, which the CPU accepts and ignores. */ +static void do_cpuid_prefixed(unsigned int leaf, struct cpuid_regs *r) +{ + asm volatile(".byte 0x66, 0x0f, 0xa2" + : "=a" (r->eax), "=b" (r->ebx), "=c" (r->ecx), "=d" (r->edx) + : "a" (leaf), "c" (0)); +} + struct child_ctx { int result_pipe[2]; int stop; + int prefixed; }; /* @@ -71,7 +80,10 @@ static int cpuid_child(struct child_ctx *ctx) if (ctx->stop && raise(SIGSTOP)) return 22; - do_cpuid(CPUID_LEAF, &r); + if (ctx->prefixed) + do_cpuid_prefixed(CPUID_LEAF, &r); + else + do_cpuid(CPUID_LEAF, &r); if (write(ctx->result_pipe[1], &r, sizeof(r)) != sizeof(r)) return 23; @@ -272,4 +284,19 @@ TEST_F(ve_cpuid_override, armed_before_first_reschedule) } } +TEST_F(ve_cpuid_override, prefixed_cpuid_is_emulated) +{ + struct child_ctx ctx = { .stop = 1, .prefixed = 1 }; + struct cpuid_regs r; + pid_t pid; + + ASSERT_EQ(write_file_at(AT_FDCWD, CPUID_OVERRIDE_PATH, self->table), 0); + + pid = spawn_cpuid_child(_metadata, self, &ctx); + resume_cpuid_child(_metadata, pid); + collect_cpuid_child(_metadata, self, &ctx, &r); + + EXPECT_EQ(r.edx, self->host.edx & ~self->bit); +} + TEST_HARNESS_MAIN -- 2.43.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel