On 10/28/25 15:54, Shivang Upadhyay wrote:
On Tue, Oct 28, 2025 at 09:35:40AM +0100, Philippe Mathieu-Daudé wrote:
On 28/10/25 09:05, Shivang Upadhyay wrote:
Fixes coverity (CID 1642026)
Cc: Aditya Gupta <[email protected]>
Cc: Harsh Prateek Bora <[email protected]>
Link:
https://lore.kernel.org/qemu-devel/CAFEAcA-SPmsnU1wzsWxBcFC=zm_ddhpeg1n4ix9q4bl1xon...@mail.gmail.com/
Reported-by: Peter Maydell <[email protected]>
Suggested-by: Peter Maydell <[email protected]>
Signed-off-by: Shivang Upadhyay <[email protected]>
---
hw/ppc/spapr_fadump.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/ppc/spapr_fadump.c b/hw/ppc/spapr_fadump.c
index fa3aeac94c..883a60cdcf 100644
--- a/hw/ppc/spapr_fadump.c
+++ b/hw/ppc/spapr_fadump.c
@@ -234,6 +234,7 @@ static bool do_preserve_region(FadumpSection *region)
qemu_log_mask(LOG_GUEST_ERROR,
FWIW host heap exhaustion is not really a *guest* error, because the
guest can not control it.
Hi, Philippe
Thanks for the review. There are following log level defined in log.h
....
#define CPU_LOG_TB_OUT_ASM (1u << 0)
#define CPU_LOG_TB_IN_ASM (1u << 1)
#define CPU_LOG_TB_OP (1u << 2)
#define CPU_LOG_TB_OP_OPT (1u << 3)
#define CPU_LOG_INT (1u << 4)
#define CPU_LOG_EXEC (1u << 5)
#define CPU_LOG_PCALL (1u << 6)
#define CPU_LOG_TB_CPU (1u << 8)
#define CPU_LOG_RESET (1u << 9)
#define LOG_UNIMP (1u << 10)
#define LOG_GUEST_ERROR (1u << 11)
#define CPU_LOG_MMU (1u << 12)
#define CPU_LOG_TB_NOCHAIN (1u << 13)
#define CPU_LOG_PAGE (1u << 14)
/* LOG_TRACE (1 << 15) is defined in log-for-trace.h */
#define CPU_LOG_TB_OP_IND (1u << 16)
#define CPU_LOG_TB_FPU (1u << 17)
#define CPU_LOG_PLUGIN (1u << 18)
/* LOG_STRACE is used for user-mode strace logging. */
#define LOG_STRACE (1u << 19)
#define LOG_PER_THREAD (1u << 20)
#define CPU_LOG_TB_VPU (1u << 21)
#define LOG_TB_OP_PLUGIN (1u << 22)
#define LOG_INVALID_MEM (1u << 23)
....
Which one do you recommend we use? or May we introduce a `LOG_HOST_ERROR`,
if that's more appropriate.
I think it would be better to have LOG_INSUFF_MEM for this case, but
let's hear from Philippe and others for suggestions.
Since it's unlreated to the coverity fix and can be taken separately, so:
Reviewed-by: Harsh Prateek Bora <[email protected]>
Thanks
~Shivang.
"FADump: Failed allocating memory (size: %zu) for copying"
" reserved memory regions\n", FADUMP_CHUNK_SIZE);
+ return false;
}
num_chunks = ceil((src_len * 1.0f) / FADUMP_CHUNK_SIZE);