OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
From: no-reply@sashiko.virtuozzo.com
To: Vasileios Almpanis <vasileios.almpanis@virtuozzo.com>,
	Konstantin Khorenko <khorenko@virtuozzo.com>
Cc: "Denis V. Lunev" <den@virtuozzo.com>, devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.1] x86/traps: emulate CPUID faults for user tasks in exc_general_protection()
Date: Tue, 6 Oct 2026 08:32:56 +0000	[thread overview]
Message-ID: <010701a110582c91-3f2b5802-cda9-4d7f-bfa7-baf5421a88eb-000000@eu-central-1.amazonses.com> (raw)
In-Reply-To: <20261006-b4-prep-khorenko-vstor-148656-just-cpuid-v1-1-6f2a2a6deef3@virtuozzo.com>

> 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 <khorenko@virtuozzo.com>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261006-b4-prep-khorenko-vstor-148656-just-cpuid-v1-1-6f2a2a6deef3@virtuozzo.com?part=1


_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

  reply	other threads:[~2026-10-06  8:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-06  8:30 Konstantin Khorenko
2026-10-06  8:32 ` no-reply [this message]
2026-10-06  9:30 ` Vasileios Almpanis
2026-10-06  9:36 ` Konstantin Khorenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=010701a110582c91-3f2b5802-cda9-4d7f-bfa7-baf5421a88eb-000000@eu-central-1.amazonses.com \
    --to=no-reply@sashiko.virtuozzo.com \
    --cc=den@virtuozzo.com \
    --cc=devel@openvz.org \
    --cc=khorenko@virtuozzo.com \
    --cc=vasileios.almpanis@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox