Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp685065ybx; Wed, 6 Nov 2019 06:58:11 -0800 (PST) X-Google-Smtp-Source: APXvYqyApPQEMN8PNOeB8KCM2cDBWEsP0Lydl48HgNnOwSymuBuS0HRlsrxT40677AXCL3dKARa8 X-Received: by 2002:a17:907:2061:: with SMTP id qp1mr18932782ejb.43.1573052291751; Wed, 06 Nov 2019 06:58:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573052291; cv=none; d=google.com; s=arc-20160816; b=WA0b8UsIM+ptdxpfz0ydpy34P66ZSlAHUDSXs2kTNTJj5hzv9ZrYR/OVO0j95oO0Op BaivK2Cg0BsZxKOvSEGEkxNK8QreO87BGxRVNalST+9T6dEI9mAgkYBRBg10vT+O9tCo CLoLMgDE1EFFNeYNFEt1ZKqYHRYcdHSJMd493bM8xx2JD7rGgfAoSoEZDxhm/Fq37kL6 HEz65Adm8Quo84AH5Kg6Xkzc8K+o+oqsX9yY7qKO3S+CQoOiu/qzME8cbV5Y4Ckix/he RTGFIt/luh7Ajzf1dLGw0TumMqAHVMcwvw6tA4Rn2MlHhqt7D4feT2DTcFqpwLEeYoNC BXlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=lgS6oa1hjOz0a7sAMRli19rgC0t4E8eWcY2r+LGoSt8=; b=Ep53SlNNkGd+xei6fBE7a6wAOzh4PvAa3HUIfrEnEI1RbRQ48Z6DxBh9+ObGp20m6Z K1WL7kxhYf2xqJ+XLqcfx5odE0Pgkq7g3URJW3ajtIe3iNf/l2j0zyfFCEjG34aEuAnB 6SWjcfEHfgwlq6rW+90/YYamQTUWXlmZs5BIJIG4L2dnP4Z05UufyxxSofy0uAUxkO8H nqHdEZ/iJeG+Uxq2TzUBe2niOxkQ2uI9dQcyqLLMsEtxP0LVTgJvC4Rt5bRRAoJ5svL4 OWdZTu6jg+Fwa2+Fxv81/VRo8hoUmxMCFjcz4utwFGhCS2YRgHGJFh/ysTLftX9yqs9s Aruw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IuqpNvHB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n27si1207802ejl.272.2019.11.06.06.57.48; Wed, 06 Nov 2019 06:58:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IuqpNvHB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731865AbfKFO4i (ORCPT + 99 others); Wed, 6 Nov 2019 09:56:38 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:50284 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731744AbfKFO4h (ORCPT ); Wed, 6 Nov 2019 09:56:37 -0500 Received: by mail-wm1-f68.google.com with SMTP id 11so3837471wmk.0 for ; Wed, 06 Nov 2019 06:56:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lgS6oa1hjOz0a7sAMRli19rgC0t4E8eWcY2r+LGoSt8=; b=IuqpNvHBanfnYSVZ5j7jiuo4VXzu5iZGHocJHHl8+scedrnAiNU/1x+nnfkvr354bq LCIFfBRZoPQO8KAY60Zuahuo5tN7x90xhlxL3qAf2dTATPqvAdyvgTbxzzENXVhpch9q UPl+etXZLHBXjGPJrUxr7aj77UnrG83m/y3wrGG/3bdVKdrPd42g5Ib0osdA67mt2LPu 1LKtR2Wn9mxnBp3wnbfC7EYobt6ax/v208MuqwpzNqyIeIJI3oIQV9ULm4GpDPsRXRf0 rpSYn87UXS5+FtjWLRGpDNs5Q161eIXrcGy25JQdDpj+nTRL5lRFc61v3q3NjMabSYfR wQIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lgS6oa1hjOz0a7sAMRli19rgC0t4E8eWcY2r+LGoSt8=; b=azqIl01fwGm36gFFoAwrkrLlRqloNH+hSAethbmnKLw1925uQ6gEOIUkP1XJGz9huV BbFnNqRQWZrUdDZ0DpWwcPoOoj88ugSEOumUcILy4rZEhpE4NG6gekLlEQju1HW/qGr4 W0uyDb0VnXCcAsIiOSnP5TRD6Zu7f5ylzWelWDOn3z5qCy8Nw7Z4U38rkFOryr9crErd L71xFouEWs3gpHRa3H1jeCh0D32ZSUEHQZgG6oGWegtrMUdTy4sWDNm3Yiy/4lTWXrGu D2fQhB+PvayyrUsJ4EKn+8U4MF7D99g23Q94j/GVTuoZZsob+9ItwnXqIT+oug1czCGX urMg== X-Gm-Message-State: APjAAAVed9IUntmJtiJ6uYm04flxL0NW3tsGUiK/24WSvzT8+as+uifG bVRp1P5jrCD8iexz399b1WpSAdcFIs54X6Qiu+dUXA== X-Received: by 2002:a1c:3d08:: with SMTP id k8mr2732012wma.119.1573052195053; Wed, 06 Nov 2019 06:56:35 -0800 (PST) MIME-Version: 1.0 References: <20191105082924.289-1-kong.kongxinwei@hisilicon.com> In-Reply-To: <20191105082924.289-1-kong.kongxinwei@hisilicon.com> From: Ard Biesheuvel Date: Wed, 6 Nov 2019 15:56:23 +0100 Message-ID: Subject: Re: [PATCH] EFI/stub: tpm: enable tpm eventlog function for ARM64 platform To: Xinwei Kong Cc: Ingo Molnar , Will Deacon , Kate Stewart , Thomas Gleixner , Steve Capper , linux-efi , Linux Kernel Mailing List , Linuxarm , zoucao@linux.alibaba.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 5 Nov 2019 at 09:29, Xinwei Kong wrote: > > this patch gets tpm eventlog information such as device boot status,event guid > and so on, which will be from bios stage. it use "efi_retrieve_tpm2_eventlog" > functions to get it for ARM64 platorm. > > Signed-off-by: Xinwei Kong > Signed-off-by: Zou Cao > --- > drivers/firmware/efi/libstub/arm-stub.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/firmware/efi/libstub/arm-stub.c b/drivers/firmware/efi/libstub/arm-stub.c > index c382a48..37c8f81 100644 > --- a/drivers/firmware/efi/libstub/arm-stub.c > +++ b/drivers/firmware/efi/libstub/arm-stub.c > @@ -139,6 +139,8 @@ unsigned long efi_entry(void *handle, efi_system_table_t *sys_table, > if (status != EFI_SUCCESS) > goto fail; > > + efi_retrieve_tpm2_eventlog(sys_table); > + This function allocates memory, so calling it should be deferred until after we relocate the kernel, to prevent these allocations from using up space that we'd rather use for the kernel. Does it work for you if we move this call further down, right before the call to efi_enable_reset_attack_mitigation()? Please confirm. > /* > * Get a handle to the loaded image protocol. This is used to get > * information about the running image, such as size and the command > -- > 2.7.4 > >