Message ID | 20221111182535.64844-15-alex.bennee@linaro.org |
---|---|
State | New |
Headers | show |
Series | use MemTxAttrs to avoid current_cpu in hw/ | expand |
On 11/12/22 04:25, Alex Bennée wrote: > This is simulating a bus master writing data back into system memory. > Mark it as such. > > Signed-off-by: Alex Bennée <alex.bennee@linaro.org> > --- > hw/audio/intel-hda.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c > index f38117057b..95c28b315c 100644 > --- a/hw/audio/intel-hda.c > +++ b/hw/audio/intel-hda.c > @@ -345,7 +345,7 @@ static void intel_hda_corb_run(IntelHDAState *d) > > static void intel_hda_response(HDACodecDevice *dev, bool solicited, uint32_t response) > { > - const MemTxAttrs attrs = { .memory = true }; > + const MemTxAttrs attrs = { .requester_type = MTRT_PCI, .memory = true }; MEMTXATTRS_PCI? r~
On 12/11/22 06:50, Richard Henderson wrote: > On 11/12/22 04:25, Alex Bennée wrote: >> This is simulating a bus master writing data back into system memory. >> Mark it as such. >> >> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> >> --- >> hw/audio/intel-hda.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c >> index f38117057b..95c28b315c 100644 >> --- a/hw/audio/intel-hda.c >> +++ b/hw/audio/intel-hda.c >> @@ -345,7 +345,7 @@ static void intel_hda_corb_run(IntelHDAState *d) >> static void intel_hda_response(HDACodecDevice *dev, bool solicited, >> uint32_t response) >> { >> - const MemTxAttrs attrs = { .memory = true }; >> + const MemTxAttrs attrs = { .requester_type = MTRT_PCI, .memory = >> true }; > > MEMTXATTRS_PCI? Then removing the 'const' qualifier and setting .memory after.
On Fri, 11 Nov 2022 at 18:35, Alex Bennée <alex.bennee@linaro.org> wrote: > > This is simulating a bus master writing data back into system memory. > Mark it as such. > > Signed-off-by: Alex Bennée <alex.bennee@linaro.org> > --- > hw/audio/intel-hda.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c > index f38117057b..95c28b315c 100644 > --- a/hw/audio/intel-hda.c > +++ b/hw/audio/intel-hda.c > @@ -345,7 +345,7 @@ static void intel_hda_corb_run(IntelHDAState *d) > > static void intel_hda_response(HDACodecDevice *dev, bool solicited, uint32_t response) > { > - const MemTxAttrs attrs = { .memory = true }; > + const MemTxAttrs attrs = { .requester_type = MTRT_PCI, .memory = true }; This doesn't look right -- it says "the requester_id field is a PCI requester ID" but it doesn't fill in requester_id. > HDACodecBus *bus = HDA_BUS(dev->qdev.parent_bus); > IntelHDAState *d = container_of(bus, IntelHDAState, codecs); > hwaddr addr; What breaks if we don't set this? Put another way, why do we need to change this but not all the other PCI device models that do DMA writes, most of which use MEMTXATTRS_UNSPECIFIED ? I wonder if stl_le_pci_dma() and friends should set the requester_id on the attrs that they are passed ? -- PMM
On 21/11/22 19:39, Peter Maydell wrote: > On Fri, 11 Nov 2022 at 18:35, Alex Bennée <alex.bennee@linaro.org> wrote: >> >> This is simulating a bus master writing data back into system memory. >> Mark it as such. >> >> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> >> --- >> hw/audio/intel-hda.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> > I wonder if stl_le_pci_dma() and friends should set the > requester_id on the attrs that they are passed ? Very good point!
diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c index f38117057b..95c28b315c 100644 --- a/hw/audio/intel-hda.c +++ b/hw/audio/intel-hda.c @@ -345,7 +345,7 @@ static void intel_hda_corb_run(IntelHDAState *d) static void intel_hda_response(HDACodecDevice *dev, bool solicited, uint32_t response) { - const MemTxAttrs attrs = { .memory = true }; + const MemTxAttrs attrs = { .requester_type = MTRT_PCI, .memory = true }; HDACodecBus *bus = HDA_BUS(dev->qdev.parent_bus); IntelHDAState *d = container_of(bus, IntelHDAState, codecs); hwaddr addr;
This is simulating a bus master writing data back into system memory. Mark it as such. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> --- hw/audio/intel-hda.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)