All of lore.kernel.org
 help / color / mirror / Atom feed
From: Harsh Prateek Bora <harshpb@linux.ibm.com>
To: qemu-devel@nongnu.org
Cc: Gautam Menghani <gautam@linux.ibm.com>,
	Chinmay Rath <rathc@linux.ibm.com>
Subject: [PULL 01/10] target/ppc/kvm : Use macro names instead of hardcoded constants as return values
Date: Mon, 12 Jan 2026 16:04:24 +0530	[thread overview]
Message-ID: <20260112103433.8451-2-harshpb@linux.ibm.com> (raw)
In-Reply-To: <20260112103433.8451-1-harshpb@linux.ibm.com>

From: Gautam Menghani <gautam@linux.ibm.com>

In the parse_* functions used to parse the return values of
KVM_PPC_GET_CPU_CHAR ioctl, the return values are hardcoded as numbers.
Use the macro names for better readability. No functional change
intended.

Signed-off-by: Gautam Menghani <gautam@linux.ibm.com>
Reviewed-by: Chinmay Rath <rathc@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20251202124654.11481-1-gautam@linux.ibm.com
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
---
 target/ppc/kvm.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c
index 1521787b3f..41bd03ec2a 100644
--- a/target/ppc/kvm.c
+++ b/target/ppc/kvm.c
@@ -2450,26 +2450,26 @@ static int parse_cap_ppc_safe_cache(struct kvm_ppc_cpu_char c)
     bool l1d_thread_priv_req = !kvmppc_power8_host();
 
     if (~c.behaviour & c.behaviour_mask & H_CPU_BEHAV_L1D_FLUSH_PR) {
-        return 2;
+        return SPAPR_CAP_FIXED;
     } else if ((!l1d_thread_priv_req ||
                 c.character & c.character_mask & H_CPU_CHAR_L1D_THREAD_PRIV) &&
                (c.character & c.character_mask
                 & (H_CPU_CHAR_L1D_FLUSH_ORI30 | H_CPU_CHAR_L1D_FLUSH_TRIG2))) {
-        return 1;
+        return SPAPR_CAP_WORKAROUND;
     }
 
-    return 0;
+    return SPAPR_CAP_BROKEN;
 }
 
 static int parse_cap_ppc_safe_bounds_check(struct kvm_ppc_cpu_char c)
 {
     if (~c.behaviour & c.behaviour_mask & H_CPU_BEHAV_BNDS_CHK_SPEC_BAR) {
-        return 2;
+        return SPAPR_CAP_FIXED;
     } else if (c.character & c.character_mask & H_CPU_CHAR_SPEC_BAR_ORI31) {
-        return 1;
+        return SPAPR_CAP_WORKAROUND;
     }
 
-    return 0;
+    return SPAPR_CAP_BROKEN;
 }
 
 static int parse_cap_ppc_safe_indirect_branch(struct kvm_ppc_cpu_char c)
@@ -2486,15 +2486,15 @@ static int parse_cap_ppc_safe_indirect_branch(struct kvm_ppc_cpu_char c)
         return SPAPR_CAP_FIXED_IBS;
     }
 
-    return 0;
+    return SPAPR_CAP_BROKEN;
 }
 
 static int parse_cap_ppc_count_cache_flush_assist(struct kvm_ppc_cpu_char c)
 {
     if (c.character & c.character_mask & H_CPU_CHAR_BCCTR_FLUSH_ASSIST) {
-        return 1;
+        return SPAPR_CAP_WORKAROUND;
     }
-    return 0;
+    return SPAPR_CAP_BROKEN;
 }
 
 bool kvmppc_has_cap_xive(void)
-- 
2.52.0



  reply	other threads:[~2026-01-12 10:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-12 10:34 [PULL 00/10] ppc-for-11.0 queue Harsh Prateek Bora
2026-01-12 10:34 ` Harsh Prateek Bora [this message]
2026-01-12 10:34 ` [PULL 02/10] hw/ppc: Add VMSTATE information for LPC model Harsh Prateek Bora
2026-01-12 10:34 ` [PULL 03/10] hw/ppc: Add pnv_spi vmstate support Harsh Prateek Bora
2026-01-12 10:34 ` [PULL 04/10] hw/ppc: Add pnv_i2c " Harsh Prateek Bora
2026-01-12 10:34 ` [PULL 05/10] hw/ppc: pnv_adu.c added " Harsh Prateek Bora
2026-01-12 10:34 ` [PULL 06/10] hw/ppc: pnv_core.c add " Harsh Prateek Bora
2026-01-12 10:34 ` [PULL 07/10] hw/ppc: pnv_chiptod.c " Harsh Prateek Bora
2026-01-12 10:34 ` [PULL 08/10] hw/ppc: Add VMSTATE information to PnvPsi Harsh Prateek Bora
2026-01-12 10:34 ` [PULL 09/10] target/ppc: Fix env->quiesced migration Harsh Prateek Bora
2026-01-12 10:34 ` [PULL 10/10] tests/functional: Add a OS level migration test for pseries Harsh Prateek Bora
2026-01-13  0:50 ` [PULL 00/10] ppc-for-11.0 queue Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260112103433.8451-2-harshpb@linux.ibm.com \
    --to=harshpb@linux.ibm.com \
    --cc=gautam@linux.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rathc@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.