Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1820584ybh; Tue, 14 Jul 2020 08:10:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzk0hnFVGfB4AJtaHhmZPmkPLEr0ctbRPOhSqQLIhWP2W1gCRD7dC3U1sJ3COdctP0Uh7cK X-Received: by 2002:aa7:da8d:: with SMTP id q13mr5010689eds.339.1594739427487; Tue, 14 Jul 2020 08:10:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594739427; cv=none; d=google.com; s=arc-20160816; b=x5+iB0SHGCktiEQ3bFcBXRS6ZZ3nWTTBYs8MXMKewaCeIOwjkV6a8OLN8a9FgXtNfC hbY58fyeTK8zY2qmqC/JsXbuuG0Jdmm1o6J485DcG+g5p/CsOk7ug/EdsfJSL5UsHpjB WQblU7VF9BNjUmzfsJEXLYzrPpM+ixViGodZ+KuqUDPtH1SShPUzETMGpvHYUULn5zQK ejkSfKcDaqeSlIs/pQTUIwsOoa4O0XcaSjwldqjszJxnlaStoKyZF4qfLUJPj13cgz4V 62v+dAXIStzb7X26FwpaT77fajd2kBqtltXeW/m+1xP3M56XM3JVxoANeWP/MSuVqBra fqtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=3g/MfFdVxakLQsSQNSL7M6QJveqbDUTau2qWHIQDURQ=; b=td3RW5iXEe/IMZo6ggTAUQ0quCXx8gtPyRSKVYvRj1C4GUYTWSLLv4PtfmW48qmPgZ 9bToB1CLhL0rV7zl5MaCRfBBReLYm+emH+7CV7MhFUSslp3ELKYPmWjnV5thAIAPqAOd r6EzOS7ChpDa+Da7yk/plEpJbujJ85LSZHAVevOz9vvJeZFiad//SzubjmaOtpMZJVxg GWQc4MjA8indaNzr/XhJcd7C2odSdkXhwmcqlRWTf40WSzW1SMMakAXr9PL0H+IijqXk 8upTt1DYEn1Gpua5tdY7NMDoKDQGk39FjbZUZYYZFIU+IU4rgoy7v/NpnDqlfY+hc1WY RY9Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lx8si11747205ejb.415.2020.07.14.08.10.03; Tue, 14 Jul 2020 08:10:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728724AbgGNPHy (ORCPT + 99 others); Tue, 14 Jul 2020 11:07:54 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:18708 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725876AbgGNPHy (ORCPT ); Tue, 14 Jul 2020 11:07:54 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 06EF3ACR030872; Tue, 14 Jul 2020 11:07:46 -0400 Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0b-001b2d01.pphosted.com with ESMTP id 328s1hqkw0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 14 Jul 2020 11:07:46 -0400 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 06EF6Jql030994; Tue, 14 Jul 2020 15:07:44 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma04fra.de.ibm.com with ESMTP id 327527hrbd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 14 Jul 2020 15:07:44 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 06EF7dma53805290 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 14 Jul 2020 15:07:39 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B95FBAE057; Tue, 14 Jul 2020 15:07:39 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0C3A7AE05A; Tue, 14 Jul 2020 15:07:39 +0000 (GMT) Received: from localhost.localdomain (unknown [9.85.155.184]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 14 Jul 2020 15:07:38 +0000 (GMT) Message-ID: <1594739258.12900.164.camel@linux.ibm.com> Subject: Re: [PATCH v2] powerpc/pseries: detect secure and trusted boot state of the system. From: Mimi Zohar To: Daniel Axtens , Nayna Jain , linuxppc-dev@ozlabs.org Cc: Michael Ellerman , linux-kernel@vger.kernel.org Date: Tue, 14 Jul 2020 11:07:38 -0400 In-Reply-To: <87y2nmtxce.fsf@dja-thinkpad.axtens.net> References: <1594434329-31219-1-git-send-email-nayna@linux.ibm.com> <87y2nmtxce.fsf@dja-thinkpad.axtens.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 (3.20.5-1.fc24) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-07-14_05:2020-07-14,2020-07-14 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 bulkscore=0 lowpriorityscore=0 impostorscore=0 spamscore=0 priorityscore=1501 malwarescore=0 suspectscore=0 mlxscore=0 clxscore=1011 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007140113 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2020-07-14 at 16:38 +1000, Daniel Axtens wrote: > Hi Nayna, > > Thanks! Would you be able to fold in some of the information from my > reply to v1 into the changelog? Until we have public PAPR release with > it, that information is the extent of the public documentation. It would > be good to get it into the git log rather than just floating around in > the mail archives! > > A couple of small nits: > > > + if (enabled) > > + goto out; > > + > > + if (!of_property_read_u32(of_root, "ibm,secure-boot", &secureboot)) { > > + if (secureboot) > > + enabled = (secureboot > 1) ? true : false; > > Your tests double up here - you don't need both the 'if' statement and > the 'secureboot > 1' ternary operator. > > Just > > + if (!of_property_read_u32(of_root, "ibm,secure-boot", &secureboot)) { > + enabled = (secureboot > 1) ? true : false; > > or even > > + if (!of_property_read_u32(of_root, "ibm,secure-boot", &secureboot)) { > + enabled = (secureboot > 1); > > would work. I haven't been following this thread, which might be the reason I'm missing something here.  The patch description should explain why the test is for "(secureboot > 1)", rather than a fixed number. thanks, Mimi