Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp225723rdb; Sun, 28 Jan 2024 23:16:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IEue+KFaL7QNQipHiewoAPYjAt2MdmPslD+R9laomtuwOFnHMoPL2RqQOBTCrRoW0K8cHKB X-Received: by 2002:a05:6902:cc6:b0:dc2:23f7:665f with SMTP id cq6-20020a0569020cc600b00dc223f7665fmr2550392ybb.127.1706512611519; Sun, 28 Jan 2024 23:16:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706512611; cv=pass; d=google.com; s=arc-20160816; b=o3hEtsR5sATa2OjqCpwtXaY5igctzrFUhIRiX7m5tRa5oNZ3nJ7j/XyVolyWpVnsAt oNhrsxoS8ek9zXpEpXLPul1Sf1S3AFlWh6DHpz8rhZgGWX+kMofLpriW6a4kyVfhtq7R iky7iijypG3tbA/k7bqlGQ6NV0z17uoVxZdR7MRMSSgQtGzHSJAI4V61PS0nTy7/JgsO PK/YlRd6zBEs5+Se0jWeWV5fUSJsJ0SAd/nUbdTJPxNKMNyxJVVWqBiueuNlu6/3r+P2 N98VNUQNLXq7n7mR0dXSu/kli3v6sB/8ZbBQKThA094nbYHqkronaJI+TIsL7wcWHP7A hJEg== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42277-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id z1-20020a63e541000000b005cf97c743c6si3275909pgj.749.2024.01.28.23.16.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jan 2024 23:16:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-42277-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42277-linux.lists.archive=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 07D212855A6 for ; Mon, 29 Jan 2024 07:16:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B3D094EB58; Mon, 29 Jan 2024 07:16:45 +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 Content-Transfer-Encoding: 8bit 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 -- 2.43.0