Received: by 2002:ab2:6841:0:b0:1f8:2b01:8fb7 with SMTP id l1csp1988504lqp; Wed, 15 May 2024 06:04:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUKl/1dptDXGaXIkO0lsECwNrbMIsPYC/IweYzXkAjKyBweY6Q8UGNmtnRQXCrBpLRsn6tYn7dnt+CXKdEBgYuZ4LV6an69N9DWVbfklA== X-Google-Smtp-Source: AGHT+IFBWV05epZMcnTxm9QHRy8PeTZFrZfrGpEomXyJeMAhVtYOp7BgLPo1Qio1mLNsz/wS2+eM X-Received: by 2002:a05:6e02:144f:b0:36b:1e1:552f with SMTP id e9e14a558f8ab-36cc14e0f94mr209736075ab.23.1715778280553; Wed, 15 May 2024 06:04:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715778280; cv=pass; d=google.com; s=arc-20160816; b=ZqDKNd5tPR3DCB76kktf2XY4q/cFQMRUHhk6zBvquMsRV4O333cKLUvoMDc6E41Vor LYogc/yv5BBkCNeV+jww5Y/G+CqGqE4Vt4ezrCRtiRZimAxSo8ALCGWJ7GOlJCRxaWUy XcJC7jx3Tnb4pBaY/SPv+BPeuZIMDz8xqMTw2r5pYWN9nuohlb6qtObtQeffUzQwArem dMrvjdv1z0t8b0+IbZ72Y0gfvPCIV0I6HNqJN/BiM+LW3jrp4GZx/tl7Ra20yOpBrLSk RibeHchQEnT587TnzMvl1ZUHXfdnx8muWmWOt82HmqknKlcDudj2UkZT7gORWOf/p6nr XaAw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=ukmz9/zkyZaW6AiPM2qsUMqAdqSkOsXVQ3brcJOi5FM=; fh=Y0juiP+6y+JXQz0tC2TEyxMwRFETitKl14mxdf1F/ws=; b=eOQ5I8+iNeEj/4+PFaPTFoL6/EQykx/c284ZrsP25Bd8IVcOwwRBoRGSCnr10qjlnc P7yCoxD/P3UktxO5qmCx8w8ulMiIk5wL7VlbuaHkxqb6E9xQ3Qn3sHMyFI4/ftSYTmSn 5EUjW+wrYG2M12GxxGqfan6XKJRIW+VU5rohrp4XJoR4MWo6HN7Qko56VqYxoYKh2NFK Y+2JnlQ7hqIXcxgLWb1Mha3ts3iFsIQp9ORLleNpGijHp14+jL5QS6kAr166ZLbjr2Dr EgQTfzYhRp3klPkLUR+Jo6e0aAQKvk4zuQsQXkxZYhdUEry5vgm/yBFDBL60t8PKSi3l ztow==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=WSAgRBnB; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-179877-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179877-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-64a10ade2edsi4493754a12.227.2024.05.15.06.04.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 06:04:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-179877-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=WSAgRBnB; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-179877-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179877-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 6A13CB21902 for ; Wed, 15 May 2024 13:04:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0894E8595B; Wed, 15 May 2024 13:04:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="WSAgRBnB" Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B8B6101C8; Wed, 15 May 2024 13:04:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715778266; cv=none; b=Q+Bj7MtzHcqkpw4F/7lQ0XS2vdSbe1ALXEqF8boyNqppttaUv4RKke9Dc+SOwSdJBoMr1VkXG51iEiF1mLhmkqiNhmfNHXnAy5GzULiaBn8METUstnDiWpJ4yzIegSYnnhqCpzbcwHpaLUjtf0gfIAAYUh1T2po/mE1PR7r19cU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715778266; c=relaxed/simple; bh=Om6cqCC78ki1iXt3GHwSrwlt5X2WL23hIYafmIbP5xk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=U4fnOvJRyeuH2ttfOSIWUGHcb/+mX7m/2nR2Lh84dT8+1U6vRiB3sQuZWawtql/wkmw8PelyUvsCOyctvY15RfQT3gJyTRKd8polkdEUlO73SQf110BRl06mSgaMStQSEH77QIJDdnXkWbuMLd6tmSrSi0N6miiUYxc7rVaXbmE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=WSAgRBnB; arc=none smtp.client-ip=148.163.158.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0353724.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 44FCxiQd023495; Wed, 15 May 2024 13:04:10 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=ukmz9/zkyZaW6AiPM2qsUMqAdqSkOsXVQ3brcJOi5FM=; b=WSAgRBnBW7Con8Hrsplh8PAjRRKOLM56i3bly0NvxypJP+d3x36uirEJ615A+uF7yTmU qQ29zG6kBx+ePL48kqJ3L8q5BVm04rx/rrY5CBvARObON4RAgl0cD6D9ant95S1/vYLU UX9fiWWkC/4+32/Y3uamcuN+TRUdYJ1RPAyShgN+hU8MM0Sul9edx+ez8gOEmwO0Jk9A UjKVEnW72Orx8cF3ulLlZU4B3X8IIcCQesjQMWFu01Fkw7B6nPQ2C6/t9HoaxBONa13p IsM9jOVnmhF2QVz3UkwweyfGpsafF5CpKw8EkqR1rfr6UjmZpSbLm87wyXiqbtBiZCP1 Rg== Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3y4vn705dm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 May 2024 13:04:09 +0000 Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 44FCMK8s005986; Wed, 15 May 2024 13:04:09 GMT Received: from smtprelay03.dal12v.mail.ibm.com ([172.16.1.5]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3y2mgmkmpe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 May 2024 13:04:09 +0000 Received: from smtpav03.wdc07v.mail.ibm.com (smtpav03.wdc07v.mail.ibm.com [10.39.53.230]) by smtprelay03.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 44FD45FV15663622 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 May 2024 13:04:07 GMT Received: from smtpav03.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6FFCB5805C; Wed, 15 May 2024 13:04:05 +0000 (GMT) Received: from smtpav03.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2B1D85806D; Wed, 15 May 2024 13:04:04 +0000 (GMT) Received: from [9.67.88.41] (unknown [9.67.88.41]) by smtpav03.wdc07v.mail.ibm.com (Postfix) with ESMTP; Wed, 15 May 2024 13:04:04 +0000 (GMT) Message-ID: Date: Wed, 15 May 2024 08:04:03 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/3] crypto: X25519 low-level primitives for ppc64le. To: Andy Polyakov , linux-crypto@vger.kernel.org Cc: herbert@gondor.apana.org.au, leitao@debian.org, nayna@linux.ibm.com, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, mpe@ellerman.id.au, ltcgcw@linux.vnet.ibm.com, dtsen@us.ibm.com References: <20240514173835.4814-1-dtsen@linux.ibm.com> <20240514173835.4814-2-dtsen@linux.ibm.com> Content-Language: en-US From: Danny Tsen In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: JFmpnHQoMDSLCzgcPJgxv6_JHlWo-5Br X-Proofpoint-ORIG-GUID: JFmpnHQoMDSLCzgcPJgxv6_JHlWo-5Br X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-05-15_06,2024-05-15_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 adultscore=0 phishscore=0 malwarescore=0 mlxscore=0 mlxlogscore=999 suspectscore=0 bulkscore=0 impostorscore=0 priorityscore=1501 spamscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2405150091 See inline. On 5/15/24 4:06 AM, Andy Polyakov wrote: > Hi, > >> +SYM_FUNC_START(x25519_fe51_sqr_times) >> ... >> + >> +.Lsqr_times_loop: >> ... >> + >> +    std    9,16(3) >> +    std    10,24(3) >> +    std    11,32(3) >> +    std    7,0(3) >> +    std    8,8(3) >> +    bdnz    .Lsqr_times_loop > > I see no reason for why the stores can't be moved outside the loop in > question. > Yeah.  I'll fix it. >> +SYM_FUNC_START(x25519_fe51_frombytes) >> +.align    5 >> + >> +    li    12, -1 >> +    srdi    12, 12, 13    # 0x7ffffffffffff >> + >> +    ld    5, 0(4) >> +    ld    6, 8(4) >> +    ld    7, 16(4) >> +    ld    8, 24(4) > > Is there actual guarantee that the byte input is 64-bit aligned? While > it is true that processor is obliged to handle misaligned loads and > stores by the ISA specification, them being inefficient doesn't go > against it. Most notably inefficiency is likely to be noted at the > page boundaries. What I'm trying to say is that it would be more > appropriate to avoid the unaligned loads (and stores). Good point.  Maybe I can handle it with 64-bit aligned for the input. Thanks. > > Cheers. >