From owner-svn-src-head@freebsd.org Sat Feb 1 20:30:01 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D141E22AEFF; Sat, 1 Feb 2020 20:30:01 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-ot1-f65.google.com (mail-ot1-f65.google.com [209.85.210.65]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4895LK53wdz41nR; Sat, 1 Feb 2020 20:30:01 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-ot1-f65.google.com with SMTP id r16so10014226otd.2; Sat, 01 Feb 2020 12:30:01 -0800 (PST) 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:reply-to :from:date:message-id:subject:to:cc; bh=HWKpdWp/uW4F7uaBYiv31Ix/BbBxikz5uoamO/EBE+Q=; b=mpciBbGccmD7iAbw61aELIA+sHOh60VwgWZO65MAMQtXmhIZ3Dj99Psxh6drYP7GRi EIdbGTRN0yCYrui0qn4ZHvFWsR1UdwavYop4sRRMmIo2/5wYpMOPx9qo8Z8EwzpArg5x kk/gV9Gamt+X4gN6tkJs4f6iaGV36mRdI9keXTQzubrx5MQGKMnU8p4/oIGJ3RmmzICW iRTVXUhydX4nSTaGi8ZiPsD/BYslcu2jpm19scfHKOzswJSS2Pc4W5qZfd+JrkSzq1FI isCm359nZgj/aRnEg0INNh7c4Gc58/XnHLVG5WsdQ5kJ/3pMCI3yM6elYnZjQdXEXhum gThA== X-Gm-Message-State: APjAAAV9tqXp5Htxjvv6vYwH1dR+0GWI6CL7m7aGoXYfz8b1XeVHZv1Q AXWyT96YxJvG939+MDppHHPZ3l9P X-Google-Smtp-Source: APXvYqxf7/eIF7eM7T4WNirGqaA0/5vC3+lprVOX8QnlZVa9sdNcCuTPxn0go/KQnRW6uk9+WRbjRQ== X-Received: by 2002:a9d:53c2:: with SMTP id i2mr11616175oth.43.1580589000277; Sat, 01 Feb 2020 12:30:00 -0800 (PST) Received: from mail-ot1-f54.google.com (mail-ot1-f54.google.com. [209.85.210.54]) by smtp.gmail.com with ESMTPSA id m2sm3928539oim.13.2020.02.01.12.29.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 01 Feb 2020 12:29:59 -0800 (PST) Received: by mail-ot1-f54.google.com with SMTP id i6so9976931otr.7; Sat, 01 Feb 2020 12:29:59 -0800 (PST) X-Received: by 2002:a9d:7593:: with SMTP id s19mr11684565otk.219.1580588999537; Sat, 01 Feb 2020 12:29:59 -0800 (PST) MIME-Version: 1.0 References: <202001311936.00VJaEDP056807@repo.freebsd.org> <18BC9807-4B4C-482C-AB7E-20F9C7B68F29@FreeBSD.org> <4a87b670557d23181c3a98bc5a65c8c1a42302d3.camel@freebsd.org> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Sat, 1 Feb 2020 12:29:48 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r357349 - in head/sys: conf modules/tpm To: Dimitry Andric Cc: Ian Lepore , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4895LK53wdz41nR X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 20:30:01 -0000 On Sat, Feb 1, 2020 at 10:10 AM Dimitry Andric wrote: > > On 1 Feb 2020, at 18:48, Ian Lepore wrote: > > > > So you're going to switch from writing 0 to writing 0xfffffffe, and > > just assume that will work the same? > > ... [Caustic sarcasm elided] > > Hmm, the data sheet says: > > Writes (0000 0001h): Cancel a command > Writes (0000 0000h): Clears field when command has been cancelled > > It seems the other bits in the register are not used for anything. This seems pretty typical for TPM registers (in my limited experience). > So indeed it is probably better to explicitly define these values as 0x0 > and 0x1, and not use ~ or ! operators at all. I would suggest using just a plain 0 for the clear-cancel register write, unless the other bits are actually documented to have meaning, and that meaning is not W1C. My recollection is that many TPM registers only have a single real valid bit, and of those that have more than one, many are W1C. (AND4/OR4 RMW are inappropriate for W1C.) We have at least one AND4/OR4 related bugfix pending in phabricator related to this that I should go ahead and commit: https://reviews.freebsd.org/D23081 . I don't think the ~0x1 (0xff...fe) will actually do anything harmful if the other bits are ignore. But 0 is closer to the data sheet. Please un-disable the Makefile warnings removed in r357349 earlier, too. Thanks, Conrad