Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp415053pxb; Sat, 18 Sep 2021 06:32:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybkBl4iTtW7pku3PeN32nMoazgfms/JALI8pH1srCfZufrF6ukBi2W//++tfwqT8kFhwj0 X-Received: by 2002:a17:906:9747:: with SMTP id o7mr18296659ejy.486.1631971949718; Sat, 18 Sep 2021 06:32:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631971949; cv=none; d=google.com; s=arc-20160816; b=RNpAMoYWZs1BsOp9tUM+hxHl1Gc2hoyVKU40GYPkm1B2hWevLWokAnqm6GdTJzv3FX V7fKLeacYEileWZfKiXCZZhxyPMidY51UtXfBtY1DyHPNazMHJUxX4e7ay6d4oRHLXVE npq7LYqBjLfwABei90eAFX3JgLsf6jZLrbilwYmmJ+dCfW+81RXWNVXLuPKrsP7O88GB kJ/vwsl+FTAJygheA4voc6Ny+Szb9xhkYkud4dM/Y00Sbdokz8FR7Y6SdCyMcDvmy1bs NulLe2qAI4+EfLZfEDRoylgyqjOMlazA9MI/rWike6Wy+qXyEe5zIzTugg5BPr/TM7KK B/fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=n+Fqt6MVFr2gieW0j4Tl0M/4nNsKqy+tKuhi2NClUw0=; b=nUQCFbrPR3zSfy80PFApNY9InXNdkH8izSombPux3QoT4Z2ealMX+JZRLfTC7qYfLg CzRd49tKnNF2gmiKHniOyFKok9xSn3E4ILk8RMUM6BB8Fo+/rtZ3rbP4QqVqPVzYkK5Y Ph3DWOQeyia3S6EauTp15lT+ME2j1zjpSuUltF8Yp0S7LnfFp7FgZqDPm0wdQs+7B41K iUr7yA6p85r42hOWVap7JcB4xDDK9oaC7YSAMAIF8oPtmkVgU/688Mi8iCNJtbRIdIVw 0Blzoo/NgpoJXe4s4ivMyAT3BnJU1BA9mBYojgXsFIIPlKC3YVeCts7oAQNO5kSUPkR+ /95g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=l0IDBsJ4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i4si900024edf.554.2021.09.18.06.32.05; Sat, 18 Sep 2021 06:32:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=l0IDBsJ4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240176AbhIRHG5 (ORCPT + 99 others); Sat, 18 Sep 2021 03:06:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234498AbhIRHG5 (ORCPT ); Sat, 18 Sep 2021 03:06:57 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31382C061574 for ; Sat, 18 Sep 2021 00:05:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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=n+Fqt6MVFr2gieW0j4Tl0M/4nNsKqy+tKuhi2NClUw0=; b=l0IDBsJ4u24mSvVFVWKlBUjZ63 8bVgIRNnBzrp5oryStlkITgYo2LQZ5gX30/pt2almrOgHuHDONXuSmWc8oF3ffTogH/nQn8FoTme4 yjWDJcOglSopEP4uKbF8LHfc89neTfSq4ZE4rknMak53v/lvusaJB25YVsB6Bj1Nvjnb8hxWRHs/a WRWqumkEOp+6F8yEKSJK0eiBH/QDHvBxCZLRKAbdswG8qoIzQrNkgJ8YWPlDteCjgcoR/F4od1i5q QRxmtDVovVtx/Y+1diJ83hC5eZRsa+kQPfSvb9T6D9OMnTfl7FQ36284TKdLDbLvlcl5Wxs45LNr7 Wp5mibWg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mRUPh-0042Iw-9Z; Sat, 18 Sep 2021 07:05:29 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 9F30B300047; Sat, 18 Sep 2021 09:05:28 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 835B02CEE105C; Sat, 18 Sep 2021 09:05:28 +0200 (CEST) Date: Sat, 18 Sep 2021 09:05:28 +0200 From: Peter Zijlstra To: Linus Torvalds Cc: Ondrej Zary , Thomas Gleixner , the arch/x86 maintainers , Linux Kernel Mailing List Subject: Re: [PATCH] x86/iopl: Fake iopl(3) CLI/STI usage Message-ID: References: <202109151423.43604.linux@zary.sk> <202109162227.17415.linux@zary.sk> <20210916210509.GG4323@worktop.programming.kicks-ass.net> <202109171011.31916.linux@zary.sk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 17, 2021 at 03:24:51PM -0700, Linus Torvalds wrote: > On Fri, Sep 17, 2021 at 3:23 PM Linus Torvalds > wrote: > > > > I think the proper thing to do is perhaps something like > > The alternative is to just ignore cs_abse entirely, and just use > "regs->ip", which makes this all even easier. > > If somebody uses a code segment _and_ cli/sti, maybe they should just > get the SIGSEGV? I did a hatched job on fixup_ump_exception() which is why it looks like it does, that said... our case at hand mmap()'s BIOS code from /dev/mem and executes that, I don't think it does an LDT segment but it would be entirely in line with the level of hack we're looking at. Let me frob at this after breakfast and see if I can make it better.