Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1437442pxa; Sun, 2 Aug 2020 07:39:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWhzGubFS6tifyP3JbhpPylK/TufJd4IujinQHb9S7Y1YVvZmQ3CwZ0CLmDmOF0kmQn7RC X-Received: by 2002:a17:906:e118:: with SMTP id gj24mr12512235ejb.219.1596379146721; Sun, 02 Aug 2020 07:39:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596379146; cv=none; d=google.com; s=arc-20160816; b=FqtXC3N7jc3koC0CeLGL/U5OHc+plVBgNiTlrv2I2vLp44BM+rvOv3qn/GYV71w36p Lgg0z62jWOd98DZkiS6S54jd23mxfxiS5XHoWN31/pIUsraw5YLoXKaNmTmhiavigZpz Dyy15/FkkAjEhAYSTvZZbP+S8REtzfWFrU4C+Dte04nMrSQmsRkTK7eVafAKufQOAz3O FwK8KJZQqlR6KTYCsFQ6a4iPt99mcaJChSbbpzkf3PgPc/pyBBbBP2/XpRP7KEVdQ4V0 /zA49gM5aEkmGA3kVw3LClWLJ5WeS+X3ajSAR400dfxYat9IJs7FJfsWWqD7LdONU2V6 ueWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:mime-version:user-agent:date:message-id :cc:to:subject:from; bh=5eTyd6lcyA1+nvV2tCySWx2O+v0hD6T22zk+jFhYPIo=; b=CaszbvpQ4YUfEbRnYq5eGapnWajgAz7rhS15sO67/8KbLduo7f74+WHlUMTRhcfEtQ SliWmEfXDnq/+2cYjSgkKybEidH4ogPV08NRYo/npoH/plv49Vpk3dk1rqkKZFU6E7xa t9qvVFMJ63HzzA0Z+JwRxmSj5S+pETohKmmfpjTGz9SwsLXFMNgnF7JncfSWwxuPFJCc JqD26i2g/gd0weKl0Nu90b/FqxB0APKE3ezB9Wtdp8MQicq1YVfyKPFYZ7W0j/qQtYLW qZKQepXwzcdcTBLKKKQQIURtQOOhf/0C7PN0iNOE82qYgMbQ6WCEHMouzArKBteKKekB IqXw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pg3si9385135ejb.284.2020.08.02.07.38.44; Sun, 02 Aug 2020 07:39:06 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726222AbgHBOhX (ORCPT + 99 others); Sun, 2 Aug 2020 10:37:23 -0400 Received: from zg8tmtm5lju5ljm3lje2naaa.icoremail.net ([139.59.37.164]:44496 "HELO zg8tmtm5lju5ljm3lje2naaa.icoremail.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1725778AbgHBOhW (ORCPT ); Sun, 2 Aug 2020 10:37:22 -0400 Received: from [101.5.209.60] (unknown [101.5.209.60]) by app-1 (Coremail) with SMTP id DwQGZQDHzalQzyZf+jXrAw--.8461S2; Sun, 02 Aug 2020 22:36:02 +0800 (CST) From: Jia-Ju Bai Subject: [BUG] crypto: qat: accessing the data mapped to streaming DMA To: giovanni.cabiddu@intel.com, herbert@gondor.apana.org.au, davem@davemloft.net, ardb@kernel.org, horia.geanta@nxp.com, geert+renesas@glider.be, ebiggers@google.com Cc: qat-linux@intel.com, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Message-ID: <7bda4db1-cca2-f6f1-4b70-52d2d25f8d2d@tsinghua.edu.cn> Date: Sun, 2 Aug 2020 22:35:59 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-CM-TRANSID: DwQGZQDHzalQzyZf+jXrAw--.8461S2 X-Coremail-Antispam: 1UD129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73 VFW2AGmfu7bjvjm3AaLaJ3UjIYCTnIWjp_UUUYH7k0a2IF6FyUM7kC6x804xWl14x267AK xVW8JVW5JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3wAFIxvE14AKwVWUJVWUGw A2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26ryj 6F1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26F4j6r4UJwA2z4x0Y4vEx4A2jsIE14v26r xl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oVCq3wAS0I0E0xvYzxvE52x082IY62kv 0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUGVWUXwAv7VC2z2 80aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcVAKI48JM4IIrI8v6xkF 7I0E8cxan2IY04v7Mxk0xIA0c2IEe2xFo4CEbIxvr21lc2xSY4AK67AK6ry5MxAIw28Icx kI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2Iq xVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUtVW8ZwCIc40Y0x0EwIxGrwCI42 IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY 6xAIw20EY4v20xvaj40_Wr1j6rW3Jr1lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z2 80aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU8zBTUUUUUU== X-CM-SenderInfo: xedlyxhdmxq3pvlqwxlxdovvfxof0/ Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In qat_alg_sgl_to_bufl(), "bufl" and "buflout" are mapped to streaming DMA:   blp = dma_map_single(dev, bufl, sz, DMA_TO_DEVICE);   bloutp = dma_map_single(dev, buflout, sz_out, DMA_TO_DEVICE); Then "bufl" and "buflout" are accessed at some places, such as:   bufl->bufers[y].len = sg->length;   bufl->num_bufs = sg_nctr;   bufers = buflout->bufers;   buflout->num_bufs = sg_nctr; These accesses may cause data inconsistency between CPU cache and hardware. I am not sure how to properly fix this problem, and thus I only report it. Best wishes, Jia-Ju Bai