From patchwork Mon Jun 10 06:32:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pierre-Cl=C3=A9ment_Tosi?= X-Patchwork-Id: 13691561 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 24DC1C27C5F for ; Mon, 10 Jun 2024 06:33:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Message-ID: References:Mime-Version:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=kpJPJ421Br39f6b81PKqHYAOIJ6IdQqNvd4LWmVGCPw=; b=CffMCkkkJL6FFstZlk8h8chhaP hS3cBsY/BcQmtcuLXd8P7FA6DiykR4sLdWYXD+/r1rtS9uv2VIjFNLhejW9g9hHI0+vixhoe9RKAx 2CJVq5s+3wulwv4tn1PFj53APro8HQ7Sm5BiCe1wuXu7l8gV54SU3Cz4e3Va+A+SwWC5LaRnolXWg 06B+8U+cuY0M6xFbf/xGlL1/pNHWdg/myOr38q5YBmaIY9Va0vV8lVd2XSAIwsVrJgj5lpAja8hi6 ZXjTAKo84PWymsSxRaGPGh6b8aXWtu5CKpJiyKTJxQyndWfdGFSwPTxsTZbM1z+6IBGvWQhqwSDBz 5yzqVQcw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sGYap-00000003zIk-0cbv; Mon, 10 Jun 2024 06:33:23 +0000 Received: from mail-ej1-x64a.google.com ([2a00:1450:4864:20::64a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sGYah-00000003zCr-46c0 for linux-arm-kernel@lists.infradead.org; Mon, 10 Jun 2024 06:33:17 +0000 Received: by mail-ej1-x64a.google.com with SMTP id a640c23a62f3a-a6ef729b8a7so121639866b.1 for ; Sun, 09 Jun 2024 23:33:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1718001191; x=1718605991; darn=lists.infradead.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=z0udD/PdRvQwx4wKxPuf11kZ4dOxHkqKwOOLvcn5nZA=; b=tX6lGDm3F515l47IdFrlTEmzZPapvpeknIldC2mQnjrClczcIcRRu80MyBr7xNnwbd SY/yBszEjEn2O9UPvaRbQCxULTbUGmp0ZoSX1wOaG/Hu/XAG5e0pSiQZe6PPZJODm/XK JCFApIzvF448nZY+67X0P4eucjyv5dhTmVcwIlO/p5mRCNAFGkdpbOc2sjvXASQAL13w FFr+1NWxADo+C3L+pEocuARvkJcs7Wev/0eoGL9kZ0xMSfJDCteV9NhvrN4gqQn62CcT I2j6J3aLZraQr2mXH0Bie168PT9Bsz6li7+SbPU4xy3WBe0A21l/44rlRT7RKNKfQm38 uFsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718001191; x=1718605991; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=z0udD/PdRvQwx4wKxPuf11kZ4dOxHkqKwOOLvcn5nZA=; b=L6JVa9xV3kl2silILxbnpkwRw3KSbNl4J65fdLGvhEjSmnyx3ga0ysi6Oo0iJxWbIj 5WJunnIS1NwtgjictDIM6jRmz0DBvQ9mJmPvBhCdocQvkGjUBOfpKyDeTYh8/FD5XaN6 YStbR1kDcH0/rwOFRDLGIOXm5vJcq6wpf8M+zSfuRMcwChFm49sP7bkLvioTnBs8OHB4 JgHKscDSDLOxfJHY+KO5N/e40Fm/e1qycQokL3pMrDcDZUIO+Og+Xs0yakx9v1GMCJh/ +/nJeXqSONeLovpsAykamsslImyx2/d3qHWc5gieUzuJSttKiQh4HFQaXSSLbkVODIkn U+dw== X-Forwarded-Encrypted: i=1; AJvYcCVneC1ZluMZB7FmBtnwO/wRX/dW7e+7MCG03vEYbpdGWK1LE/NM4IohtEAHwrQtA2Z1vQ6+AeWW++TTpQMnV0aFmdXG61ryEOKUcXkUSw5FkaT4R2k= X-Gm-Message-State: AOJu0Yxrkdr6wash1xci/MlsTNwVljuu3dx8jalXBQywYzoOCO3430mX YtD+iIyNlHxPhO6UuI4/UO1QSL31tDvQNmJ3v4u6AE9bsTuyREReyDFPQqKj3E9zSJ5S6HgsiQ= = X-Google-Smtp-Source: AGHT+IGv+s66RkOnG2No4QDLJnAjBEudC4CdDJBYCyTNdZf9o4rJX0PEOZM4CVBe0sIJilA7BZCLdN9lgQ== X-Received: from ptosi.c.googlers.com ([fda3:e722:ac3:cc00:31:98fb:c0a8:11ec]) (user=ptosi job=sendgmr) by 2002:a17:906:1cc5:b0:a6e:f44d:3c65 with SMTP id a640c23a62f3a-a6ef44d6407mr655866b.0.1718001190442; Sun, 09 Jun 2024 23:33:10 -0700 (PDT) Date: Mon, 10 Jun 2024 07:32:33 +0100 In-Reply-To: <20240610063244.2828978-1-ptosi@google.com> Mime-Version: 1.0 References: <20240610063244.2828978-1-ptosi@google.com> X-Mailer: git-send-email 2.45.2.505.gda0bf45e8d-goog Message-ID: <20240610063244.2828978-5-ptosi@google.com> Subject: [PATCH v5 4/8] KVM: arm64: nVHE: gen-hyprel: Skip R_AARCH64_ABS32 From: " =?utf-8?q?Pierre-Cl=C3=A9ment_Tosi?= " To: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org Cc: " =?utf-8?q?Pierre-Cl=C3=A9ment_Tosi?= " , Will Deacon , Marc Zyngier , Oliver Upton , Suzuki K Poulose , Vincent Donnefort X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240609_233316_114758_34A06864 X-CRM114-Status: GOOD ( 10.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Ignore R_AARCH64_ABS32 relocations, instead of panicking, when emitting the relocation table of the hypervisor. The toolchain might produce them when generating function calls with kCFI to represent the 32-bit type ID which can then be resolved across compilation units at link time. These are NOT actual 32-bit addresses and are therefore not needed in the final (runtime) relocation table (which is unlikely to use 32-bit absolute addresses for arm64 anyway). Signed-off-by: Pierre-Clément Tosi Acked-by: Will Deacon --- arch/arm64/kvm/hyp/nvhe/gen-hyprel.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm64/kvm/hyp/nvhe/gen-hyprel.c b/arch/arm64/kvm/hyp/nvhe/gen-hyprel.c index 6bc88a756cb7..b63f4e1c1033 100644 --- a/arch/arm64/kvm/hyp/nvhe/gen-hyprel.c +++ b/arch/arm64/kvm/hyp/nvhe/gen-hyprel.c @@ -50,6 +50,9 @@ #ifndef R_AARCH64_ABS64 #define R_AARCH64_ABS64 257 #endif +#ifndef R_AARCH64_ABS32 +#define R_AARCH64_ABS32 258 +#endif #ifndef R_AARCH64_PREL64 #define R_AARCH64_PREL64 260 #endif @@ -383,6 +386,9 @@ static void emit_rela_section(Elf64_Shdr *sh_rela) case R_AARCH64_ABS64: emit_rela_abs64(rela, sh_orig_name); break; + /* Allow 32-bit absolute relocation, for kCFI type hashes. */ + case R_AARCH64_ABS32: + break; /* Allow position-relative data relocations. */ case R_AARCH64_PREL64: case R_AARCH64_PREL32: