mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Borislav Petkov <bp@alien8.de>
Cc: Ronan Pigott <ronan@rjp.ie>,
	linux-kernel@vger.kernel.org, x86@kernel.org
Subject: Re: UMIP and clearcpuid=
Date: Fri, 14 Aug 2026 14:12:47 +0200	[thread overview]
Message-ID: <20260814121247.GI788244@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20260814115045.GH788244@noisy.programming.kicks-ass.net>

On Fri, Aug 14, 2026 at 01:50:45PM +0200, Peter Zijlstra wrote:
> On Thu, Jun 11, 2026 at 08:37:36PM +0200, Peter Zijlstra wrote:
> > And UMIP really is useful; these are gnarly instructions you really
> > don't want, so as along as it all runs it should be fine. I suppose I
> > should go re-enable it on my own machine and actually spend some time on
> > it if/when I find another game that flat out doesn't work with the
> > emulation.
> 
> I've been searching the web a bit and found this:
> 
>   https://cs.rin.ru/forum/viewtopic.php?f=10&t=159989
> 
> That's patches and crud to work around Denuvo DRM for them software
> pirates Arrr!. Anyway, the interesting bit here is that they require
> UMIP to be disabled.
> 
> AFAICT the DRM thing fingerprints the system and what they do is spoof
> it all to make all machines look the same, so a single prepared game
> image works, because fingerprint matches.
> 
> The fingerprint includes CPUID, which we have CPUID faulting for (they
> use a hypervisor for early AMD chips, because AMD 'forgot' to allow
> native CPUID faulting) but also UMIP.
> 
> The problem with our UMIP emulation is that they break the fingerprint,
> while with UMIP disabled, the Linux values match the Windows values
> close enough for it to magically work.
> 
> When I first found this (a few weeks ago, during holidays), the forum
> post seemed to have a little more detail, specifically there was some
> patch to 'fix' the UMIP spoofing. I cannot readily find that now.
> 
> And while in general I don't suppose we should condone software piracy,
> I don't think adding a prctl() to influence the UMIP emulation; much
> like we have CPUID fault handling, is too much to ask.
> 
> The earlier forum post seemed to be cross about UMIP emulation not
> working the same as CPUID faulting, but that misses the fundamental
> difference between these two. CPUID faulting is opt-in, while UMIP
> emulation is always on and cannot cause faults userspace is not
> expecting.
> 
> Anyway, just figured I'd share.

Supposedly, according to Gemini, the below 'patch' is sufficient to
'fix' things. I tried and failed to get a reference to the thread
where it originated though.


---
/* arch/x86/kernel/umip.c */

 static int emulate_umip_insn(struct insn *insn, int insn_idx,
 			     unsigned char *data, int *data_size)
 {
-	/* Current upstream logic: sets up a high-canonical dummy address space */
-	unsigned long dummy_base = -1UL << 32; /* Taints high 16 bits with 0xFFFF... */
+	/* The 'Compatibility Fix': Forces high 16 bits to 0x0000 to mirror Windows */
+	unsigned long dummy_base = 0x00000000FFFF0000UL;
...


  reply	other threads:[~2026-08-14 12:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-10 19:46 Ronan Pigott
2026-06-10 20:00 ` Borislav Petkov
2026-06-10 20:41   ` Ronan Pigott
2026-06-10 23:55     ` Borislav Petkov
2026-06-11  7:53       ` Peter Zijlstra
2026-06-11 16:09         ` Borislav Petkov
2026-06-11 18:37           ` Peter Zijlstra
2026-06-12  2:21             ` Borislav Petkov
2026-06-12  6:42               ` Peter Zijlstra
2026-06-12 14:49                 ` Borislav Petkov
2026-08-14 11:50             ` Peter Zijlstra
2026-08-14 12:12               ` Peter Zijlstra [this message]
2026-08-14 12:57                 ` Andrew Cooper
2026-08-14 13:23                   ` Peter Zijlstra
2026-08-17 21:39                     ` Kenny Wottrich
2026-08-14 12:19             ` Peter Zijlstra

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=20260814121247.GI788244@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ronan@rjp.ie \
    --cc=x86@kernel.org \
    /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

all inboxes | Powered by JetHome®