From patchwork Thu Mar 30 09:44:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 7452 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1005567vqo; Thu, 30 Mar 2023 02:54:20 -0700 (PDT) X-Google-Smtp-Source: AKy350ZRF/wA6rGmwbbEnfhyyRioK5/ZW+/xq+rpd9cxNJXUUmfXYSqtK6LG9acW3m79UTEXQW9A X-Received: by 2002:a17:906:44b:b0:931:624b:680c with SMTP id e11-20020a170906044b00b00931624b680cmr23325049eja.29.1680170060161; Thu, 30 Mar 2023 02:54:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680170060; cv=none; d=google.com; s=arc-20160816; b=bPJbA/PM6q5ZD4d9D8jxE77KPZITUXc4hsnO0gHRh4ZW8AplwZndT3F9LuSr2SwT47 T9kIYnnRFQCugDAhFGRVqfcy0apNMoNy8s0xw7CIilkDZvh24VqppuRVJ7x81PtqDsO5 UhjIgPMkWK7vlwhytmjigL2798zGvjrU4F373PZTl8AVv53hWqw+q1cgyxKtRiSAgokN Zz/WUkxCs9dXp0rKbQynwaWU9LKPIIu3ySPIMv8jNZ7n0kvtxFkpMuzzmB/esuUJmWtr H6eEbtG/1I2690OKfeRxXXVTkLGrDXskwloagtVS1XSlpAMgXbBEjzGgowSPYytYJlOC 6bbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:content-transfer-encoding:mime-version :message-id:date:subject:from:dkim-signature; bh=AmFm2H2aOAkbQY/h2v5MAmP45SXRmGLw4e1al6CBI2I=; b=QcszsvQLbUH4aJlZG9ZtWH2C5tSx1Uo6dh4koKAZ2CVWM4MPMwAlGAFSx+83MDt5DR D2HMUjAvLp65meFpSBcTlcl2uhF5zCLGAL5rFEv1PgMHvJ/v/phNKvGigMuYR3MCP6WR nmjqRE44/TZ5Env3O3Xd2wwZMm84B0ZvPVyAsBS4MJjJ1A6s3R3jDWctfLIL79vnZldt HFFBHp+1V6grdNucj5r3DOKQ9fKKt+NPm03SiA8CSaptINIuJcmfn5T2TvO+v1LH0GR3 11G+v7f4wKAWr6XJy1Ku35orNZPxUAZc0MfOMkwjGQhIfsgf0ml6JLPzF6Tn5AP/3xfG JpNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="PGpd/3k7"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id js2-20020a17090797c200b0093b6e1440b3si23871795ejc.764.2023.03.30.02.53.56; Thu, 30 Mar 2023 02:54:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="PGpd/3k7"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230348AbjC3Jp7 (ORCPT + 99 others); Thu, 30 Mar 2023 05:45:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230014AbjC3Jpg (ORCPT ); Thu, 30 Mar 2023 05:45:36 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E3838A48 for ; Thu, 30 Mar 2023 02:45:15 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id eg48so73994882edb.13 for ; Thu, 30 Mar 2023 02:45:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1680169513; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=AmFm2H2aOAkbQY/h2v5MAmP45SXRmGLw4e1al6CBI2I=; b=PGpd/3k73zNpbvHVT1UNSiV5gtK0hy3DPGeYWoIayaboLOGFXTitshD+imYv2Js4WA MM1Y6zOlUAy2AFVvLHyZtSslq5XKgyyZG3y39FnjeXLrlTVhDhAjXvJZMQx1Us3QGzMi qb6Sl0zeTh2D/1f/uRItg4eljeiJoSj7Y+tCo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680169513; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=AmFm2H2aOAkbQY/h2v5MAmP45SXRmGLw4e1al6CBI2I=; b=KxIAYi2cZ9Kr/3WZxTlkcO8/UaBymDNRoSERiiSkozqlpizwbxL4PT0mceydL3hwxD gBzOsOV0ZwgJ3MAexDT/ziC9fHfEB+lIvLezaAWyg5D6j42PXCjw1QEwU6HaBkDyPg/9 qzjKWAxDxyoNeMLuhph1CFFbixkEzXZpQJePALKwJFnMSgAKOrm1rN5JiENROSdmNiHt 6BcAjvGesIlC9A8QCu0/lpm60zGrN3Rjlj7HiX62MCI1fuvhZeou3A+bxUlvZCnRrAyp yiSMLMblDXrMWdT4mnodBocpw7WBeIxBv/6tTPxvGHpB8Q9cWl5y/XXGPZ6CYU5Yx3mq 0t9g== X-Gm-Message-State: AAQBX9cFVx85EWQy+ao8IqNwRLSzKbPo0nTMulkGuRXAd0MNgbrT0E7X R98mZLGx2LYQg+GEUoxh5XDbfBEbumue5+uKu18xLA== X-Received: by 2002:a17:906:5a43:b0:8aa:be5c:b7c5 with SMTP id my3-20020a1709065a4300b008aabe5cb7c5mr24312480ejc.41.1680169513712; Thu, 30 Mar 2023 02:45:13 -0700 (PDT) Received: from alco.roam.corp.google.com ([2620:0:1059:10:1396:ff5d:6e2a:df6d]) by smtp.gmail.com with ESMTPSA id k9-20020a17090666c900b0092b606cb803sm17683616ejp.140.2023.03.30.02.45.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Mar 2023 02:45:13 -0700 (PDT) From: Ricardo Ribalda Subject: [PATCH v5 0/2] kexec: Fix kexec_file_load for llvm16 Date: Thu, 30 Mar 2023 11:44:46 +0200 Message-Id: <20230321-kexec_clang16-v5-0-5563bf7c4173@chromium.org> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAA5aJWQC/33OzQrCMAwH8FeRnq00/dg6T76HiGxp5opzg1aHM vbuBo+iO4Uk/H/JLDKlSFnsN7NINMUcx4Ebt90I7OrhQjIG7oVW2iijQV7pSXjGnndQSOtAoTY BdIWCM02dSTapHrDj1PDoex52Md/H9PrcmIDL8R83gVSyLgvfosYSbThgl8ZbfNx2Y7qIE2OTX gU0AwEUueCg9EX1AzCrgGHAtQoK9EGRL38AdhWwDICxyoFvK0/fHyzL8gYkFJwTdQEAAA== To: Eric Biederman Cc: Baoquan He , Philipp Rudo , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, Ross Zwisler , Steven Rostedt , Simon Horman , Ricardo Ribalda , stable@vger.kernel.org X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1562; i=ribalda@chromium.org; h=from:subject:message-id; bh=SayQVLE6H72tjacCmNcmtcnOuUDgjnttSSVkCQO8nwU=; b=owEBbQKS/ZANAwAKAdE30T7POsSIAcsmYgBkJVoXZBZQgBE2mt6hnkD3x10Mo+77PbgkqAlUv DUrdUN7lMCJAjMEAAEKAB0WIQREDzjr+/4oCDLSsx7RN9E+zzrEiAUCZCVaFwAKCRDRN9E+zzrE iAdoD/9iPmpE6/UU41Svse7e7tdRS16SUUtYUJeo/EFBaOCBvwrfjzy8VWZRlbSxOLj6kZtGhxU e9QmkiwAYz3MriXFz0LgSFPithiLGCwsyGKGLisVczcoCpN2Mh4gZ7mS0Iugy0rrChSnc0juGYq yG2ZrJWuOwycDBefzYLh4UxL08GlvUIP9XC7fBTEcosZQl3k9i3F3F1uUzBqCIUgGDMHmF+9JW+ VrPi4F2Lz7d2+EVQihLq8QT6IoU+aiwDlHodOl04LQd9a92rzP7UGTqH7idqDJjH6vAXwMh0Qw4 udF9lMsdLFUqO5ikYkDMtlolratzqThH5Az/A9LFd+c3zpJvTQZ25v1sAKVPnKXUJDZwD2+pIkG +KMCpHt02hPHttKKfxolte4FXkQzk1V4hKbdpahadN98uUPVityKckSZvuw5uFFWLJ8j3DRd0tm ex5WZCiztgdnpWZ3Z23x7zk+/qVBk9Wn2AYVC8nsgDiJJ9AKa0RKCrDKeh+zIcPPLx/60U5/iDe c3MQ7eQqNq1jsrfoET70+HpUDHw4TX7JsWPcMRXgNWjtkBgiRDC79LjlrJOMQoMgfjPMIj/cKCc js4lKsxpS5AMD97rqiQKEIybAUTE1U/4s7iGp0UHDdnSaSn5kUJoGok+xMCGMvrrlnygTUIyYO/ dRH2kKxwSXes4qA== X-Developer-Key: i=ribalda@chromium.org; a=openpgp; fpr=9EC3BB66E2FC129A6F90B39556A0D81F9F782DA9 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761786001042315792?= X-GMAIL-MSGID: =?utf-8?q?1761786001042315792?= When upreving llvm I realised that kexec stopped working on my test platform. This patch fixes it. Signed-off-by: Ricardo Ribalda --- Changes in v5: - Add warning when multiple text sections are found. Thanks Simon! - Add Fixes tag. - Link to v4: https://lore.kernel.org/r/20230321-kexec_clang16-v4-0-1340518f98e9@chromium.org Changes in v4: - Add Cc: stable - Add linker script for x86 - Add a warning when the kernel image has overlapping sections. - Link to v3: https://lore.kernel.org/r/20230321-kexec_clang16-v3-0-5f016c8d0e87@chromium.org Changes in v3: - Fix initial value. Thanks Ross! - Link to v2: https://lore.kernel.org/r/20230321-kexec_clang16-v2-0-d10e5d517869@chromium.org Changes in v2: - Fix if condition. Thanks Steven!. - Update Philipp email. Thanks Baoquan. - Link to v1: https://lore.kernel.org/r/20230321-kexec_clang16-v1-0-a768fc2c7c4d@chromium.org --- Ricardo Ribalda (2): kexec: Support purgatories with .text.hot sections x86/purgatory: Add linker script arch/x86/purgatory/.gitignore | 2 ++ arch/x86/purgatory/Makefile | 20 +++++++++---- arch/x86/purgatory/kexec-purgatory.S | 2 +- arch/x86/purgatory/purgatory.lds.S | 57 ++++++++++++++++++++++++++++++++++++ kernel/kexec_file.c | 14 ++++++++- 5 files changed, 87 insertions(+), 8 deletions(-) --- base-commit: 17214b70a159c6547df9ae204a6275d983146f6b change-id: 20230321-kexec_clang16-4510c23d129c Best regards,