mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 01:33:56 -06:00
dma: Let dma_memory_read/write() take MemTxAttrs argument
Let devices specify transaction attributes when calling dma_memory_read() or dma_memory_write(). Patch created mechanically using spatch with this script: @@ expression E1, E2, E3, E4; @@ ( - dma_memory_read(E1, E2, E3, E4) + dma_memory_read(E1, E2, E3, E4, MEMTXATTRS_UNSPECIFIED) | - dma_memory_write(E1, E2, E3, E4) + dma_memory_write(E1, E2, E3, E4, MEMTXATTRS_UNSPECIFIED) ) Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Li Qiang <liq3ea@gmail.com> Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20211223115554.3155328-6-philmd@redhat.com>
This commit is contained in:
parent
23faf5694f
commit
ba06fe8add
30 changed files with 241 additions and 150 deletions
|
@ -181,7 +181,7 @@ static void amdvi_log_event(AMDVIState *s, uint64_t *evt)
|
|||
}
|
||||
|
||||
if (dma_memory_write(&address_space_memory, s->evtlog + s->evtlog_tail,
|
||||
evt, AMDVI_EVENT_LEN)) {
|
||||
evt, AMDVI_EVENT_LEN, MEMTXATTRS_UNSPECIFIED)) {
|
||||
trace_amdvi_evntlog_fail(s->evtlog, s->evtlog_tail);
|
||||
}
|
||||
|
||||
|
@ -376,7 +376,8 @@ static void amdvi_completion_wait(AMDVIState *s, uint64_t *cmd)
|
|||
}
|
||||
if (extract64(cmd[0], 0, 1)) {
|
||||
if (dma_memory_write(&address_space_memory, addr, &data,
|
||||
AMDVI_COMPLETION_DATA_SIZE)) {
|
||||
AMDVI_COMPLETION_DATA_SIZE,
|
||||
MEMTXATTRS_UNSPECIFIED)) {
|
||||
trace_amdvi_completion_wait_fail(addr);
|
||||
}
|
||||
}
|
||||
|
@ -502,7 +503,7 @@ static void amdvi_cmdbuf_exec(AMDVIState *s)
|
|||
uint64_t cmd[2];
|
||||
|
||||
if (dma_memory_read(&address_space_memory, s->cmdbuf + s->cmdbuf_head,
|
||||
cmd, AMDVI_COMMAND_SIZE)) {
|
||||
cmd, AMDVI_COMMAND_SIZE, MEMTXATTRS_UNSPECIFIED)) {
|
||||
trace_amdvi_command_read_fail(s->cmdbuf, s->cmdbuf_head);
|
||||
amdvi_log_command_error(s, s->cmdbuf + s->cmdbuf_head);
|
||||
return;
|
||||
|
@ -836,7 +837,7 @@ static bool amdvi_get_dte(AMDVIState *s, int devid, uint64_t *entry)
|
|||
uint32_t offset = devid * AMDVI_DEVTAB_ENTRY_SIZE;
|
||||
|
||||
if (dma_memory_read(&address_space_memory, s->devtab + offset, entry,
|
||||
AMDVI_DEVTAB_ENTRY_SIZE)) {
|
||||
AMDVI_DEVTAB_ENTRY_SIZE, MEMTXATTRS_UNSPECIFIED)) {
|
||||
trace_amdvi_dte_get_fail(s->devtab, offset);
|
||||
/* log error accessing dte */
|
||||
amdvi_log_devtab_error(s, devid, s->devtab + offset, 0);
|
||||
|
@ -881,7 +882,8 @@ static inline uint64_t amdvi_get_pte_entry(AMDVIState *s, uint64_t pte_addr,
|
|||
{
|
||||
uint64_t pte;
|
||||
|
||||
if (dma_memory_read(&address_space_memory, pte_addr, &pte, sizeof(pte))) {
|
||||
if (dma_memory_read(&address_space_memory, pte_addr,
|
||||
&pte, sizeof(pte), MEMTXATTRS_UNSPECIFIED)) {
|
||||
trace_amdvi_get_pte_hwerror(pte_addr);
|
||||
amdvi_log_pagetab_error(s, devid, pte_addr, 0);
|
||||
pte = 0;
|
||||
|
@ -1048,7 +1050,7 @@ static int amdvi_get_irte(AMDVIState *s, MSIMessage *origin, uint64_t *dte,
|
|||
trace_amdvi_ir_irte(irte_root, offset);
|
||||
|
||||
if (dma_memory_read(&address_space_memory, irte_root + offset,
|
||||
irte, sizeof(*irte))) {
|
||||
irte, sizeof(*irte), MEMTXATTRS_UNSPECIFIED)) {
|
||||
trace_amdvi_ir_err("failed to get irte");
|
||||
return -AMDVI_IR_GET_IRTE;
|
||||
}
|
||||
|
@ -1108,7 +1110,7 @@ static int amdvi_get_irte_ga(AMDVIState *s, MSIMessage *origin, uint64_t *dte,
|
|||
trace_amdvi_ir_irte(irte_root, offset);
|
||||
|
||||
if (dma_memory_read(&address_space_memory, irte_root + offset,
|
||||
irte, sizeof(*irte))) {
|
||||
irte, sizeof(*irte), MEMTXATTRS_UNSPECIFIED)) {
|
||||
trace_amdvi_ir_err("failed to get irte_ga");
|
||||
return -AMDVI_IR_GET_IRTE;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue