Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1443876pxa; Sun, 2 Aug 2020 07:54:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxpgvFHMudJIQ20bpqWpYdbEykuTA3sXN9S3RKtdQ6RI3WR9pwBuIREkKk4U9Gt5OEMnIR X-Received: by 2002:a17:906:1254:: with SMTP id u20mr13464750eja.540.1596380088199; Sun, 02 Aug 2020 07:54:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596380088; cv=none; d=google.com; s=arc-20160816; b=d8vWCBC/wEBFl1JkNUXCFFkXl93eL7FlbWBWHcZD+Zcqy/Wda4mpdSoDLXz5WLdv91 GgV4MwDNbsi48L8fd4utC/Cdr8jWAqGMt080V+hjfoET0o3FNqgfXWc31qCab7mT4fUy FWupQqcuSjvvCNPfacopMofUAAPZLaue+hqyfoeAmKCg1Jb3uSYgnIsm7em6zUAhAueN u0DxFWwu3md5aUAsHa0JKlmWbHcVfx0K/hg1e6JEsa5AJWMCQ8QoSH17OIAcs5hAHoP9 hUZR4xi9Ew0HrchDhaKoJGDgDOWGo8E6WJbf8ys9mspUaWEQQ6SBCdeDWICwM46cA3r5 sEdg== 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=Zy6x05gzZAs8OoiSX0zyTBz6GV0RJ4XPXSJLcDjJAcM=; b=o8XRCT6nLIFHM5sRo3U0R0QNKfYaGdOeHh+84+eRX0UHNxfI87iblpxPBVenrMX747 yYaWYGrmklqzKMDcRiVyuvvhvrf+BBF7QO3mhC52ST+rTWj0dJFlvhMrcmVPMUsgOM3E kgaqlUlwNymqbXzMIFebu2BqqUOALSKX80Q8PK9rfVug3XexU5RSBx18MJjeMHU/H0zq du+3ZPz0pfnwCAg1Q8JnAXzBB9YFeJLKxQCgHy0z48It4cud7pUsoTJqI4Wx/j/xcahV +YwhLaOSs12lbnLqhfttHMoGiQ0gPZAk17aVQdgkxsVSZhOPLmFZzBBgaQAOtiFUNDq6 SbZw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-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 f21si1460254edx.292.2020.08.02.07.54.22; Sun, 02 Aug 2020 07:54:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725952AbgHBOxA (ORCPT + 99 others); Sun, 2 Aug 2020 10:53:00 -0400 Received: from zg8tmja5ljk3lje4mi4ymjia.icoremail.net ([209.97.182.222]:39368 "HELO zg8tmja5ljk3lje4mi4ymjia.icoremail.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1725861AbgHBOxA (ORCPT ); Sun, 2 Aug 2020 10:53:00 -0400 Received: from [101.5.209.60] (unknown [101.5.209.60]) by app-3 (Coremail) with SMTP id EQQGZQA3PiJB0yZfgSzdAw--.56560S2; Sun, 02 Aug 2020 22:52:51 +0800 (CST) From: Jia-Ju Bai Subject: [BUG] crypto: hisilicon: accessing the data mapped to streaming DMA To: wangzhou1@hisilicon.com, herbert@gondor.apana.org.au, davem@davemloft.net Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Message-ID: <361fa200-479c-e1ef-b7d6-e666a256660f@tsinghua.edu.cn> Date: Sun, 2 Aug 2020 22:52:48 +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: EQQGZQA3PiJB0yZfgSzdAw--.56560S2 X-Coremail-Antispam: 1UD129KBjvdXoW7Xw18Gw1rKr1Duw1xWF47XFb_yoWxZrX_A3 y3Gw1rGFWq9an7twn7Ja15A3yaqFZrtr4qyr9ayFW8Zw17Aa1kGwn5Za18tw1Fy3Z0yFn5 tw13u393WF1FvjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbIkYjsxI4VWDJwAYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I 6I8E6xAIw20EY4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM2 8CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW8JVW5JwA2z4x0Y4vE2Ix0 cI8IcVCY1x0267AKxVWxJVW8Jr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4 A2jsIEc7CjxVAFwI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IE w4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMc vjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvEwIxGrwCYjI0SjxkI62AI1cAE67vIY487MxkI ecxEwVAFwVW5XwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c 02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_ Jw1lIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7 CjxVAFwI0_Jr0_Gr1lIxAIcVCF04k26cxKx2IYs7xG6rWUJVWrZr1UMIIF0xvEx4A2jsIE 14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf 9x07jorWrUUUUU= X-CM-SenderInfo: xedlyxhdmxq3pvlqwxlxdovvfxof0/ Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org In qm_qp_ctx_cfg(), "sqc" and "aeqc" are mapped to streaming DMA:   eqc_dma = dma_map_single(..., eqc, ...);   ......   aeqc_dma = dma_map_single(..., aeqc, ...); Then "sqc" and "aeqc" are accessed at many places, such as:   eqc->base_l = cpu_to_le32(lower_32_bits(qm->eqe_dma));   eqc->base_h = cpu_to_le32(upper_32_bits(qm->eqe_dma));   ......   aeqc->base_l = cpu_to_le32(lower_32_bits(qm->aeqe_dma));   aeqc->base_h = cpu_to_le32(upper_32_bits(qm->aeqe_dma)); 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