https://github.com/torvalds/linux
Revision 432abf68a79332282329286d190e21fe3ac02a31 authored by Huang Rui on 12 December 2016, 12:28:26 UTC, committed by Joerg Roedel on 04 January 2017, 14:22:22 UTC
The generic command buffer entry is 128 bits (16 bytes), so the offset
of tail and head pointer should be 16 bytes aligned and increased with
0x10 per command.

When cmd buf is full, head = (tail + 0x10) % CMD_BUFFER_SIZE.

So when left space of cmd buf should be able to store only two
command, we should be issued one COMPLETE_WAIT additionally to wait
all older commands completed. Then the left space should be increased
after IOMMU fetching from cmd buf.

So left check value should be left <= 0x20 (two commands).

Signed-off-by: Huang Rui <ray.huang@amd.com>
Fixes: ac0ea6e92b222 ('x86/amd-iommu: Improve handling of full command buffer')
Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent 65ca7f5
History
Tip revision: 432abf68a79332282329286d190e21fe3ac02a31 authored by Huang Rui on 12 December 2016, 12:28:26 UTC
iommu/amd: Fix the left value check of cmd buffer
Tip revision: 432abf6
File Mode Size
kvm
lib
Makefile -rw-r--r-- 14 bytes

back to top