From patchwork Mon Jan 29 06:45:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Xin3" X-Patchwork-Id: 193297 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp405999dyb; Sun, 28 Jan 2024 23:16:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IEa/fLGjiNrlWn+r3JhQbNM31xvf9hNmGTjtlK2bP22yxbWOTAmskv9ezfXdZc4lyAiBRaB X-Received: by 2002:a05:622a:19a1:b0:42a:6829:c2e with SMTP id u33-20020a05622a19a100b0042a68290c2emr6826179qtc.5.1706512618679; Sun, 28 Jan 2024 23:16:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706512618; cv=pass; d=google.com; s=arc-20160816; b=LzVm4+kc/roMFYVKVH+S3jTbFgDFuY7rnvpNqkAOvfoqOkBm9j/SdwvXgY2jigJFX6 s4h1iJcn++jvwtwupPKsPuh/VBJe3+nwffS9Krmi25WqdPDY10byhkVPTIthgZztctqs cYgyO0DwY034/IgmlHMN8U35zMdGpiR9mLLewpwZgHkwIGTZ1BBcXBwYFRJkbbbGBQ5Z Trd76TwPPOEeyhjc0sauI1zbrblKq0DyF5tb2LaWL6ddztEJ444dZaC00h0PPCL57uhG 1daeZ0qh4MTZC04FnG7w+rhhZ1leVuPowJFZGwoFVsNMJ/cpD9bYQVnYU8p/4RxitQst hVXw== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=1X8ImPWijkzCW/ZBakZ2mdtZoZ1lpLszUD9C+/mtvN0=; fh=eoqNldmLmBswfN1zMWVVrnsIvNovukkqS6g9u7sxTHc=; b=RbKPzjkqOHTt/4fyyKE7eA35rNw3AqxJL2Wpih15Frd1baRwx9EvErkNvqNIWBl5GK /hd1VhiH4OwBeHID5v0ipbv7xidhmcwP+YshXIPy7ne9pXn2Ue3G5iBAbYBARlrE+giT 4g6l+IvWUPrSotuQnvDx2sJ1jzLIw2iW332Hxp9Uw3Rl2v204MM7jpD6mAuvDVszcYJF +MzHPfQ/dND8D/4MuckM7nnIutQ1m2OpGP3GO5CV5B/+VTK2TfbIEBQidVBKwZ8Q35Z/ DscYVhXjBuuwFl2/IWMXL6asyyykUpS//IK5NSKYP+hqUtOivg08e0iBZpwj6041ovUA DRGg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=nQFJhcJE; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-42277-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42277-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id c21-20020ac85a95000000b0042a2e150cf5si6979374qtc.756.2024.01.28.23.16.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jan 2024 23:16:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-42277-ouuuleilei=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=@intel.com header.s=Intel header.b=nQFJhcJE; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-42277-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42277-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 76F491C20CB2 for ; Mon, 29 Jan 2024 07:16:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8E8B94F5ED; Mon, 29 Jan 2024 07:16:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="nQFJhcJE" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) (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 5B1A14EB4B for ; Mon, 29 Jan 2024 07:16:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706512604; cv=none; b=OV7qOwrF4mNYVYEaxFEJEfP4d6D0z8o1uaG3kEmpKMX9h2SnOaSOgPW4UN6403XYelEuTUnRxRvqe1XWyB3EA2uD8uU5pWha0LINjcsoIAWaj7E1K9QcZeAlE9ovi6kPtfXM0BLCqiXHR8FcamCzGcng0UKg9aMEkvaQiaLIMlU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706512604; c=relaxed/simple; bh=eu/lfYcQTfH29bR12vR2FEP4YlJ9vPNwxcdt4UtKOJY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uqysKCJDXuOfWSVl9eb6yzHcvkbgek5Aib16aZEdszrDKmHRpuk/lddWy7j8KWYnbfJqa6LKCF4tNKeu/JfKtqiueKoS1R7GvXmeRpHqaookVhqECCGoWRCut7n5RSA8+PsMumtX5mTA8C5OV5dCabLK2j6t01Ais/EDpCB8n30= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=nQFJhcJE; arc=none smtp.client-ip=198.175.65.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706512604; x=1738048604; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eu/lfYcQTfH29bR12vR2FEP4YlJ9vPNwxcdt4UtKOJY=; b=nQFJhcJEIUXbcSXbT4TTBMW+Hq4dImuoliNn9bPZbosEy1VsSD9huGas Z4Hp/H4wde6ftDqlIEPWj6z2B/7VpeVMh8Q3ILtH4BhPdGheicGQv+heX gZaqTbhaiLFoV1PY30f/ZapC8kEIqwk2riAvgAPRrZk9vk12As1Bouhg3 fZ/iPiuET8iWnpqajqNtmochcGussTHJ/2CnMlqUOrhPm7A506eQGd9fB GT2JqBeZZZBVJUruyB2PVIchnC5CsWHGAT2xCeP60m9MYVzLMLFaUrs5Q yRt+iz4AZ8b0UgzwfpObfbm18BmSZEcAV/jdjGcU5GCWAS4HJyQIwVOs5 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10967"; a="2761650" X-IronPort-AV: E=Sophos;i="6.05,226,1701158400"; d="scan'208";a="2761650" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jan 2024 23:16:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10967"; a="931001233" X-IronPort-AV: E=Sophos;i="6.05,226,1701158400"; d="scan'208";a="931001233" Received: from unknown (HELO fred..) ([172.25.112.68]) by fmsmga001.fm.intel.com with ESMTP; 28 Jan 2024 23:16:42 -0800 From: Xin Li To: linux-kernel@vger.kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, luto@kernel.org, ravi.v.shankar@intel.com, andrew.cooper3@citrix.com Subject: [PATCH v1A 1/2] x86/fred: Fix build with clang Date: Sun, 28 Jan 2024 22:45:21 -0800 Message-ID: <20240129064521.5168-1-xin3.li@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <882e400f-913b-4ed5-9611-ef87cd8b58b2@zytor.com> References: <882e400f-913b-4ed5-9611-ef87cd8b58b2@zytor.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789237837165267970 X-GMAIL-MSGID: 1789408175456260265 Remove the .fill statement that referneces asm_fred_entrypoint_kernel() before it's defined, which breaks clang build. Use the .org directive instead to fill "int3" into the memory between asm_fred_entrypoint_user() and asm_fred_entrypoint_kernel(). Fixes: 5e0636a41485 ("x86/fred: FRED entry/exit and dispatch code") Reported-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/lkml/20240126100050.GAZbOC0g3Rlr6otZcT@fat_crate.local/ Signed-off-by: Xin Li --- Change since v1: * Use ".org ..., 0xcc" to fill "int3" into memory (H. Peter Anvin). --- arch/x86/entry/entry_64_fred.S | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/x86/entry/entry_64_fred.S b/arch/x86/entry/entry_64_fred.S index eedf98de7538..a02bc6f3d2e6 100644 --- a/arch/x86/entry/entry_64_fred.S +++ b/arch/x86/entry/entry_64_fred.S @@ -43,14 +43,12 @@ SYM_INNER_LABEL(asm_fred_exit_user, SYM_L_GLOBAL) _ASM_EXTABLE_TYPE(1b, asm_fred_entrypoint_user, EX_TYPE_ERETU) SYM_CODE_END(asm_fred_entrypoint_user) -.fill asm_fred_entrypoint_kernel - ., 1, 0xcc - /* * The new RIP value that FRED event delivery establishes is * (IA32_FRED_CONFIG & ~FFFH) + 256 for events that occur in * ring 0, i.e., asm_fred_entrypoint_user + 256. */ - .org asm_fred_entrypoint_user + 256 + .org asm_fred_entrypoint_user + 256, 0xcc SYM_CODE_START_NOALIGN(asm_fred_entrypoint_kernel) FRED_ENTER call fred_entry_from_kernel