mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
AMD/IOMMU: Don't opencode memcpy() in queue_iommu_command()
In practice, this allows the compiler to replace the loop with a pair of movs. No functional change. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Reviewed-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Brian Woods <brian.woods@amd.com> Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
This commit is contained in:
1 parent
d36b770458
commit
3ccfe3ca9a
2 files changed
+4
-9
No files matched your search
@@ -24,8 +24,7 @@
|
||||
|
||||
static int queue_iommu_command(struct amd_iommu *iommu, u32 cmd[])
|
||||
{
|
||||
u32 tail, head, *cmd_buffer;
|
||||
int i;
|
||||
uint32_t tail, head;
|
||||
|
||||
tail = iommu->cmd_buffer.tail;
|
||||
if ( ++tail == iommu->cmd_buffer.entries )
|
||||
@@ -35,12 +34,9 @@ static int queue_iommu_command(struct amd_iommu *iommu, u32 cmd[])
|
||||
IOMMU_CMD_BUFFER_HEAD_OFFSET));
|
||||
if ( head != tail )
|
||||
{
|
||||
cmd_buffer = (u32 *)(iommu->cmd_buffer.buffer +
|
||||
(iommu->cmd_buffer.tail *
|
||||
IOMMU_CMD_BUFFER_ENTRY_SIZE));
|
||||
|
||||
for ( i = 0; i < IOMMU_CMD_BUFFER_U32_PER_ENTRY; i++ )
|
||||
cmd_buffer[i] = cmd[i];
|
||||
memcpy(iommu->cmd_buffer.buffer +
|
||||
(iommu->cmd_buffer.tail * IOMMU_CMD_BUFFER_ENTRY_SIZE),
|
||||
cmd, IOMMU_CMD_BUFFER_ENTRY_SIZE);
|
||||
|
||||
iommu->cmd_buffer.tail = tail;
|
||||
return 1;
|
||||
|
||||
@@ -187,7 +187,6 @@
|
||||
|
||||
#define IOMMU_CMD_BUFFER_ENTRY_SIZE 16
|
||||
#define IOMMU_CMD_BUFFER_POWER_OF2_ENTRIES_PER_PAGE 8
|
||||
#define IOMMU_CMD_BUFFER_U32_PER_ENTRY (IOMMU_CMD_BUFFER_ENTRY_SIZE / 4)
|
||||
|
||||
#define IOMMU_CMD_OPCODE_MASK 0xF0000000
|
||||
#define IOMMU_CMD_OPCODE_SHIFT 28
|
||||
|
||||