Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp761432yba; Wed, 15 May 2019 09:28:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqz3s5v6/0qsaz2LO+X0Irqb54zpuR+ln5mJsPLsPiUP714MCh8VwgiCqw/P6a36UH4TuYFF X-Received: by 2002:a63:5d3:: with SMTP id 202mr43597546pgf.363.1557937716126; Wed, 15 May 2019 09:28:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557937716; cv=none; d=google.com; s=arc-20160816; b=nAfriPLPDHHwkl+y+iJ8lJ7S1ZQXOH5wzmiKMZAB4sDOrNHrS2oLViTPJxAbv2QO2f 9XsSv+kjjs1yEORlVngMAavHxAGesSzCIzBeAcRUVFXWlVkg/+rnyjiQ9vY+zvOBxq4S wf9XrUTkhZgEUJPpIqOrYLYdHCwYynk1T9tAhEQmWv3BlY7sjSGVzOkoNilHP6ZRXNLa 3A/Z7Fybt2j3IQZvaxmIZUWHwjfsXxkqeGocEcARIxdsaFzWE4RIWtbYxnhI3msfJ50/ VB4lfnP+pKdUyKs8EZoTHo4e6SPrQBdBidFVb+MZmVNRRpp35LL/P/0rheKWez/ez/py q4Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:references:message-id:date :thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=0zeCezhQ20Z5djXH4tg1Wv37DCdZJ12HszYLL/qEGwg=; b=PFbJNN3jn4gAw6QZorhoL1A6iZRhrhNqSUyAue3rR4xgTPd+7S17wpRkAwA7J0f1NZ ZsBQ8HgC57xSO9t4rYr4HDhWqaFDyICyAUGDF6IZe5dxSlKjgHynnHxfRU4G5yW3xKA3 ZS2sZb8bj9/MWYxtXuQuuiRJtiV2OlDi0dOYwcXhHvABSqCbcJ6u+sROzc28xuwR9G3N TBxOHqsh/C3e4HsSz3crsTEehlP4b0cCghNC9dHJf1QHP+CagIkOFJEoz4DFIm3tVnUZ SbqlrefeBODJFlFM47/O3ONFFyf0ZmOYRktlH4guokudvZIS4/PYtka+qZPSW1qYQ6RB 9LIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=Xlj5mc+1; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h5si794734plt.232.2019.05.15.09.28.18; Wed, 15 May 2019 09:28:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=Xlj5mc+1; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726713AbfEOQ1z (ORCPT + 99 others); Wed, 15 May 2019 12:27:55 -0400 Received: from mail-eopbgr130087.outbound.protection.outlook.com ([40.107.13.87]:17560 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726283AbfEOQ1z (ORCPT ); Wed, 15 May 2019 12:27:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0zeCezhQ20Z5djXH4tg1Wv37DCdZJ12HszYLL/qEGwg=; b=Xlj5mc+1zbq04O9n0yUDk9YdQl0GSTCMcsBfQRwvBuwtD6kuW/mdI5ySIMFKbY9kfoW8bNSjsWtvn+4Dz2K5wegGWs5YmT/ej8Cqq8fil3bhHn3CDZfBnL0Y8ThjPZQfJ3RjaC/eehoRryryu3loaarUGHQDV6UowzN1K/M3ygU= Received: from VI1PR0402MB3485.eurprd04.prod.outlook.com (52.134.3.153) by VI1PR0402MB3663.eurprd04.prod.outlook.com (52.134.14.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1900.16; Wed, 15 May 2019 16:27:51 +0000 Received: from VI1PR0402MB3485.eurprd04.prod.outlook.com ([fe80::dd3c:969d:89b9:f422]) by VI1PR0402MB3485.eurprd04.prod.outlook.com ([fe80::dd3c:969d:89b9:f422%4]) with mapi id 15.20.1878.024; Wed, 15 May 2019 16:27:51 +0000 From: Horia Geanta To: Sascha Hauer , "linux-crypto@vger.kernel.org" CC: "kernel@pengutronix.de" Subject: Re: [PATCH] crypto: caam: print debugging hex dumps after unmapping Thread-Topic: [PATCH] crypto: caam: print debugging hex dumps after unmapping Thread-Index: AQHVCx/9F6U6+SkDhEGkmCdE7Szycw== Date: Wed, 15 May 2019 16:27:51 +0000 Message-ID: References: <20190515131324.22793-1-s.hauer@pengutronix.de> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=horia.geanta@nxp.com; x-originating-ip: [212.146.100.6] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6c591acd-ea2d-4e2c-99fd-08d6d95246a6 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020);SRVR:VI1PR0402MB3663; x-ms-traffictypediagnostic: VI1PR0402MB3663: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 0038DE95A2 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(346002)(136003)(39860400002)(396003)(376002)(366004)(189003)(199004)(53936002)(6436002)(2906002)(110136005)(14454004)(99286004)(316002)(2501003)(9686003)(229853002)(74316002)(4744005)(478600001)(86362001)(33656002)(5660300002)(6246003)(55016002)(8936002)(446003)(305945005)(81156014)(8676002)(81166006)(66066001)(73956011)(476003)(52536014)(66446008)(64756008)(66556008)(76116006)(7736002)(66476007)(68736007)(66946007)(186003)(486006)(76176011)(26005)(7696005)(71190400001)(71200400001)(6116002)(44832011)(3846002)(102836004)(256004)(14444005)(6506007)(4326008)(53546011)(25786009);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0402MB3663;H:VI1PR0402MB3485.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: fuwvySUCksyRKct788S5NYD/F7LJym6BGms/9WjdAjGQr5FAhDrY/AmJ3FYzHHANFOR/2Hp4AA1Q5jiIbS40vwFQjo87cXx10H+OcN0eygw4wLdpx5YNPY6XhNxIwefDGsfOH3T9jhjr3/DT0oV8+qD8IkE0/Fzm5nOh62CR7tb0mJVAowPmQNUyeczorylQxSX2oKOr6OvQqcrxd9ZBMgmt8zdMJN73+fdEp6grFa0BQToFWm02qLTf0WAKOqwFiim65LU0Tyqc98x+cPkU/jaqutIojDRhckW8RNr0dWNpu9YP4bpNkpLzCjxIwR9qAfV3t9srgvvBrlpVCG/OZN4r1w8j4ak7ZG5kdAQT0eJ1RYO4cON51qLo3K/w6i80xlLOOWvgtD4wipADsKdSLprCV9EXfLfvUDBWRHkbMM0= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6c591acd-ea2d-4e2c-99fd-08d6d95246a6 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 May 2019 16:27:51.4412 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB3663 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 5/15/2019 4:13 PM, Sascha Hauer wrote:=0A= > The debugging hex dumps in skcipher_encrypt_done() and=0A= > skcipher_decrypt_done() are printed while the request is still DMA=0A= > mapped. This results in bogus hex dumps with things like mixtures=0A= > between plain text and cipher text. Unmap first before printing.=0A= > =0A= The description is not accurate.=0A= req->iv is no longer DMA mapped since commit 115957bb3e59 ("crypto: caam - = fix=0A= IV DMA mapping and updating"), so this is not related to IV DMA unmapping v= s.=0A= print order.=0A= =0A= Currently:=0A= -for encryption, printed req->iv contains the input IV; copy of output IV i= nto=0A= req->iv is done further below=0A= -for decryption, printed req->iv should be correct, since output IV is copi= ed=0A= into req->iv in skcipher_decrypt(), before accelerator runs=0A= =0A= Could you please resubmit with updated message?=0A= =0A= Thanks,=0A= Horia=0A=