From patchwork Mon Mar 27 15:06:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 7268 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1589921vqo; Mon, 27 Mar 2023 08:20:11 -0700 (PDT) X-Google-Smtp-Source: AKy350YqhhyhK8aEMIdjoBiOG/4aO7Urq4F4PnonXTzznuOPFaf8NnU7EdHlsFIYas5nCIkdT/QI X-Received: by 2002:a17:902:d4cb:b0:19b:dbf7:f9ca with SMTP id o11-20020a170902d4cb00b0019bdbf7f9camr14910892plg.0.1679930411701; Mon, 27 Mar 2023 08:20:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679930411; cv=none; d=google.com; s=arc-20160816; b=FudkxbPbW0knOFllpM6oVW+iGeMNzI7v1xZ14GDhdbaRsc4DQIekk5CLFz6BrqEBAw JMX5eOlnWUkJnJAm/DpxYQ9J8U2n2p8lOBpTM6G+IaQ+P9aN4pftqGsvGvDWl7munQ6Y XcXOFOuqfFo1kxiEEAlE6o/RsXB/iHomnCcoQXJGyM87y8SARJfLSTEjXHhgnQgVa395 KYCPL6vd+7ifwJYmgwhtCxjDdcy48xQlMVIPMqwsyeqtfRvZ2pWu519Zf5qSBxnvBvkE 881ONSBH+zyxVvvQLerpMe1JRaJkN6FKiB80F5QBpulKtIjA9TFEQfSzZCgR2NmPeZ91 MMoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:date:from :content-transfer-encoding:mime-version:subject:dkim-signature; bh=0UFEbGRqt7rcAskYsh6grJN74iOCdchpE+7TjNCjkL4=; b=LvMy1FM+PoXinA6mR9ZMHLJqUhxpi9Uz/H28rk8+EU3dhoDlc67sKe5nSTHd5Du8pj gfgan20ANnudhaLKWkh/h0m5oBSMoV+My0UPLJx1gtsJgCqKqO+ilXf1qInf1SGgg/ca gHGYiQiz6AyaO+2SBHQtN3e7LGvYwC1OkAusdjSf23i0oPjL98/jLsWS+tpMUkqsIWmh CWDq6S4mq27PQpbCEm/1Jb8DvCx/YPyKdjGBgwCofh5B2qr3TGEr3/v8q3O4Jf7ZH7Af hMxaIpTuhvrFn+aRPVC0qw3s77PrSH5ZyDm78ZFRkKVQfilI6+CH8KePDXysI55+NSA9 AOyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Uk5DlJVQ; 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 v186-20020a6389c3000000b00513234112b0si8451657pgd.892.2023.03.27.08.19.56; Mon, 27 Mar 2023 08:20:11 -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=Uk5DlJVQ; 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 S230104AbjC0PHP (ORCPT + 99 others); Mon, 27 Mar 2023 11:07:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232641AbjC0PHJ (ORCPT ); Mon, 27 Mar 2023 11:07:09 -0400 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D9453C13 for ; Mon, 27 Mar 2023 08:07:08 -0700 (PDT) Received: by mail-ed1-x52e.google.com with SMTP id b20so37594938edd.1 for ; Mon, 27 Mar 2023 08:07:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1679929626; h=cc:to:message-id:date:from:content-transfer-encoding:mime-version :subject:from:to:cc:subject:date:message-id:reply-to; bh=0UFEbGRqt7rcAskYsh6grJN74iOCdchpE+7TjNCjkL4=; b=Uk5DlJVQiFOCAyO438dQ7y0Ej9U8TJAs8QHDwkE8teva/DjvMijj58U7AhXnoBjQ/G sMbocm7tv2KfAU+4waZe+mvPneY1Q5hEX1Lrpg0DRJGJd1CjrR9Hl3L7lkeZ4wQa8ODj aODv3RNO6FnmDWelqP9k6fnKiRWop4LOPMcPY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679929626; h=cc:to:message-id:date:from:content-transfer-encoding:mime-version :subject:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0UFEbGRqt7rcAskYsh6grJN74iOCdchpE+7TjNCjkL4=; b=sK7FROMYwcSAKBDlisOL/ykkQee3SHlpLkhxjqcI1gLAuaqkUEbzYNovXjsk03bo5l g3Mpu/dScDYSUR4R0gYzgbD8Wu+Lig4+zO2wbgGsYVNEB73ca92zuNjTUpkR9HbV7c3g epKEyMXSD42PDkQwDTuyoUEXa1bnHDhKYF5/bWgZgesyoGt63ZktlPIRUED8CVDe/zBC w1QAwuZiAGUoXTI6fNrrEpx19RKynMT+J6O+Myzpb4DdozoptgCGpocqZcuKYrx9Wh3E zmS0UVzxVn9GivYQtnYkoBrejNHB5pdHJMYyeNem+lYKN4rkKbtZljj1OizjMfFc2cw2 YMzg== X-Gm-Message-State: AAQBX9dSjm8MlpNrWeC9SpfBsdTvOkYmVik2VaIeDkb1rFpEy/9triDe 2KfblhtV+GpNIbdsmH5henSBLGs6+MlPTCPQ8BoEeg== X-Received: by 2002:aa7:c609:0:b0:4fa:ecdc:e44b with SMTP id h9-20020aa7c609000000b004faecdce44bmr12080742edq.24.1679929626563; Mon, 27 Mar 2023 08:07:06 -0700 (PDT) Received: from alco.roam.corp.google.com ([2620:0:1059:10:ed3c:5e9e:b8e4:8695]) by smtp.gmail.com with ESMTPSA id t9-20020a50c249000000b005021d1ae6adsm5312428edf.28.2023.03.27.08.07.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Mar 2023 08:07:06 -0700 (PDT) Subject: [PATCH v4 0/2] kexec: Fix kexec_file_load for llvm16 MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAAyxIWQC/33N3Q6CMAwF4Fchu3Zm3fj1yvcwxkBXYBFGsgnREN 7dxkujXDWnzfm6ikjBURSnZBWBFhfd5Dmkh0RgX/uOpLOchVbaKKNB3ulJeMOBb5DLNAOF2ljQFQ ruNHUk2YTaY88tPw8DL3sXH1N4fX4swOPyj1tAKlkXedmixgJTe8Y+TKObx+MUOnFlbNG7gGbAgq LMZlCUefUDMLuAYSBrFeRYWkVl8QVs2/YGHtmubzQBAAA= From: Ricardo Ribalda Date: Mon, 27 Mar 2023 17:06:52 +0200 Message-Id: <20230321-kexec_clang16-v4-0-1340518f98e9@chromium.org> To: Eric Biederman Cc: linux-kernel@vger.kernel.org, Baoquan He , stable@vger.kernel.org, Ross Zwisler , Ricardo Ribalda , Philipp Rudo , Steven Rostedt , kexec@lists.infradead.org X-Mailer: b4 0.11.0-dev-696ae X-Developer-Signature: v=1; a=openpgp-sha256; l=1624; i=ribalda@chromium.org; h=from:subject:message-id; bh=c/Cef+C3wMgRslM3TKLYo/Fx7R2kWnifW8QXo2DyqYc=; b=owEBbQKS/ZANAwAKAdE30T7POsSIAcsmYgBkIbEOxUf1VwPNCpjkoRxJUrAGmu9A9fnWdmb5L5VA wW+pMCGJAjMEAAEKAB0WIQREDzjr+/4oCDLSsx7RN9E+zzrEiAUCZCGxDgAKCRDRN9E+zzrEiOjND/ 9IHDPa+BnNrrVbx15zUGOg/Puq2djPp0nMs1Bjy5OtucU4d8Mm5xg0Q9TwgufJuZ0NqYk8kGbja9Nu y6/2suuXEdMr9W0Zi1rxHlYgO2XAklZR15uUjk73Cx97mKWDt68p+VLcnNS967KJjB/6+Pi5uiLQ3l 3XKSfKrN/XZeqMzbViurzi0mWw7lO8/EwIgd23jYeButR4rSdqUWm3sdVLbm6PSgkAVdfOvP+BFvu9 1ytum13E5pu08RpMV8Zpj6tA0lcZTnAZ+2y+z2CL9BqemWA2PHfUtuS8jjOpUpmJyyjVQuOmznnEys gQ15HtMS2lVAYuG3g5oRk2mPjqEzkfkuql8384sq1uKzJ4HswLj4qRckUb+JQwE8NsNtHWvPXiX73g EyNoTPxWWp1I2uLyd9OhEWD1qGyKXhG5o5OuL+lOH7tIOw8P7xsLmKNz0jc5b3ASdjrUEgsWVo2QMF 0WTg5oXJ+GybniwJaGqZf6tq1LgzBXEtbVLYc4wMPg46eyALDK/pXJkW8mt7snIYk85cVBj6kHWnmH DIDC86y0ogc4WKXaqRcg7Srs9pPWWVes9VAKbTthTWMkM+Oev09qbdFB1M9Upic9XYO8kWt7Mz11l9 cnjS2Lt/NrLGwv14oa5zOpPSV495yV2BSx5ko0aGP+Xy8NdYt+73I0yHsxXg== 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?1761534711506902682?= X-GMAIL-MSGID: =?utf-8?q?1761534711506902682?= When upreving llvm I realised that kexec stopped working on my test platform. This patch fixes it. To: Eric Biederman Cc: Baoquan He Cc: Philipp Rudo Cc: kexec@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: Ross Zwisler Cc: Steven Rostedt Signed-off-by: Ricardo Ribalda --- 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 | 13 +++++++- 5 files changed, 86 insertions(+), 8 deletions(-) --- base-commit: 17214b70a159c6547df9ae204a6275d983146f6b change-id: 20230321-kexec_clang16-4510c23d129c Best regards,