From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 65BA5189F43 for ; Fri, 14 Aug 2026 12:12:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786709582; cv=none; b=gs5qdasSx1DnUUrVeLkgV3pYLts4JqMluueIibRVN9i223dg8V//EbuGHx9zIRznKUWno/wx0zeqlrPPm+AIq+GU0KJ738HjjzmSLDF0F8oca+DW0idLFSOjxDFljyeKt0SVPOykBU1I2eggogD4G8vVcrg+hekpCE8+N8ANhFQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786709582; c=relaxed/simple; bh=rxLj5c30yOjZ+ArZY6gNd4q5DgyDq8KjeDdsxsyMIc8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=aD6t1NDch9YNvz8aCXloyhwNC+1cD3ETTfqBGH8TWkto784yXITCpWJzmvtb7LL0yTFfsqqdqecE1lnvrH+Tq9YsEkhYHSqaP0KGXLgIQkbeTkdJLLUUUuUoPMkzwaJao6G+d1v1wvWIiZBglvWgKa2DuSzX2i7vjxKLPnt/rGs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=pass smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=t/HrTGcU; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="t/HrTGcU" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=k7EKc80uWs3S2ug0E/S2cSd4T4NKVjN5k5oVYh5CY7g=; b=t/HrTGcUNycXHmcViXyoHF3oqY +//M3GyckJ6OUCeuWHDy8k5p7C6o+WoGeIoaBjGcVILkplhzCLTKJA3d+udFtrJZcl+PbXJdFsFSj BUDu9hcgZp+mEjFEjO8CKEwDWG6vYzbgNoToIBU3N4c2YKCu61CCjJT4so2f/na1aItDrapuZJeg8 N/S0ScJuncpj5teOFlfH2hOWyPbql2PBHI4r7dywiln5M0yEKajKwqx0e7HZmQoDFX7vuNWAsYYHo bRz6HRF0nyQI1UjenO98DKKpMYGtxvwcCGpYGBoZJiRGSl9ZDXb/OPD+AlHOW2m1ZoFwr7gLtuoNB /mcsDEnA==; Received: from 77-249-17-252.cable.dynamic.v4.ziggo.nl ([77.249.17.252] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux)) id 1wuqmH-00000005AGl-2Ee1; Fri, 14 Aug 2026 12:12:49 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 8F2FE300323; Fri, 14 Aug 2026 14:12:47 +0200 (CEST) Date: Fri, 14 Aug 2026 14:12:47 +0200 From: Peter Zijlstra To: Borislav Petkov Cc: Ronan Pigott , linux-kernel@vger.kernel.org, x86@kernel.org Subject: Re: UMIP and clearcpuid= Message-ID: <20260814121247.GI788244@noisy.programming.kicks-ass.net> References: <20260610200054.GDainCdpF585khK77w@fat_crate.local> <3868008f140c843f4443b79d800dba5456df174a@rjp.ie> <20260610235501.GGain5VbwcvpUwCxiw@fat_crate.local> <20260611075311.GH48970@noisy.programming.kicks-ass.net> <20260611160946.GAairdygGg2bMCjibT@fat_crate.local> <20260611183736.GI187714@noisy.programming.kicks-ass.net> <20260814115045.GH788244@noisy.programming.kicks-ass.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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; ...