Linux-Crypto Archive on lore.kernel.org
 help / color / Atom feed
From: Jia-Ju Bai <baijiaju@tsinghua.edu.cn>
To: wangzhou1@hisilicon.com, herbert@gondor.apana.org.au,
	davem@davemloft.net
Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [BUG] crypto: hisilicon: accessing the data mapped to streaming DMA
Date: Sun, 2 Aug 2020 22:52:48 +0800
Message-ID: <361fa200-479c-e1ef-b7d6-e666a256660f@tsinghua.edu.cn> (raw)

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


             reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-02 14:52 Jia-Ju Bai [this message]
2020-08-03  1:12 ` Zhou Wang
2020-08-03  1:29   ` Jia-Ju Bai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=361fa200-479c-e1ef-b7d6-e666a256660f@tsinghua.edu.cn \
    --to=baijiaju@tsinghua.edu.cn \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wangzhou1@hisilicon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-Crypto Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-crypto/0 linux-crypto/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-crypto linux-crypto/ https://lore.kernel.org/linux-crypto \
		linux-crypto@vger.kernel.org
	public-inbox-index linux-crypto

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-crypto


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git