Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5807248ybe; Tue, 17 Sep 2019 13:59:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqxglS9Nk+r8SWoW3+s3kE1fuFvOa5eN2sSU0V+pQj/6VzKv0/YyFNiuDDc7oDGmsfPWtb+7 X-Received: by 2002:a17:906:fad6:: with SMTP id lu22mr6403183ejb.98.1568753947663; Tue, 17 Sep 2019 13:59:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568753947; cv=none; d=google.com; s=arc-20160816; b=ZaMKocHgRVdn5pYA7LDA+OVwaX0Uc8ZkjREfglOnhTsw7idB29O9cXW06wIMHcn8Zh iASppRiME7CVaLxm3LX0qtZWMIdioD3UoNA5Ot5C5KCrTNi5y0f2UfEwUom544d/zAne 9dgiSZkfF4B7c4ApmsKNaSjFZzVatwi8yTucvj1fDyM4+HdKz77CH9MlBBKMv65KcdxX HgzwBlNglwmK4xbU58vnwPJ31KQHN+G5uhHadHILfC48qSTyxUWyT9y64VB9ZSBPfZ74 TLuN57ChJC/+NjZa58gm/c5a2zHrapgsv6mFHxZ5gZxAPnl6lR/expvliN9bmWNHfPPT UAFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=TB55ogVb7L8Rnu3J7GOd1CTL9DFPAcCA1b2WA++LLLI=; b=fus+PvU/ev+7SFv1XeWMdVHLslFYTObDAtxp35YMrne7uez9a/Jw08q7T9MeO6nH35 khD40Ua4/RkMqkDN0Kc5eyPNZfAqmsAWV3/iinkl6hS7e1YSplVwjvHpZWZs5gP7dCqy N9OCOw+2Vya2h/tP8NgKIy+4Wuk+Mz64u+NlKYPKQ0HVJz6XPLjFE5Ki83WTd+cON9oe l8SA2jcc7uG86opbpqNFznZVd5JPTBIV56pLCD4Go/cT/qujfUwcmQOlS7hn56KJ2ata 5uNJP/pPDSpm1QwFJtcqGPwEsGuYqI/NMn7gX8GcR4cF9N6z/olOw99B8KxRqcl0z9AV 03AA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="eXL7i/wN"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w13si2059761edx.361.2019.09.17.13.58.43; Tue, 17 Sep 2019 13:59:07 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b="eXL7i/wN"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730024AbfIQUyS (ORCPT + 99 others); Tue, 17 Sep 2019 16:54:18 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:39149 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726044AbfIQUyR (ORCPT ); Tue, 17 Sep 2019 16:54:17 -0400 Received: by mail-ed1-f66.google.com with SMTP id g12so4602463eds.6; Tue, 17 Sep 2019 13:54:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=TB55ogVb7L8Rnu3J7GOd1CTL9DFPAcCA1b2WA++LLLI=; b=eXL7i/wN7GH6Vg8CmKxQzNRZqwTGKPKReKUXNjbUDxJBsbaoKuTv2WhQj5LHhHJpXm oautn+efA3gz0kSro5bUCcJVZQVBLUyLxb4YCuWmAzRzrnBA5MJZsem6hlUSZVWup6a/ Xvf+SgcqbOGD2PwUX6hzZN80jtJYz35lyc6BeP/7YTPTcRoJ888Y6II9fuYR+tj+KonK C2uTpTrcHKeOpqpjfWBqbzbnGojiJdArPYR41YbhBDpXniyg7vdT3iuaMzjOsf1hsvlb mlojdKbD+hLueWkALJGurBh6/X17j9NQAxEpUCYwgTZIHI2G1N9CsY55cso3hXb7ttqf hZqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=TB55ogVb7L8Rnu3J7GOd1CTL9DFPAcCA1b2WA++LLLI=; b=LSkG27rZWs3XlZG6Y9pgkusPkvgFY+MgN76BgD8I6tw/ULA4Fjgep7N9lDSu4MRXoO N+bENX+vGvgIeHd62RSyvj8dJsBJSbJqaGM/qyVV8hjmvs9xsSQeSfeEGV7alz3+1xau 5IQYV/OhnSH2tCNZ0LP1jC6g4QEuvpGT78jCRI7ZYhzItUqecDTb1jB5vWdpjV/L/zH5 Y9oRD+Xs1WXAW5N0CdJDnSf3Ul4jX8aPk/hM6n+RQB9yAnyU+E6Ko0NBdrs0t+PEbpAU 2Y1Yp9c4fDGH62Vhd+4XCwP1/ziltR6lLLzH+7e6ezTBj0jsiFd6CI1Ky60DHbPx0EEv jIOQ== X-Gm-Message-State: APjAAAWSN0ycK/CxWW0bWqv8VKs5IZusLRIS1pD5CuaAj6rnuwqxo9TW FKmE0/5XEm571qGe79d4/Z8= X-Received: by 2002:a17:906:6dd4:: with SMTP id j20mr6585951ejt.173.1568753656032; Tue, 17 Sep 2019 13:54:16 -0700 (PDT) Received: from hv-1.home ([5.3.191.207]) by smtp.gmail.com with ESMTPSA id h3sm407037ejp.77.2019.09.17.13.54.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Sep 2019 13:54:15 -0700 (PDT) Date: Tue, 17 Sep 2019 23:54:03 +0300 From: Vanya Lazeev To: Jarkko Sakkinen Cc: Peter Huewe , Jason Gunthorpe , Arnd Bergmann , Greg Kroah-Hartman , linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4] tpm_crb: fix fTPM on AMD Zen+ CPUs Message-ID: <20190917205402.GA2500@hv-1.home> References: <20190914171743.22786-1-ivan.lazeev@gmail.com> <20190916055130.GA7925@linux.intel.com> <20190916200029.GA27567@hv-1.home> <20190917190950.GG10244@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190917190950.GG10244@linux.intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 17, 2019 at 10:10:13PM +0300, Jarkko Sakkinen wrote: > On Mon, Sep 16, 2019 at 11:00:30PM +0300, Vanya Lazeev wrote: > > On Mon, Sep 16, 2019 at 08:51:30AM +0300, Jarkko Sakkinen wrote: > > > On Sat, Sep 14, 2019 at 08:17:44PM +0300, ivan.lazeev@gmail.com wrote: > > > > + struct list_head acpi_resources, crb_resources; > > > > > > Please do not create crb_resources. I said this already last time. > > > > But then, if I'm not mistaken, it will be impossible to track pointers > > to multiple remaped regions. In this particular case, it > > doesn't matter, because both buffers are in different ACPI regions, > > and using acpi_resources only to fix buffer will be enough. > > However, this creates incosistency between single- and > > multiple-region cases: in the latter iobase field of struct crb_priv > > doesn't make any difference. Am I understanding the situation correctly? > > Will such fix be ok? > > So why you need to track pointers other than in initialization as devm > will take care of freeing them. Just trying to understand the problem. > We need to know, which ioremap'ed address assign to control area, command and response buffer, based on which ACPI region contains each of them. Is there any method of getting remapped address for the raw one after resouce containing it has been allocated? And what do you mean by initialization? crb_resources lives only in crb_map_io, which seems to run only once.