Re: [PATCH] iommu/amd: fix the left value check of cmd buffer

2017-01-04 Thread Joerg Roedel
On Mon, Dec 12, 2016 at 07:28:26AM -0500, Huang Rui wrote: > 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

[PATCH] iommu/amd: fix the left value check of cmd buffer

2016-12-12 Thread Huang Rui
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