Received: by 2002:ac0:de83:0:0:0:0:0 with SMTP id b3csp1338266imk; Mon, 4 Jul 2022 00:36:13 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uQ51JDEa7DizVA2+4aJxwnkEQ7yJkxeH1fyeaXyyuBxrbeyka2mvClkBj6PW356vgsL6pW X-Received: by 2002:a63:1b22:0:b0:411:9b47:f6bf with SMTP id b34-20020a631b22000000b004119b47f6bfmr20438034pgb.200.1656920172828; Mon, 04 Jul 2022 00:36:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656920172; cv=none; d=google.com; s=arc-20160816; b=viYXRs3WIzQN0N8o49lW8TAThvNema9sdFjxzT4ZuzbgMO9t8pkqI+6gHuQzbM9rgn J21F89yokLwIHdIpPYFiMfr7XrA53hiEb6++rferxcvWXXq86bN6a0vvmrcNShEaL+I/ ywRlPdpaW/Oi6WEfbgal/s6NzM6bpnC6KJ1aaItkI/xA1B/CIIxfeGf/p0018Y1idLnJ D/A2w/DUkwUXBlXgdpEVFerxoS84I9v+9SO58wzNRhLHPPna92kfmRrLo/Cu5rkUU4j6 OomEjiMucBef0MRzST5DLzGvHW4GMZNOr1cLrEDMSXpGaybsef+IT9Zvj87+y2/CEowd 92Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:message-id:to:from:subject:references :in-reply-to:content-transfer-encoding:mime-version:dkim-signature; bh=d6bAWikDbh10qopqIRcnLnj5ZIdIbkJFyspP5VUzVJA=; b=A71IMY1bVP680mHVkUidJt0fmH822Gua+cl3td6VuEdR8N2Mp8SblMIsqaIkQo0URN IL6r+lJBs/qdfq0JPfnNfqGwC1vwYqFc26gl83RWBt9IxAtr/bGj6ivz8T6SfSitkoSH 9MOnh0gyDUeTH8Pn4Bjbu7QA/vAfZwU2U4g7xKZ+6zUnGZh8RqjOBpHzfkiPtpArU8zG /eOguCS2EX6j70uj+GIDj5GV6yZyPCFHKXvlvhC3fQbA3V5hE4u9LNFRSKhOr6f/NUd9 sk/lU0d9JPU3nSBZmZDky3osFV+hNam28OTNykatyTrPI2a7FEmGDprqhWWZ2NHMzGok 8N8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kAksR6Rd; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cd9-20020a056a00420900b005280e22a90csi16320479pfb.46.2022.07.04.00.35.20; Mon, 04 Jul 2022 00:36:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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=@kernel.org header.s=k20201202 header.b=kAksR6Rd; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230003AbiGDH0h (ORCPT + 99 others); Mon, 4 Jul 2022 03:26:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233196AbiGDH0f (ORCPT ); Mon, 4 Jul 2022 03:26:35 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 362366574 for ; Mon, 4 Jul 2022 00:26:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id DEB3CB80D26 for ; Mon, 4 Jul 2022 07:26:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 133F3C3411E; Mon, 4 Jul 2022 07:26:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656919592; bh=c51pFXpuGQWYCtD4EDctZd4NRjVurEPLoayHs9RAZMs=; h=In-Reply-To:References:Subject:From:To:Date:From; b=kAksR6RdVrT8z3FDFPcbSJTAAVq5ZU+rNFU5KeUElJK0tyFIbVLHI7ZUu2F1q+03a dEVz6LkfDZLKX5lJoinjuFahuoT8NYVJOSuJoAgPTeUppvt8nKKgxIW1SSJKbjFjKw Gu7FjA4nLUN0cPZnmOegw2YUtCC5JlN02wFaItcXkgxHupfVZIZy48zoGrTUsyteYS LMsa48EyNCRKqcLJKNaF8oPtY3kCgyagrO5FfW1sudGo+nDeAQGfuZJOIkPJlLiR1M Gqv9lUueLvBYNfL/evoea+fuUrUq7Hy+ZsIQX3976sSaEkSTk0/nm2yl+1O/TU720e YWCEEWch/pLfw== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20220702071426.1915429-1-oferh@marvell.com> References: <20220702071426.1915429-1-oferh@marvell.com> Subject: Re: [PATCH] crypto: inside-secure: fix packed bit-field result descriptor From: Antoine Tenart To: davem@davemloft.net, herbert@gondor.apana.org.au, linux-crypto@vger.kernel.org, oferh@marvell.com Message-ID: <165691958960.3764.6967842126015044710@kwain> Date: Mon, 04 Jul 2022 09:26:29 +0200 X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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-crypto@vger.kernel.org Hi Ofer, Quoting oferh@marvell.com (2022-07-02 09:14:26) > From: Ofer Heifetz >=20 > When mixing bit-field and none bit-filed in packed struct the > none bit-field starts at a distinct memory location, thus adding > an additional byte to the overall structure which is used in > memory zero-ing and other configuration calculations. >=20 > Fix this by removing the none bit-field that has a following > bit-field. >=20 > Signed-off-by: Ofer Heifetz Nice catch! Note: since those fields were not used before and IIRC the below result struct size is set dynamically (the h/w doesn't expect a fixed size) this doesn't need to be backported to stable trees. Can't test it on real h/w though. Acked-by: Antoine Tenart Thanks! > --- > drivers/crypto/inside-secure/safexcel.h | 18 +++++++++--------- > 1 file changed, 9 insertions(+), 9 deletions(-) >=20 > diff --git a/drivers/crypto/inside-secure/safexcel.h b/drivers/crypto/ins= ide-secure/safexcel.h > index ce1e611a163e..797ff91512e0 100644 > --- a/drivers/crypto/inside-secure/safexcel.h > +++ b/drivers/crypto/inside-secure/safexcel.h > @@ -497,15 +497,15 @@ struct result_data_desc { > u32 packet_length:17; > u32 error_code:15; > =20 > - u8 bypass_length:4; > - u8 e15:1; > - u16 rsvd0; > - u8 hash_bytes:1; > - u8 hash_length:6; > - u8 generic_bytes:1; > - u8 checksum:1; > - u8 next_header:1; > - u8 length:1; > + u32 bypass_length:4; > + u32 e15:1; > + u32 rsvd0:16; > + u32 hash_bytes:1; > + u32 hash_length:6; > + u32 generic_bytes:1; > + u32 checksum:1; > + u32 next_header:1; > + u32 length:1; > =20 > u16 application_id; > u16 rsvd1; > --=20 > 2.25.1 >=20