Keith Busch b69e2ef24b nvme-pci: dma read memory barrier for completions
Control dependencies do not guarantee load order across the condition,
allowing a CPU to predict and speculate memory reads.

Commit 324b494c2862 inlined verifying a new completion with its
handling. At least one architecture was observed to access the contents
out of order, resulting in the driver using stale data for the
completion.

Add a dma read barrier before reading the completion queue entry and
after the condition its contents depend on to ensure the read order is
determinsitic.

Reported-by: John Garry <john.garry@huawei.com>
Suggested-by: Will Deacon <will@kernel.org>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Tested-by: John Garry <john.garry@huawei.com>
Acked-by: Will Deacon <will@kernel.org>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2020-05-12 18:02:24 +02:00
..
2020-04-10 09:52:15 -07:00
2020-03-23 07:59:38 +01:00
2020-04-03 15:05:35 -07:00
2020-04-10 11:32:22 +02:00
2020-04-11 09:46:12 -07:00
2020-04-14 11:58:04 -07:00
2020-04-04 18:07:59 -07:00
2020-04-08 21:25:49 -07:00
2020-04-01 18:18:18 -07:00
2020-03-20 13:45:25 +01:00
2020-04-16 13:52:31 -07:00
2020-03-30 11:43:51 -07:00
2020-03-19 23:04:32 -05:00
2020-04-08 21:03:40 -07:00
2020-04-03 15:05:35 -07:00
2020-04-08 10:51:53 -07:00
2020-03-31 16:13:09 -07:00
2020-04-03 14:25:02 -07:00
2020-04-08 21:03:40 -07:00
2020-04-08 11:00:00 -07:00
2020-03-31 10:05:01 -07:00
2020-04-03 14:25:02 -07:00
2020-03-30 14:58:26 -07:00
2020-04-07 19:48:52 -07:00
2020-04-10 12:21:11 -07:00
2020-04-02 15:50:04 -07:00
2020-04-10 15:36:21 -07:00
2020-04-10 12:21:11 -07:00
2020-04-03 15:05:35 -07:00
2020-03-23 08:04:08 +01:00
2020-04-05 11:12:59 -07:00
2020-04-02 17:03:53 -07:00
2020-04-02 10:41:40 -04:00
2020-04-02 10:41:40 -04:00
2020-04-07 20:24:34 -07:00
2020-03-19 07:41:03 +01:00
2020-04-08 10:51:53 -07:00
2020-04-17 10:35:17 -07:00
2020-04-03 13:12:26 -07:00
2020-04-08 10:51:53 -07:00
2020-04-08 10:51:53 -07:00