Skip to contentSkip to conversation

Re%3A [PATCH v4 1%2F2] hw%2Fwatchdog%3A Implement SBSA watchdog device&In-Reply-To=<CAD8XO3YmTC7fzxttg%3DQLMpJbg7uLogatxN7q7vf-iGZjyQLjjQ%40mail.gmail.com>

DISCUSSION Shashi Mallela 3 participants 3 messages Oct 9, 2020 – Oct 12, 2020

lore
Share & tools
lore
#0 lore raw

The value being returned here is 0 (initialized to 0 at the beginning of read function).
I have seen similar practices being followed in other qemu implementations like for example bcm2835_dma_read() in qemu/hw/dma/bcm2835_dma.c,a9_scu_read() in qemu/hw/misc/a9scu.c.

Please confirm if you would still like to add specific value like 0xdeadbeef for bad read offset. Thanks
Shashi

#1 lore raw
Quoted 5 lines · Shashi Mallela

The value being returned here is 0 (initialized to 0 at the beginning of read function).
I have seen similar practices being followed in other qemu implementations like for example bcm2835_dma_read() in qemu/hw/dma/bcm2835_dma.c,a9_scu_read() in qemu/hw/misc/a9scu.c.

Please confirm if you would still like to add specific value like 0xdeadbeef for bad read offset.

Judging by the subject line you've mangled the headers on this email so I'm not sure exactly what this was a reply to, but in general QEMU doesn't do that kind of "return specific marker values for bad register offsets". We typically log it with a qemu_log_mask(LOG_GUEST_ERROR) and return 0 (unless the h/w does something else).

thanks
-- PMM

#2 lore raw

Review

Quoted 10 lines
(quoted diff) +10 -0
+static uint64_t sbsa_gwdt_rread(void *opaque, hwaddr addr, unsigned int size)
+{
+    uint32_t ret;
+
+    if (addr == SBSA_GWDT_WRR) {
+        /* watch refresh read has no effect and returns 0 */
+        ret = 0;
+    } else {
+        qemu_log_mask(LOG_GUEST_ERROR, "bad address in refresh frame read :"
+

Then it has to be uint32_t ret = 0;

Quoted 17 lines · Peter Maydell
Quoted 5 lines · Shashi Mallela

The value being returned here is 0 (initialized to 0 at the beginning of read function).
I have seen similar practices being followed in other qemu implementations like for example bcm2835_dma_read() in qemu/hw/dma/bcm2835_dma.c,a9_scu_read() in qemu/hw/misc/a9scu.c.

Please confirm if you would still like to add specific value like 0xdeadbeef for bad read offset.

Judging by the subject line you've mangled the headers on this email so I'm not sure exactly what this was a reply to, but in general QEMU doesn't do that kind of "return specific marker values for bad register offsets". We typically log it with a qemu_log_mask(LOG_GUEST_ERROR) and return 0 (unless the h/w does something else).

thanks
-- PMM