Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp502190ybl; Fri, 30 Aug 2019 03:03:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqwAHJ+rK3CPkyRSSOn2nwHnvnvo0wGYvSwiBo8n3JjBwgWlBgf8EUsJ2MpS+q/dRbKcFls6 X-Received: by 2002:a63:2a41:: with SMTP id q62mr12439753pgq.444.1567159403143; Fri, 30 Aug 2019 03:03:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567159403; cv=none; d=google.com; s=arc-20160816; b=gqJzRHhFx0FfRqOOalQV44WndCRhgOTGL79QjLbNob/CgzB3tEzLiEPbDdGdOFZPbM cRsDm1oxyg5FGnE1o1rlqQ+nFoKASICk7lpl6gm8dfuk5Jdddvb4199wFwwc2vodKFb8 tzTiATZAQkDydiklAwcTS0uMacOhPz7DDllS518fMqQnl0EnTUTKnREvpYutxDJj+ekt a8Iu5OR/+BFTkWo8V4X0+/t6Fv6YmOu0GPMThLCBgS/ZuI9RSSkqsWWW7xusoqzeGaZ8 VerrIbcBa2583fq4SgSg69UhGTpXX0mh8Sbw85njogsrQ5D/Mr3/yjtqdGAj2T4c5xY4 lF6Q== 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=BIMw0qKaytre7FG6jFJWV4iDfNINre/R6oO7ZIuT+RM=; b=moP1xEsnMwYAZkYiC54XWcNUGCNnDdr2i5VKwLXwO4/IvGS/lAjaeE0FFAxanvUAYx +8e+57ZXgGOMR0Ufc7ZxmpEKWl8NPqJSD9krYANVZyKo/tDSwxVgc8nCoure7aEBYWEm RNFpLqclJC6Frwn7ZqfwF2z2e9fxNwdYIy9Xgn2NnlIOiCxwBoxTA+cMbUeyuqkC4ULb Vq97O5ngG3Wc3SSr5yEAPYCCLBWPrNYAtJ8jsqEnQD0+k8iiT9dy2k3Ia3Outrtk4Qx1 9Gr3/fwV5ciLHX661Ih1sQs/eGDR1rY4iGcErAhTJOpUa99d1wZobjhpK+qHgnJJgyba Fktg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="a/iH+APt"; 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 b10si4369314plk.367.2019.08.30.03.03.06; Fri, 30 Aug 2019 03:03:23 -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="a/iH+APt"; 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 S1727464AbfH3KCD (ORCPT + 99 others); Fri, 30 Aug 2019 06:02:03 -0400 Received: from mail-yw1-f68.google.com ([209.85.161.68]:45455 "EHLO mail-yw1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726480AbfH3KCD (ORCPT ); Fri, 30 Aug 2019 06:02:03 -0400 Received: by mail-yw1-f68.google.com with SMTP id n69so2172949ywd.12; Fri, 30 Aug 2019 03:02:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BIMw0qKaytre7FG6jFJWV4iDfNINre/R6oO7ZIuT+RM=; b=a/iH+APt7PbRkzLKE6KRlBQQvNjly6EgIh2Equ0T3wdPNvBCM9eYU3/uElXpVQVpJP fIvORJDofPBr7LkutP4IBsVTrLCIsU0t10urIJmElXgiOXH4e9q1yYzyFv3+K2IuvN7P /Ri6HQg6AofF4T7y54qZ8rGDJnhYQ1axF/RdpptNCVAXHT7zXuUpoiPM7qmzBIXPDxkc yz43N32iSTODuXLhklnvg4xO3pFOf4iekY9g7XtUsy8MNVjxoZFssoP7e0AC4xiwpx7w LhUzFXBsgsK2+Z7kNAbqDpvfakxDCbYzgiv5ZQqwOCQA3uq2h0SksKwaWhinmCGs9EZi g2Lg== 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=BIMw0qKaytre7FG6jFJWV4iDfNINre/R6oO7ZIuT+RM=; b=o7467a9hQ2wg4Zp3nDa1ingY56rPNguUXkiOeQydiaOiCGeAk8zo5CPMRD1sti7E2t 7wrBY6KN0LS5NZXGIUCloFJHNGUSgOsGkR2CX9yPJGE460MJh5p+HdJ23LuherNrHSba ruTpdc0PMy+HRgZ0nfNUVbExIiz/1GRj0q+MKeJHtNjJRzOj4tLsm27V60wezjbO9rcw XVOhN+0/sPQ3iQL51+7/rRSofc1w/RZOrIAO/yMDm4maWJwYNvei2+Z1IIuFfME5LHty On0bY991M5Vf4KR2HnbTnY9PLcZ1vaC27UDdwAPSL8S/K1ryUQs2CkPj8dljKXRItGjL Ihlg== X-Gm-Message-State: APjAAAXX6aMTQp0ipPVje9gl0oY5TJVbQ/wUzm/CYedTRwgajvcqP5Zj K9PH+renSiOV5TFuaOXrquhHpRaUtnBUvSYIL+4= X-Received: by 2002:a0d:d596:: with SMTP id x144mr9971364ywd.69.1567159321875; Fri, 30 Aug 2019 03:02:01 -0700 (PDT) MIME-Version: 1.0 References: <20190826081752.57258-1-kkamagui@gmail.com> <20190827171106.owkvt6slwwg5ypyl@srcf.ucam.org> <20190829153437.gjcqfolsc26vyt4x@linux.intel.com> <20190829153917.glq6eoka2eufy42w@linux.intel.com> In-Reply-To: From: Seunghun Han Date: Fri, 30 Aug 2019 19:01:50 +0900 Message-ID: Subject: Re: [PATCH] x86: tpm: Remove a busy bit of the NVS area for supporting AMD's fTPM To: Jarkko Sakkinen Cc: Matthew Garrett , Matthew Garrett , Peter Huewe , "open list:TPM DEVICE DRIVER" , Linux Kernel Mailing List 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 Thu, Aug 29, 2019 at 06:34:37PM +0300, Jarkko Sakkinen wrote: > > > On Wed, Aug 28, 2019 at 06:36:04PM +0900, Seunghun Han wrote: > > > > > > > > > > On Wed, Aug 28, 2019 at 01:36:30AM +0900, Seunghun Han wrote: > > > > > > > > > > > I got your point. Is there any problem if some regions which don't > > > > > > need to be handled in NVS area are saved and restored? If there is a > > > > > > problem, how about adding code for ignoring the regions in NVS area to > > > > > > the nvs.c file like Jarkko said? If we add the code, we can save and > > > > > > restore NVS area without driver's interaction. > > > > > > > > > > The only thing that knows which regions should be skipped by the NVS > > > > > driver is the hardware specific driver, so the TPM driver needs to ask > > > > > the NVS driver to ignore that region and grant control to the TPM > > > > > driver. > > > > > > > > > > -- > > > > > Matthew Garrett | mjg59@srcf.ucam.org > > > > > > > > Thank you, Matthew and Jarkko. > > > > It seems that the TPM driver needs to handle the specific case that > > > > TPM regions are in the NVS. I would make a patch that removes TPM > > > > regions from the ACPI NVS by requesting to the NVS driver soon. > > > > > > > > Jarkko, > > > > I would like to get some advice on it. What do you think about > > > > removing TPM regions from the ACPI NVS in TPM CRB driver? If you don't > > > > mind, I would make the patch about it. > > > > > > I'm not sure if ignoring is right call. Then the hibernation behaviour > > > for TPM regions would break. > > > > > > Thus, should be "ask access" rather than "grant control". > > I agree with your idea. It seems to make trouble. So, I would like to > do like your idea below. > > > Or "reserve access" as NVS driver does not have intelligence to do any > > policy based decision here. > > > > A function that gets region and then checks if NVS driver has matching > > one and returns true/false based on that should be good enough. Then > > you raw ioremap() in the TPM driver. > > > > /Jarkko > > This solution is great and clear to me. I will make a new patch on > your advice and test it in my machine. After that, I will send it > again soon. > I really appreciate it. > > Seunghun I have made and sent patches on your advice. The patch links are below and please review them. [PATCH 0/2] https://lkml.org/lkml/2019/8/30/372 [PATCH 1/2] https://lkml.org/lkml/2019/8/30/373 [PATCH 2/2] https://lkml.org/lkml/2019/8/30/374 Thank you again for your sincere advice. Seunghun