Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp144324lqb; Tue, 16 Apr 2024 11:06:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW/cH/PJ5i93q4jWU1nnDgo3YaJu8mJWZWw6ikFBm71msjigDXs2TR6qNRQUzrNdpk+MUjKqaSE4DWOkHpnRT/rmpQ4HSmwmpu/HgoE4g== X-Google-Smtp-Source: AGHT+IF7jfY0+nqvM6q8C6cZh/v61TXYzDgKYMb9jMZzQhvrRrzIu33PL/WHRsOXz1y/KJdlzbIs X-Received: by 2002:a05:6102:dd4:b0:47b:a0bd:f268 with SMTP id e20-20020a0561020dd400b0047ba0bdf268mr1377590vst.17.1713290763400; Tue, 16 Apr 2024 11:06:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713290763; cv=pass; d=google.com; s=arc-20160816; b=dXB+rP5jK1PJm6xCN+chdSU/tAk4JJLZ1uXQW7i8XOEM2kSdd7RF9/brgVbVMDQXOE bMVZUFAoSHLhuqxkxL/n9JvEKOVsA2wqA0uqKoC1tY4orh9sZc1aCA2FBu4SszLxGOUL FeXDuqr1Cvxm0y3y8zDddd6C7Q7EwtJpTzlX657Dcpu1T8A8C88G0Pd0xgO5FIylJvBA yDDS0lkh9D4tY9L5n244cmLUeCvyq5VX2voA3WGGZvefERS7+U7NuEJ9QiMpmXqA/ZVw 3NAbr1rOMtwUWOoN6vAEuHklHM1T+8eXeIS446X3VTo3OOP+baRSJ18mH8YAT26Gvgpz kkPg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:references:in-reply-to :user-agent:subject:cc:to:from:date:dkim-signature:dkim-filter; bh=J8pxXkE58AUR7hivIEpGL3T2EshFPqjzkbL423tGcGA=; fh=3oluHK+vCOkkpr/5eLd7yytv8oRZi2JLaPy9e7lmyRo=; b=ohBBZrhrB1OP1yzNZez6B5tvJYBlcn8b1w5zMRf5KDJx1lf9/FGYXxNxJ46ceyfNHk KG4jK+BQzQOqJd2Hb2SDaOQm+XTAFe4expJxo0DA9Ed9ZIKkuVTTCjlhcq7oE60GIDFN nVc8l+8QN/y1khBazW2nbBd9doL6jrRntqpW4M6r4pIyVQw9HWWkPLm7TxBIN/pyQMJV hKdotdfq5sEo/yx9h5yxbSvbc99WDlBKLfQYijwFinegHJ/EaIsilQkW5H/QMG4q0N+w TtTzuwA3tWNQ5mYv/nlfLPEKAzSFPgRk1UynfHCDsfQd8Nvl96OwLXXCdaki/AT35JbL 8Nmw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@zytor.com header.s=2024041401 header.b="Zx/0mIB3"; arc=pass (i=1 spf=pass spfdomain=zytor.com dkim=pass dkdomain=zytor.com dmarc=pass fromdomain=zytor.com); spf=pass (google.com: domain of linux-kernel+bounces-147347-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147347-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id h1-20020a056102358100b0047ba44ceae1si51735vsu.222.2024.04.16.11.06.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 11:06:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-147347-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@zytor.com header.s=2024041401 header.b="Zx/0mIB3"; arc=pass (i=1 spf=pass spfdomain=zytor.com dkim=pass dkdomain=zytor.com dmarc=pass fromdomain=zytor.com); spf=pass (google.com: domain of linux-kernel+bounces-147347-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147347-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 210741C2173A for ; Tue, 16 Apr 2024 18:06:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8C172135A67; Tue, 16 Apr 2024 18:05:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="key not found in DNS" (0-bit key) header.d=zytor.com header.i=@zytor.com header.b="Zx/0mIB3" Received: from mail.zytor.com (terminus.zytor.com [198.137.202.136]) (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 2EF06135A59 for ; Tue, 16 Apr 2024 18:05:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.136 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713290746; cv=none; b=BX63twQUj9dix8TSBqSJFTHQi+gssxGOu/fvBdCAnp5WpngZAt5MDkWPTf37QSvnCbYbAAONx61BXl0LHzXnbVSD7Rwraeq+CYFMnA+ZXamzCaoL3RwT97Z2pklNN93M7xY5hABxbOsrjk85ogBNv4CMijtY481qmRBDUnboHzo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713290746; c=relaxed/simple; bh=vNxatr6wmhiPowTIKjuTwwXXbIbHjyR7xpA57RzBFm4=; h=Date:From:To:CC:Subject:In-Reply-To:References:Message-ID: MIME-Version:Content-Type; b=mA2m5hGcpX6UDCtNouYAZWbh7Gfil1ruxzpq3HhV6o0C8IhA6QCFyE4Ejd0e6cmbm4fy+uuO2uzOqrVWHQMRZvaoU7jwlRQmXgC4BudmfeZceym4IAih4dEairEes52/hRqu/b+g8MXXpSZymzKyJkC2mrOKuoHzUrkQBFIqJOY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com; spf=pass smtp.mailfrom=zytor.com; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b=Zx/0mIB3; arc=none smtp.client-ip=198.137.202.136 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zytor.com Received: from [127.0.0.1] ([76.133.66.138]) (authenticated bits=0) by mail.zytor.com (8.17.2/8.17.1) with ESMTPSA id 43GI5Ep23333977 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Tue, 16 Apr 2024 11:05:15 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 43GI5Ep23333977 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2024041401; t=1713290715; bh=J8pxXkE58AUR7hivIEpGL3T2EshFPqjzkbL423tGcGA=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=Zx/0mIB343ew2Y582XPfh8wl84ROu2m6y7q1UjSjWuiNu2/bm2AbSZ1UVdHlVimsx HYH0vp8mvsVHTjOMbOrMdmUWWepYBv6MTJrPHjME+NQcUBbZldsgIK+NDkKJSlu+wR mj7vRWP3+K09j/Voqw0gXYwzhqWY9sCA3ZMcG0Jyt7VbuKqosoLjOzI4DtDt2SPG81 J2b3z7MiPWEfZpYea/AnI8AEBRMz/fdwGNrUcwPL45PXC6t6qiuz6KrSjcgVb9I4wY 1GGFjnyg6CXd+Xe4DWjyzq+hJCUaiTvPBnAoVx23BNSANcPxUhF5TRowmpfi1kuGQB aKG1sSjPcWiMQ== Date: Tue, 16 Apr 2024 11:05:09 -0700 From: "H. Peter Anvin" To: Borislav Petkov , "Xin Li (Intel)" CC: linux-kernel@vger.kernel.org, luto@kernel.org, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org Subject: Re: [PATCH v1 1/1] x86/fred: Fix int80 emulation for FRED User-Agent: K-9 Mail for Android In-Reply-To: <20240416101147.GDZh5O473e4X_ZG1lZ@fat_crate.local> References: <20240412234058.1106744-1-xin@zytor.com> <20240416101147.GDZh5O473e4X_ZG1lZ@fat_crate.local> Message-ID: <1AE9FA53-A130-4F95-8408-C1990DD031AA@zytor.com> 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=utf-8 Content-Transfer-Encoding: quoted-printable On April 16, 2024 3:11:47 AM PDT, Borislav Petkov wrote: >On Fri, Apr 12, 2024 at 04:40:58PM -0700, Xin Li (Intel) wrote: >> Commit 55617fb991df > >Use the full commit abbreviation when mentioning commits: > >"Commit > > 55617fb991df ("x86/entry: Do not allow external 0x80 interrupts") > >=2E=2E=2E" > >> added a bunch of tests to the int $0x80 path, > >Added a bunch of tests? > >What does that even mean? > >> however they are unnecessary and event wrong in fact under FRED=2E > >Are the bunch of tests wrong or is do_int80_emulation() simply the wrong >handler to use on a FRED? > >> First FRED distinguishes external interrupts from software interrupts, >> thus int80_emulation() should NEVER be called for handling an external >> interrupt, and then int80_is_external() should be skipped under FRED=2E >>=20 >> Second, the FRED kernel entry handler NEVER dispatches INTx, which is >> of event type EVENT_TYPE_SWINT, so the user mode checking in >> do_int80_emulation() is redundant, and should be skipped=2E >>=20 >> It might be even better to strip down do_int80_emulation() to a lean >> fred_int80_emulation(), not to mention int80_emulation() does a >> CLEAR_BRANCH_HISTORY=2E > >Yah, how about you do a FRED-specific INT80 handler instead of >sprinkling moar tests around? fred_intx() looks like the right place to >stuff it in=2E=2E=2E > The question was if you wanted a quick fix for x86/urgent=2E It's pretty o= bvious that a FRED fork of the int80 code is called for=2E