Skip to contentSkip to conversation

target/arm: Adding a check for the result of calling the CPU information check function

PATCH In review Sergey Mironov 2 participants 3 messages Oct 12, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 100742/100742 target/arm: Adding a check for the result of calling the CPU information check function

6 out of 7 calls to get_arm_cp_reginfo() are checked

---
 target/arm/helper.c | 1 +
 1 file changed, 1 insertion(+)
target/arm/helper.c +1 -0
index 74fbb6e1d7..cffbbaf571 100644
@@ -198,6 +198,7 @@ static void add_cpreg_to_list(gpointer key, gpointer opaque)
     uint32_t regidx = (uintptr_t)key;
     const ARMCPRegInfo *ri = get_arm_cp_reginfo(cpu->cp_regs, regidx);
 
+    assert(ri != NULL);
     if (!(ri->type & (ARM_CP_NO_RAW | ARM_CP_ALIAS))) {
         cpu->cpreg_indexes[cpu->cpreg_array_len] = cpreg_to_kvm_id(regidx);
         /* The value array need not be initialized at this point */
Signature · 1 line
2.31.1
#1 lore raw

Hi Sergey,

Quoted 12 lines · Sergey Mironov

6 out of 7 calls to get_arm_cp_reginfo() are checked

---
  target/arm/helper.c | 1 +
  1 file changed, 1 insertion(+)
target/arm/helper.c +0 -0
index 74fbb6e1d7..cffbbaf571 100644

target/arm/helper.c static void add_cpreg_to_list(gpointer key, gpointer opaque) · line 204

Quoted 7 lines
target/arm/helper.c +1 -0
@@ -198,6 +198,7 @@ static void add_cpreg_to_list(gpointer key, gpointer opaque)
      uint32_t regidx = (uintptr_t)key;
      const ARMCPRegInfo *ri = get_arm_cp_reginfo(cpu->cp_regs, regidx);
 
+    assert(ri != NULL);
      if (!(ri->type & (ARM_CP_NO_RAW | ARM_CP_ALIAS))) {
          cpu->cpreg_indexes[cpu->cpreg_array_len] = cpreg_to_kvm_id(regidx);
          /* The value array need not be initialized at this point */

100742 patches would be the biggest series I ever saw on this list =)

#2 lore raw

It was my mistake :)

________________________________
От: Philippe Mathieu-Daudé <[email protected]>
Отправлено: 12 октября 2023 г. 11:52:58
Кому: Миронов Сергей Владимирович; [email protected]; [email protected]; [email protected] Тема: Re: [PATCH 100742/100742] target/arm: Adding a check for the result of calling the CPU information check function

Hi Sergey,

Quoted 12 lines · Sergey Mironov

6 out of 7 calls to get_arm_cp_reginfo() are checked

---
  target/arm/helper.c | 1 +
  1 file changed, 1 insertion(+)
target/arm/helper.c +0 -0
index 74fbb6e1d7..cffbbaf571 100644

target/arm/helper.c static void add_cpreg_to_list(gpointer key, gpointer opaque) · line 204

Quoted 7 lines
target/arm/helper.c +1 -0
@@ -198,6 +198,7 @@ static void add_cpreg_to_list(gpointer key, gpointer opaque)
      uint32_t regidx = (uintptr_t)key;
      const ARMCPRegInfo *ri = get_arm_cp_reginfo(cpu->cp_regs, regidx);
 
+    assert(ri != NULL);
      if (!(ri->type & (ARM_CP_NO_RAW | ARM_CP_ALIAS))) {
          cpu->cpreg_indexes[cpu->cpreg_array_len] = cpreg_to_kvm_id(regidx);
          /* The value array need not be initialized at this point */

100742 patches would be the biggest series I ever saw on this list =)