audio/hda: fix guest triggerable assert
PATCH 1/1 audio/hda: fix guest triggerable assert
Guest writes to a readonly register trigger the assert in intel_hda_reg_write(). Add a check and just ignore them.
--- hw/audio/intel-hda.c | 4 ++++ 1 file changed, 4 insertions(+)
hw/audio/intel-hda.c +4 -0
@@ -929,6 +929,10 @@ static void intel_hda_reg_write(IntelHDAState *d, const IntelHDAReg *reg, uint32if (!reg) {return ; } +if (!reg->wmask) { +/* read-only register */ +return ; + }if (d->debug) {time_t now =time (NULL );
Signature · 1 line
2.9.3
Quoted 5 lines · * Gerd Hoffmann ([email protected]) wrote:
Guest writes to a readonly register trigger the assert in
intel_hda_reg_write(). Add a check and just ignore them.Signed-off-by Gerd Hoffmann <[email protected]>
Does make you wonder:
a) Why the guest was writing to a read-only register
b) Wth it only did it in the weird combination of devices tested.
Quoted 23 lines
--- hw/audio/intel-hda.c | 4 ++++ 1 file changed, 4 insertions(+)hw/audio/intel-hda.c +4
-0@@ -929,6 +929,10 @@ static void intel_hda_reg_write(IntelHDAState *d, const IntelHDAReg *reg, uint32if (!reg) {return ; } +if (!reg->wmask) { +/* read-only register */ +return ; + }if (d->debug) {time_t now =time (NULL );Signature · 1 line
2.9.3
--
Dr. David Alan Gilbert / [email protected] / Manchester, UK
Hi Gerd,
Quoted 2 lines · Gerd Hoffmann
Guest writes to a readonly register trigger the assert in
intel_hda_reg_write(). Add a check and just ignore them.
Is this 3.1 material? It seems to apply.
Quoted 12 lines
Signed-off-by Gerd Hoffmann <[email protected]>--- hw/audio/intel-hda.c | 4 ++++ 1 file changed, 4 insertions(+)hw/audio/intel-hda.c +0
-0
hw/audio/intel-hda.c static void intel_hda_reg_write(IntelHDAState *d, const IntelHDAReg *reg, uint32 · line 933
Quoted 5 lines
hw/audio/intel-hda.c +2
-0@@ -929,6 +929,10 @@ static void intel_hda_reg_write(IntelHDAState *d, const IntelHDAReg *reg, uint32if (!reg) {return ; } +if (!reg->wmask) { +/* read-only register */
Can you add:
qemu_log_mask(LOG_GUEST_ERROR,
"intel-hda: Register %s is read-only\n", reg->name);
Regardless:
Quoted 6 lines
hw/audio/intel-hda.c +2
-0+return ; + }if (d->debug) {time_t now =time (NULL );
Quoted 11 lines · Dr. David Alan Gilbert
Quoted 5 lines · * Gerd Hoffmann ([email protected]) wrote:
Guest writes to a readonly register trigger the assert in
intel_hda_reg_write(). Add a check and just ignore them.Signed-off-by Gerd Hoffmann <[email protected]>Does make you wonder:
a) Why the guest was writing to a read-only register
b) Wth it only did it in the weird combination of devices tested.
Note that we also have pci hotplug involved. Probably a bug in the guest, maybe due to a register access landing at the wrong device while reshuffling the bars or something like that.
cheers,
Gerd