Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1545498lqp; Mon, 15 Apr 2024 09:22:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVheKLDKiWMyQhYtgnCiS3J88SvzId6R6Mhba6oIc07DEkmdZ5bs+vesaBtmEHIshq1vDxm5+Fdh8HSPF1yqa1PoC1jqYql0P8po/M5Og== X-Google-Smtp-Source: AGHT+IFCtrYfHJzycsyqHlYXmvcAaZhX8dR6YpuZ7tOoGBhJv6NeOSeFmMbc4jIW0fNuyrpEUFQ5 X-Received: by 2002:a50:cd4c:0:b0:570:358:53e with SMTP id d12-20020a50cd4c000000b005700358053emr5297156edj.11.1713198165908; Mon, 15 Apr 2024 09:22:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713198165; cv=pass; d=google.com; s=arc-20160816; b=WKMUymEOC3rBk6ejK+PepUGqP7Sjbop9NgPccrsYMGAvltNnHNXDqSp5g3nn1XBIjU ySTrBmfZGFw4wjEKKXxNoHUUCaRjpizITbi2pO8+YtEqUO/RSbDo3HubFN7fLUioB04E om5Gol/A3W/radpP42AUyWAVTix6reg0d8dTeq40FuubdxWphfNSUR8KMaPrxomu5zZC 7h8+5oBuVKITDNog4VOjjyJ9Mxc0q6/tddF822E0eObi/+xwNJnCX/HkwfzlhjU5IRMR Gu0sJQnuLppa3Plv5fBJhUi+ReAxpUXJeQX1XmxuNAjJW1QBouKfuKHldmDltW8PQR7W ywxg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature :dkim-filter; bh=s8TZ5pnM8hKiFX3Jje3ZRxOCl+tkEojjH/6DtaJtRg0=; fh=rJLmzZkhPiLI89IkvtlzJsNDJbl7bx6C4CijY90oNV0=; b=DogQD/f+UH/xO3DqwYrqpDhm4Rvl+vaTiBSI6GgSmxuDnVe+nPKg+VUZTA20Hwk60v Kuaym5wR0ndu92jI89FvcRggVbt/J88l4k0Ga3WNwqxHO5aeZ9Df9RAWaiehu3hmZpQs kS5nmu7p61TKr7dFZHgd4Tf7pdiPyed6rZ6Bn8Y0sFeBfI4nKysM4uSk2ShP+9TdGNaz aaazFMP3OaWh5NTJvN2T1eqhjQz0KEo/CoosD1yEp3HDeXpHjY9BgPfquGpoWw4hY+39 VFigZ91UET0D8ZjK3Yleiwzq3nL2W7O4FyXGh2dSr6ttqB8WR/fBVyxC5dD3bO0beK2/ d1oQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@zytor.com header.s=2024031401 header.b=1Q1xlOw6; arc=pass (i=1 spf=pass spfdomain=zytor.com dmarc=pass fromdomain=zytor.com); spf=pass (google.com: domain of linux-kernel+bounces-145544-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145544-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id z15-20020a5096cf000000b0056e2a459f81si4576034eda.627.2024.04.15.09.22.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 09:22:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145544-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@zytor.com header.s=2024031401 header.b=1Q1xlOw6; arc=pass (i=1 spf=pass spfdomain=zytor.com dmarc=pass fromdomain=zytor.com); spf=pass (google.com: domain of linux-kernel+bounces-145544-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145544-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 403E91F23D8D for ; Mon, 15 Apr 2024 16:22:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9F29380C03; Mon, 15 Apr 2024 16:22:00 +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="1Q1xlOw6" 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 B025F3E48F for ; Mon, 15 Apr 2024 16:21:57 +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=1713198119; cv=none; b=tMhZQawAm4tlhXISnizznoVpP8V82dOZlv48r+kj+rMhaqggbhCNlavnrSUiJ7PEVduSw/8j2oMO7APBoxBTxw9NawzxpyK2K1R/GMvehugzYS0g6FQJRTK4pWPPv/Tly/t6vy96YpXR65fPr+rcTH6J1UL58uK0uOsSB3u/8YQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713198119; c=relaxed/simple; bh=49wBF7ETWIbvhYXhdoUzf3PHmI2RzJqJ6hg/xPslkn4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=F/t/23/rPmMN5AXE7IakiWkrsdgcwQbTK9peuVnfHX18/cZF5jSRvvFLjikPtatfA2sn5ZqWvMNVsP/acdjdrKWRa1DXW/XakAYEM7kv/lvSaeXJNpmAJr6sngLGq2COusn/J7Lwhxy9ddmnmfACiR+tEAmeaAKrkJfopag+Aeo= 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=fail (0-bit key) header.d=zytor.com header.i=@zytor.com header.b=1Q1xlOw6 reason="key not found in DNS"; 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 [IPV6:2601:646:8002:4640:7285:c2ff:fefb:fd4] ([IPv6:2601:646:8002:4640:7285:c2ff:fefb:fd4]) (authenticated bits=0) by mail.zytor.com (8.17.2/8.17.1) with ESMTPSA id 43FGL5xT2477030 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Mon, 15 Apr 2024 09:21:05 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 43FGL5xT2477030 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2024031401; t=1713198066; bh=s8TZ5pnM8hKiFX3Jje3ZRxOCl+tkEojjH/6DtaJtRg0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=1Q1xlOw6fohkdTv0BTocNV+SXRZcfesd/TgPbuZlnbw6WyeSEIJdrQax/ExiQgCfI k7ZehbiPfiJ5cmaJZqu4qTY3ixossinX1shA7MBaJo5fL7K77yzPYP+D2btGQdPTLF /oIpxJnitnmdGiDhM5sEAjswFu+tId/qtQHKTKlqDXe5I8hi3QBXvl8tq76F0x1oT6 WdqYd1IiGEn0dg+AHWqqeGHtZi7RuPkT/RVOSn9zSjuB2SDGadcodVEq//isBXhgsR mh2DzT6x9GMggTD6KiFqmYRzmeSODWFziPZHoHh7GCgA8PbUOKfVcGYQJs8DTP49ds HlAMi3x9IH5XQ== Message-ID: <1fbb0c1a-998f-4424-82aa-12483fafb197@zytor.com> Date: Mon, 15 Apr 2024 09:21:00 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 1/1] x86/fred: Fix int80 emulation for FRED Content-Language: en-US To: "Xin Li (Intel)" , linux-kernel@vger.kernel.org Cc: luto@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org References: <20240412234058.1106744-1-xin@zytor.com> From: "H. Peter Anvin" In-Reply-To: <20240412234058.1106744-1-xin@zytor.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 4/12/24 16:40, Xin Li (Intel) wrote: > Commit 55617fb991df added a bunch of tests to the int $0x80 path, however > they are unnecessary and event wrong in fact under 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. > > 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. > > 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. > > Suggested-by: H. Peter Anvin (Intel) > Signed-off-by: Xin Li (Intel) > --- > arch/x86/entry/common.c | 22 ++++++++++++++++++++-- > 1 file changed, 20 insertions(+), 2 deletions(-) Note: this is the minimal bug fix versions and belongs in x86/urgent. -hpa