From patchwork Sat Oct 22 15:23:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerry Snitselaar X-Patchwork-Id: 617564 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B28E9C04A95 for ; Sat, 22 Oct 2022 15:24:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229661AbiJVPYD (ORCPT ); Sat, 22 Oct 2022 11:24:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229519AbiJVPYC (ORCPT ); Sat, 22 Oct 2022 11:24:02 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 599BC12767 for ; Sat, 22 Oct 2022 08:24:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666452240; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=UWUkuuCod8l5bJVZ5tTL+4nS+qttcoxn4McrP045ChQ=; b=TJokguSn0Db3cXEbhlwYxS2ygiK9/C6rZNGZUXpuGx6OIc0G/xyRnR4xrM4XyV2bR6LjC5 tJYmwQfb2TvLWXOAJjevCLk0sfRNV9oLfGRcPkI9jICPsyhOxU8FPbGJmghQvbtI7TWZf0 7QHewkQ8i/QITCSxsPOrvHtmG3J5BHQ= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-640-ffCSfy1EOGur2LgQwF961Q-1; Sat, 22 Oct 2022 11:23:56 -0400 X-MC-Unique: ffCSfy1EOGur2LgQwF961Q-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 62CE08027F5; Sat, 22 Oct 2022 15:23:56 +0000 (UTC) Received: from cantor.redhat.com (unknown [10.2.16.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id A3AE22024CBF; Sat, 22 Oct 2022 15:23:55 +0000 (UTC) From: Jerry Snitselaar To: linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org Cc: Matthew Garrett , Jarkko Sakkinen , Bartosz Szczepanek , Ard Biesheuvel Subject: [PATCH] efi/tpm: Pass correct address to memblock_reserve Date: Sat, 22 Oct 2022 08:23:52 -0700 Message-Id: <20221022152352.1033750-1-jsnitsel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org memblock_reserve() expects a physical address, but the address being passed for the TPM final events log is what was returned from early_memremap(). This results in something like the following: [ 0.000000] memblock_reserve: [0xffffffffff2c0000-0xffffffffff2c00e4] efi_tpm_eventlog_init+0x324/0x370 Pass the address from efi like what is done for the TPM events log. Fixes: c46f3405692d ("tpm: Reserve the TPM final events table") Cc: Matthew Garrett Cc: Jarkko Sakkinen Cc: Bartosz Szczepanek Cc: Ard Biesheuvel Signed-off-by: Jerry Snitselaar Acked-by: Jarkko Sakkinen --- drivers/firmware/efi/tpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/efi/tpm.c b/drivers/firmware/efi/tpm.c index 8f665678e9e3..e8d69bd548f3 100644 --- a/drivers/firmware/efi/tpm.c +++ b/drivers/firmware/efi/tpm.c @@ -97,7 +97,7 @@ int __init efi_tpm_eventlog_init(void) goto out_calc; } - memblock_reserve((unsigned long)final_tbl, + memblock_reserve(efi.tpm_final_log, tbl_size + sizeof(*final_tbl)); efi_tpm_final_log_size = tbl_size;