From patchwork Fri Feb 10 08:03:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Donnellan X-Patchwork-Id: 55303 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp821422wrn; Fri, 10 Feb 2023 00:08:00 -0800 (PST) X-Google-Smtp-Source: AK7set8JThgspljCRU86+EV61YJ/0k7vHBGvd5FmbkN2T3uNZTOzz+RvLuC0bP7Ng9NPlAgySW8i X-Received: by 2002:a50:d547:0:b0:4ab:15d9:2dae with SMTP id f7-20020a50d547000000b004ab15d92daemr8819790edj.14.1676016480321; Fri, 10 Feb 2023 00:08:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676016480; cv=none; d=google.com; s=arc-20160816; b=wVMHX34BNYiscuf/YVeRnj4RNlI1MGCGE/wbxvX7AYiDKRo2PBE0P7LimzK41gee4k 6vIAsXqurkGJmf/Hj7YeYd61Ui514IIpDBS7KDMe1WE30kxqP5tZps8QUfhyK/Iq5bNs FYITNH+oXKFShwGYQ7qyOQ/9p2+PY/009ahtR3HNKUBQcH+R4hImACUK0WMXanjKrvak aH9fOoWMX6SuEdbZa6/Q0Sp8gYn7ggIDxko4QGqt0Ylx+MzluBHU/yA1ZVWGweJ6Yj4Z PL9eblWVWBa+cY+BWwgBrEDdBF3M9nSgsYA9nnGKspFgAOTO//KCkjdDChLJu1vZni/a QSoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=w+TVcrzCzgtgNHsymCu63Bi0OTVfuzZdP7nE3gzDQP8=; b=ubTClF/G0uvTUUUCnCA94l9vWF0FdKE8qQEcyCPkzh/Ko2NGC0NOc3MxpPyxdeA46J xhw6IcnsOX4RC4ST9+8ea0KEKlh1fkNAEwxXvGpD0freua1NuJOmpcwV1YglqMzDDSje CrK2pZJVZ6Er+gXXDkbqeYRSh77EaMrjG75yP1fKa1IYfKKOQNFY5ubNXumCJSWUaaZS +7UqSWgCnRQmg4iOcQ+pyCWWXxQ6zIw81y90aAf2EVRBpqsXpPgosNtT2eVpp8osWYnn F/6aCce4R2wO8TjIO1wv8f+zKoa0+ORu/s7vmvJf7PcSagMrjyyCdDa7/pzaZ6NN5oFS uJXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=pJI1la8T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bm8-20020a0564020b0800b004ab1f89c649si3849345edb.337.2023.02.10.00.07.36; Fri, 10 Feb 2023 00:08:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=pJI1la8T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231687AbjBJIF1 (ORCPT + 99 others); Fri, 10 Feb 2023 03:05:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231590AbjBJIFA (ORCPT ); Fri, 10 Feb 2023 03:05:00 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53FAB8184D; Fri, 10 Feb 2023 00:04:37 -0800 (PST) Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31A80ZJA002097; Fri, 10 Feb 2023 08:04:29 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=w+TVcrzCzgtgNHsymCu63Bi0OTVfuzZdP7nE3gzDQP8=; b=pJI1la8TLwy9o1274yA/N5K+JKtRLGLR+G6qAcjebma0GdSRCYKYYcY3xX5NLlNvM1pq Leu5dXqbsWrX0xaM77LQ/nDzV/qBUZwavLfIjZt+1bhATWLt33y4Y9weAesAnIbKvKyZ ViH2C+wkyrLE7J2DxfwhV5z1J15fQmMVM2wf5jfaWlg6awGCiHHzS3/swTDPp2py8yUG P6p2uEXx0AIvLSkl44Yl2tuyVeiZsYA+GENEpgGrifTtHbFSSee894CL4qTd5Ebb3Qv+ /OzVizq98mU4BnnM6NVGMUAKYu5xK9VOf5ugxXFi00cgekSG2aCbQYAe7xffd86dqUs1 2w== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3nnj1r033j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 10 Feb 2023 08:04:29 +0000 Received: from m0098409.ppops.net (m0098409.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 31A81Hbj007960; Fri, 10 Feb 2023 08:04:28 GMT Received: from ppma03fra.de.ibm.com (6b.4a.5195.ip4.static.sl-reverse.com [149.81.74.107]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3nnj1r032n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 10 Feb 2023 08:04:28 +0000 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 319ECHSp016371; Fri, 10 Feb 2023 08:04:26 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma03fra.de.ibm.com (PPS) with ESMTPS id 3nhf06n3uv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 10 Feb 2023 08:04:25 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 31A84NeT25363008 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Feb 2023 08:04:23 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AC06C2004F; Fri, 10 Feb 2023 08:04:23 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 28D282004B; Fri, 10 Feb 2023 08:04:23 +0000 (GMT) Received: from ozlabs.au.ibm.com (unknown [9.192.253.14]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 10 Feb 2023 08:04:23 +0000 (GMT) Received: from jarvis-ozlabs-ibm-com.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id DC894609BD; Fri, 10 Feb 2023 19:04:15 +1100 (AEDT) From: Andrew Donnellan To: linuxppc-dev@lists.ozlabs.org, linux-integrity@vger.kernel.org Cc: ruscur@russell.cc, bgray@linux.ibm.com, nayna@linux.ibm.com, gcwilson@linux.ibm.com, gjoyce@linux.ibm.com, brking@linux.ibm.com, stefanb@linux.ibm.com, sudhakar@linux.ibm.com, erichte@linux.ibm.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, zohar@linux.ibm.com, joel@jms.id.au, npiggin@gmail.com Subject: [PATCH v6 22/26] powerpc/pseries: Add helper to get PLPKS password length Date: Fri, 10 Feb 2023 19:03:57 +1100 Message-Id: <20230210080401.345462-23-ajd@linux.ibm.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230210080401.345462-1-ajd@linux.ibm.com> References: <20230210080401.345462-1-ajd@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: oU1E0ckx3-nGLdwyDNq6whNiiXUu_k33 X-Proofpoint-GUID: tFkblVUtpxANZT4s6F0h26dlWwpPwuEC X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-10_03,2023-02-09_03,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 priorityscore=1501 phishscore=0 impostorscore=0 bulkscore=0 adultscore=0 suspectscore=0 mlxscore=0 clxscore=1015 lowpriorityscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302100070 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757430657282436947?= X-GMAIL-MSGID: =?utf-8?q?1757430657282436947?= From: Russell Currey Add helper function to get the PLPKS password length. This will be used in a later patch to support passing the password between kernels over kexec. Signed-off-by: Russell Currey Signed-off-by: Andrew Donnellan Reviewed-by: Stefan Berger --- v3: New patch v5: Drop plpks_get_password() since we no longer need to expose it. --- arch/powerpc/include/asm/plpks.h | 5 +++++ arch/powerpc/platforms/pseries/plpks.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/arch/powerpc/include/asm/plpks.h b/arch/powerpc/include/asm/plpks.h index 0c49969b0864..757313e00521 100644 --- a/arch/powerpc/include/asm/plpks.h +++ b/arch/powerpc/include/asm/plpks.h @@ -171,6 +171,11 @@ u32 plpks_get_maxlargeobjectsize(void); */ u64 plpks_get_signedupdatealgorithms(void); +/** + * Returns the length of the PLPKS password in bytes. + */ +u16 plpks_get_passwordlen(void); + #endif // CONFIG_PSERIES_PLPKS #endif // _ASM_POWERPC_PLPKS_H diff --git a/arch/powerpc/platforms/pseries/plpks.c b/arch/powerpc/platforms/pseries/plpks.c index 01ae919b4497..671a10acaebf 100644 --- a/arch/powerpc/platforms/pseries/plpks.c +++ b/arch/powerpc/platforms/pseries/plpks.c @@ -359,6 +359,11 @@ u64 plpks_get_signedupdatealgorithms(void) return signedupdatealgorithms; } +u16 plpks_get_passwordlen(void) +{ + return ospasswordlength; +} + bool plpks_is_available(void) { int rc;