Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1466979pxb; Sat, 30 Oct 2021 14:23:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1UgJmD+qx/5O7+xLRP3zCa/jdFZFwdT7Wm516+TBnMGcT6zqvY48S61alxRQH5+cs30CH X-Received: by 2002:a05:6402:c05:: with SMTP id co5mr6448268edb.71.1635628981146; Sat, 30 Oct 2021 14:23:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635628981; cv=none; d=google.com; s=arc-20160816; b=Z+TJbivHhkrOObl+A5C9zPlehSeTWkfkEuxYzaDeFENp4+l/aJkIYIxNbEn1wMIc2u 0WUSJ4sF3ab8BgF7qakcZlXTzxP+mrwI8fyoDZH2xs4qgkCqgN+aF3l7UcGZRmZRK3nv 4TLODPIq40rfg9KIT7gKwgmf5opyOmcic4zdIGM1l4uIL+dWPlAIk1ay5lEhIIxKWpBj HFSXI/lHz9TeiZDP+eLONFrhcmyyfh0DaQHgZ8vsRiwzYXsS6mvuNkeSmAxelIzpY4Ox yntWbmI6DGHXoOOLQ8WazQxRtBe0/AeBV0rNjpH/zKXBZSyPzZl2lNe/JRVwiHUMJ/aX vxJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=kYHRUaGb+rhXTEMfmnyryqTuicwbjsEvds4MSkhqu/I=; b=TscKpD1geoLewK8v85BZdHeFQEcUjKB8Cz5VOBVp85B9mMGjKHJ0SLq1iL+xZFBJdm Rkq81MvKB3rWDzb+7z5VvK5Wz65O04PYasy3aI9JINOgQk2DGnWp7XXBug9BsabC9roz G75XXkM8YYvz7/PscYUmxqU1X/XELDuvfo/kp8Q6YsiJgPQBXGzdMWn0SZ92EAQuiQqC YKz154v5Un6xkR7p6HupvQ4tmGGuY0jeFDD4fgh/5Z295TBS64c9uUPm6mWrxqq+3EsD vD+L746dIWtZhzdMSIe9/lSFREFeKnEz4nafi3dgM9IMLiN4TmAnztse6yuvD6qmHIdR 99fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=AK4bvcUd; dkim=neutral (no key) header.i=@linutronix.de; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gt42si5633196ejc.104.2021.10.30.14.22.10; Sat, 30 Oct 2021 14:23:01 -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=@linutronix.de header.s=2020 header.b=AK4bvcUd; dkim=neutral (no key) header.i=@linutronix.de; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231154AbhJ3VHC (ORCPT + 99 others); Sat, 30 Oct 2021 17:07:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230338AbhJ3VHB (ORCPT ); Sat, 30 Oct 2021 17:07:01 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD25AC061570 for ; Sat, 30 Oct 2021 14:04:30 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1635627868; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=kYHRUaGb+rhXTEMfmnyryqTuicwbjsEvds4MSkhqu/I=; b=AK4bvcUdadzoGlSMXgtkVdYE7KVQTzuTzvmZIu2r5HW7L1rUAKq2CUvUQG0kewX2BKiOZy ARbWM6BWPh/ikUpPInB+qDJ3rtkcShbCWFH4+O7UNUINhMpwgxwhEyOlFCN5zLlYKYN/Ey l/apEuf6ncm3aJjo2DUtHZg+3g91lfVdWEVkFJKWv0iKfPb+sH3qGXPgepRuRBxJ9It3kY xPPg2y/lOZyCUBTl9JUbnWx2bEBeL2BO+fWzeTX6cUQbiitnqDvMxR4aiZMEqLVD+OHisu SM2Bht99tsm4QM4KjooGcSCvJis9romc/ORXoU1L03nliX0pJ97fBx3qHNPK9Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1635627868; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=kYHRUaGb+rhXTEMfmnyryqTuicwbjsEvds4MSkhqu/I=; b=HVqGgSJQgXkQHQ5vHYkht6AH5go1Q3oyYRyyJwMrAkguYPsXjmpohwm8OacGZjJgthC3Sb 2B1VMGhMSe+L1hAQ== To: Borislav Petkov , X86 ML Cc: LKML Subject: Re: [PATCH] selftests/x86/iopl: Adjust to the faked iopl CLI/STI usage In-Reply-To: <20211030083939.13073-1-bp@alien8.de> References: <20211030083939.13073-1-bp@alien8.de> Date: Sat, 30 Oct 2021 23:04:27 +0200 Message-ID: <87a6iqfcmc.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Oct 30 2021 at 10:39, Borislav Petkov wrote: > From: Borislav Petkov > > Commit in Fixes changed the iopl emulation to not #GP on CLI and STI > because it would break some insane luserspace tools which would toggle > interrupts. > > The corresponding selftest would rely on the fact that executing CLI/STI > would trigger a #GP and thus detect it this way but since that #GP is > not happening anymore, the detection is now wrong too. > > Extend the test to actually look at the IF flag and whether executing > those insns had any effect on it. The STI detection needs to have the > fact that interrupts were previously disabled, passed in so do that from > the previous CLI test, i.e., STI test needs to follow a previous CLI one > for it to make sense. > > Fixes: b968e84b509d ("x86/iopl: Fake iopl(3) CLI/STI usage") > Suggested-by: Thomas Gleixner > Signed-off-by: Borislav Petkov Acked-by: Thomas Gleixner