From nobody Fri Dec 19 20:54:19 2025 Received: from mail-wm1-f74.google.com (mail-wm1-f74.google.com [209.85.128.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B331586321 for ; Tue, 7 Jan 2025 15:18:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736263129; cv=none; b=ZX3ksKcf+zL9joyOO+iwGQCY9pAv9tlbs4mQ0wRX5K0/5mEopmEfTve0shJdrkSQNSK3GVW2dc+Xsjpt+vX+SW0EecG59RHCBocXMfkBFj+O6NY/lfWM8TUJDA1JP5XN+gyNMedtRQ+DTSMO6ym4CQt5KFlfE70bIQRH0K0XlLg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736263129; c=relaxed/simple; bh=RZQgu4g7AT4nCeJt/08VejllRNZdjpk1j8zk1wfUHWM=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=KfoYi1SfrWnvKs/z4R/NeG5MAfe/qrIywlsdB6hrF3SdZdlvnjnMgT98IX3OteS28ZVzY4MJqB9Tan5aOoPhbHMaH086KY5q4zFBD6p1mSMDgirFVi6w68f4Fu3O3/PCK1xqV3qRpkVgE+OL7b8rf3xH6xnGNXdUnMMz5KUZCdY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--ardb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=eTCZsze7; arc=none smtp.client-ip=209.85.128.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--ardb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="eTCZsze7" Received: by mail-wm1-f74.google.com with SMTP id 5b1f17b1804b1-43673af80a6so104151845e9.1 for ; Tue, 07 Jan 2025 07:18:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1736263125; x=1736867925; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=FE80mxvPhGWkRQTeC4ay+7Ce+3HY7Vm4jva/s8dsSfg=; b=eTCZsze7UQUPZmeNQ/oTsfwbNdjWaUcpQwkO7kKSyrp/odwHAeUv3A1qHbavJCmOL9 M/g5Ac3RZlP1khggFCjimTn2RwBpnmB5bbK9V8hGqnqR2X/uJfbg8ceZhVZlLI4obfJc G/gyDQ4QizDV4OyVTeVJ8/978N1P1NUt8VHemqdBe/AXontCcmFJKjb4BIZUEa7sWWlg iihUVLwiLos7xTowuobXRMzclTTe4ZcMeX7M5ZrizQnHuvOQC263pwFeMkE/ozHLj/1y oOBSf8Z5bbU2yUMtwno7VAxqG+maw3t2ZOJhMnscbpfWCzsz36QE4lVKRV0PS0e7Lc97 /9ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736263125; x=1736867925; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=FE80mxvPhGWkRQTeC4ay+7Ce+3HY7Vm4jva/s8dsSfg=; b=KbhMwPgqsixZvblWImx/SMHd1pM7Xo0nxLpu2SboM2wtd1QBdsCmxUESM9JDWE1PgA MFXCQr4ZZyl3lgXpSxFR5gRQlNUCMvOsxQXHu07MhwcbBOdnisBeZAjA39iMMAGnuCzv s4ZCWVKs3b7ss5fczJPfQCsQHub1S943aX0QcEPjES7X/GGSB01EGFZjrMnjSVTlZ3V9 gmpsnAjN3z/XKXWAfL3hfDiBg3fLWr2xZuIDesOixoPUN9Hm3as2OB5ugT3gZB3pwiys jdbl2KEE432oOeWSRF6gKKGURnz8kgIPB8dPweM5F1LX0iaSUO9PeRlJtTPN+QNekK89 iSuw== X-Gm-Message-State: AOJu0YxlpcvXM+7eGv3ckN+tjsE/1llP8sNnreboROMhBhSu1TRhbtjh OS5uECgBXS7Q4hvYGELunwhZhNYttQvk8I79QJLou6rdZswO7VEamRcq1pgwGT3+WAmz35mMq/j WGG1OsorLANkFsZBsL0onfpHaKJwMfSGcqPgPszdi44Mj5j9SDzvA9x4XsifHGIpMNW9LYtIzFB Nci1SJ56hWlD+IgX0/MFMm0BMggGqRXg== X-Google-Smtp-Source: AGHT+IEbpgE5uCJ71Cg+c+lTKGUgSpDJykQldyL4yxRjQZie35oypiPCQAb+kiKP2E1nX0JAgfrvfGlY X-Received: from wmsp42.prod.google.com ([2002:a05:600c:1daa:b0:434:a050:ddcf]) (user=ardb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:4510:b0:434:feb1:adbb with SMTP id 5b1f17b1804b1-43668b76a08mr581263265e9.31.1736263125092; Tue, 07 Jan 2025 07:18:45 -0800 (PST) Date: Tue, 7 Jan 2025 16:18:27 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-Developer-Signature: v=1; a=openpgp-sha256; l=1052; i=ardb@kernel.org; h=from:subject; bh=TbHglTN6QYdFpOu3dY75BHzahnTgUfQuZl99flKGr8M=; b=owGbwMvMwCFmkMcZplerG8N4Wi2JIb3W9fD/+2f/aKxJ3F0RdFRs/f3++p3PLjjq5p/hV6tMW tP5REa/o5SFQYyDQVZMkUVg9t93O09PlKp1niULM4eVCWQIAxenAEzk3GeG/6WSmQ1ryg8/XR62 QC1hsfVvw5blXhZTHN6I2Jt+XJnwqJKRYc7sIM4HzdVais2XuyNDr6p+W5x8MHvlLH8hwaXu61m +sAMA X-Mailer: git-send-email 2.47.1.613.gc27f4b7a9f-goog Message-ID: <20250107151826.820147-2-ardb+git@google.com> Subject: [PATCH] x86/sev: Disable ftrace branch profiling in SEV startup code From: Ard Biesheuvel To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, Ard Biesheuvel , Tom Lendacky , kernel test robot Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ard Biesheuvel Ftrace branch profiling inserts absolute references to its metadata at call sites, and this implies that this kind of instrumentation cannot be used while executing from the 1:1 mapping of memory. Therefore, disable ftrace branch profiling in the SEV startup routines, by disabling it for the entire SEV core source file. Cc: Tom Lendacky Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202501072244.zZrx9864-lkp@int= el.com/ Signed-off-by: Ard Biesheuvel --- arch/x86/coco/sev/core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/coco/sev/core.c b/arch/x86/coco/sev/core.c index 86898547056e..b5c6c4afd1cc 100644 --- a/arch/x86/coco/sev/core.c +++ b/arch/x86/coco/sev/core.c @@ -9,6 +9,8 @@ =20 #define pr_fmt(fmt) "SEV: " fmt =20 +#define DISABLE_BRANCH_PROFILING + #include /* For show_regs() */ #include #include --=20 2.47.1.613.gc27f4b7a9f-goog