Skip to contentSkip to conversation

xen/arm: eliminate bool_t from arch-arm code

PATCH In review Wei Liu 2 participants 30 messages Sep 15, 2017 Arm Samsung Exynos

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

cover xen/arm: eliminate bool_t from arch-arm code

After this series, arch arm code is bool_t free.

$ git grep bool_t xen/arch/arm xen/include/asm-arm;  echo $?
1

Compile-test only.

Wei Liu (12):
arm/acpi: switch to plain bool arm/{v,}gic: switch to plain bool arm/domain_build: switch to plain bool arm/irq: switch to plain bool arm/platform: switch to plain bool arm/alternative.c: switch to plain bool arm/cpu{errata,feature}.[ch]: switch to plain bool arm/bootfdt.c: switch to plain bool arm/decode.c: switch to plain bool arm/smpboot.c: switch to plain bool arm/vtimer.c: switch to plain bool
arm: use plain bool in various headers

 xen/arch/arm/acpi/boot.c           |  6 +++---
 xen/arch/arm/acpi/lib.c            |  8 ++++----
 xen/arch/arm/alternative.c         |  8 ++++----
 xen/arch/arm/bootfdt.c             | 14 +++++++-------
 xen/arch/arm/cpuerrata.c           |  2 +-
 xen/arch/arm/decode.c              |  6 +++---
 xen/arch/arm/domain_build.c        | 25 +++++++++++++------------
 xen/arch/arm/gic-v2.c              |  4 ++--
 xen/arch/arm/gic-v3.c              | 10 +++++-----
 xen/arch/arm/irq.c                 | 12 ++++++------
 xen/arch/arm/platform.c            | 14 +++++++-------
 xen/arch/arm/platforms/exynos5.c   |  4 ++--
 xen/arch/arm/setup.c               |  2 +-
 xen/arch/arm/smpboot.c             | 10 +++++-----
 xen/arch/arm/vgic-v2.c             |  4 ++--
 xen/arch/arm/vgic-v3.c             |  4 ++--
 xen/arch/arm/vtimer.c              |  2 +-
 xen/include/asm-arm/acpi.h         | 10 +++++-----
 xen/include/asm-arm/altp2m.h       |  4 ++--
 xen/include/asm-arm/arm64/insn.h   |  2 +-
 xen/include/asm-arm/cpuerrata.h    |  8 ++++----
 xen/include/asm-arm/cpufeature.h   |  6 +++---
 xen/include/asm-arm/domain.h       |  2 +-
 xen/include/asm-arm/gic.h          |  2 +-
 xen/include/asm-arm/guest_access.h |  2 +-
 xen/include/asm-arm/irq.h          |  4 ++--
 xen/include/asm-arm/p2m.h          |  8 ++++----
 xen/include/asm-arm/platform.h     |  4 ++--
 28 files changed, 94 insertions(+), 93 deletions(-)
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
author
#1 lore raw

PATCH 1/12 arm/acpi: switch to plain bool

---
 xen/arch/arm/acpi/boot.c   |  6 +++---
 xen/arch/arm/acpi/lib.c    |  8 ++++----
 xen/arch/arm/setup.c       |  2 +-
 xen/include/asm-arm/acpi.h | 10 +++++-----
 4 files changed, 13 insertions(+), 13 deletions(-)
xen/arch/arm/acpi/boot.c +3 -3
index 6101bf39c9..9b29769a10 100644
@@ -53,7 +53,7 @@ acpi_map_gic_cpu_interface(struct acpi_madt_generic_interrupt *processor)
     int i;
     int rc;
     u64 mpidr = processor->arm_mpidr & MPIDR_HWID_MASK;
-    bool_t enabled = !!(processor->flags & ACPI_MADT_ENABLED);
+    bool enabled = processor->flags & ACPI_MADT_ENABLED;
 
     if ( mpidr == MPIDR_INVALID )
     {
@@ -190,8 +190,8 @@ static int __init acpi_parse_fadt(struct acpi_table_header *table)
     return -EINVAL;
 }
 
-static bool_t __initdata param_acpi_off;
-static bool_t __initdata param_acpi_force;
+static bool __initdata param_acpi_off;
+static bool __initdata param_acpi_force;
 
 static int __init parse_acpi_param(const char *arg)
 {
xen/arch/arm/acpi/lib.c +4 -4
index 70131b0736..ada5298a38 100644
@@ -48,14 +48,14 @@ char *__acpi_map_table(paddr_t phys, unsigned long size)
     return ((char *) base + offset);
 }
 
-/* 1 to indicate PSCI 0.2+ is implemented */
-bool_t __init acpi_psci_present(void)
+/* True to indicate PSCI 0.2+ is implemented */
+bool __init acpi_psci_present(void)
 {
     return acpi_gbl_FADT.arm_boot_flags & ACPI_FADT_PSCI_COMPLIANT;
 }
 
-/* 1 to indicate HVC is present instead of SMC as the PSCI conduit */
-bool_t __init acpi_psci_hvc_present(void)
+/* True to indicate HVC is present instead of SMC as the PSCI conduit */
+bool __init acpi_psci_hvc_present(void)
 {
     return acpi_gbl_FADT.arm_boot_flags & ACPI_FADT_PSCI_USE_HVC;
 }
xen/arch/arm/setup.c +1 -1
index 92f173be0c..fd3b0981d5 100644
@@ -55,7 +55,7 @@ struct bootinfo __initdata bootinfo;
 struct cpuinfo_arm __read_mostly boot_cpu_data;
 
 #ifdef CONFIG_ACPI
-bool_t __read_mostly acpi_disabled;
+bool __read_mostly acpi_disabled;
 #endif
 
 #ifdef CONFIG_ARM_32
xen/include/asm-arm/acpi.h +5 -5
index 9f954d39e1..a62429e7e2 100644
@@ -43,8 +43,8 @@ typedef enum {
     TBL_MMAX,
 } EFI_MEM_RES;
 
-bool_t __init acpi_psci_present(void);
-bool_t __init acpi_psci_hvc_present(void);
+bool __init acpi_psci_present(void);
+bool __init acpi_psci_hvc_present(void);
 void __init acpi_smp_init_cpus(void);
 
 /*
@@ -57,16 +57,16 @@ void __init acpi_smp_init_cpus(void);
 paddr_t acpi_get_table_offset(struct membank tbl_add[], EFI_MEM_RES index);
 
 #ifdef CONFIG_ACPI
-extern bool_t acpi_disabled;
+extern bool acpi_disabled;
 /* Basic configuration for ACPI */
 static inline void disable_acpi(void)
 {
-    acpi_disabled = 1;
+    acpi_disabled = true;
 }
 
 static inline void enable_acpi(void)
 {
-    acpi_disabled = 0;
+    acpi_disabled = false;
 }
 #else
 #define acpi_disabled (1)
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Reviewed-by on v1 1/12
#2 lore raw

Re: [PATCH 01/12] arm/acpi: switch to plain bool

Hi Wei,

Quoted 25 lines · Wei Liu
xen/include/asm-arm/acpi.h +3 -4
index 9f954d39e1..a62429e7e2 100644
@@ -43,8 +43,8 @@ typedef enum {
      TBL_MMAX,
  } EFI_MEM_RES;
 
-bool_t __init acpi_psci_present(void);
-bool_t __init acpi_psci_hvc_present(void);
+bool __init acpi_psci_present(void);
+bool __init acpi_psci_hvc_present(void);
  void __init acpi_smp_init_cpus(void);
 
  /*
@@ -57,16 +57,16 @@ void __init acpi_smp_init_cpus(void);
  paddr_t acpi_get_table_offset(struct membank tbl_add[], EFI_MEM_RES index);
 
  #ifdef CONFIG_ACPI
-extern bool_t acpi_disabled;
+extern bool acpi_disabled;
  /* Basic configuration for ACPI */
  static inline void disable_acpi(void)
  {
-    acpi_disabled = 1;

xen/include/asm-arm/acpi.h void __init acpi_smp_init_cpus(void); · line 72

Quoted 10 lines
xen/include/asm-arm/acpi.h +2 -1
+    acpi_disabled = true;
  }
 
  static inline void enable_acpi(void)
  {
-    acpi_disabled = 0;
+    acpi_disabled = false;
  }
  #else
  #define acpi_disabled (1)

Can you modify the 1 to true, here? This would make the !CONFIG_ACPI version inlined with the CONFIG_ACPI one.

With that:

Cheers,

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
author
#3 lore raw

Re: [PATCH 01/12] arm/acpi: switch to plain bool

Quoted 29 lines · Julien Grall

Hi Wei,

Quoted 26 lines · Wei Liu
xen/include/asm-arm/acpi.h +4 -4
index 9f954d39e1..a62429e7e2 100644
@@ -43,8 +43,8 @@ typedef enum {
      TBL_MMAX,
  } EFI_MEM_RES;
-bool_t __init acpi_psci_present(void);
-bool_t __init acpi_psci_hvc_present(void);
+bool __init acpi_psci_present(void);
+bool __init acpi_psci_hvc_present(void);
  void __init acpi_smp_init_cpus(void);
  /*
@@ -57,16 +57,16 @@ void __init acpi_smp_init_cpus(void);
  paddr_t acpi_get_table_offset(struct membank tbl_add[], EFI_MEM_RES index);
  #ifdef CONFIG_ACPI
-extern bool_t acpi_disabled;
+extern bool acpi_disabled;
  /* Basic configuration for ACPI */
  static inline void disable_acpi(void)
  {
-    acpi_disabled = 1;
+    acpi_disabled = true;
  }
  static inline void enable_acpi(void)
  {
Quoted 9 lines

xen/include/asm-arm/acpi.h void __init acpi_smp_init_cpus(void); · line 72

Quoted 5 lines
xen/include/asm-arm/acpi.h +1 -1
-    acpi_disabled = 0;
+    acpi_disabled = false;
  }
  #else
  #define acpi_disabled (1)

Can you modify the 1 to true, here? This would make the !CONFIG_ACPI version inlined with the CONFIG_ACPI one.

Done.

Quoted 4 lines

With that:

Thanks

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

author
#4 lore raw

PATCH 2/12 arm/{v,}gic: switch to plain bool

In reply to Wei Liu
---
 xen/arch/arm/gic-v2.c     |  4 ++--
 xen/arch/arm/gic-v3.c     | 10 +++++-----
 xen/arch/arm/vgic-v2.c    |  4 ++--
 xen/arch/arm/vgic-v3.c    |  4 ++--
 xen/include/asm-arm/gic.h |  2 +-
 5 files changed, 12 insertions(+), 12 deletions(-)
xen/arch/arm/gic-v2.c +2 -2
index cbe71a9c18..d54db4c80c 100644
@@ -483,7 +483,7 @@ static void gicv2_write_lr(int lr, const struct gic_lr *lr_reg)
     writel_gich(lrv, GICH_LR + lr * 4);
 }
 
-static void gicv2_hcr_status(uint32_t flag, bool_t status)
+static void gicv2_hcr_status(uint32_t flag, bool status)
 {
     uint32_t hcr = readl_gich(GICH_HCR);
 
@@ -815,7 +815,7 @@ static hw_irq_controller gicv2_guest_irq_type = {
     .set_affinity = gicv2_irq_set_affinity,
 };
 
-static bool_t gicv2_is_aliased(paddr_t cbase, paddr_t csize)
+static bool gicv2_is_aliased(paddr_t cbase, paddr_t csize)
 {
     uint32_t val_low, val_high;
 
xen/arch/arm/gic-v3.c +5 -5
index f990eae832..0c5ac1d995 100644
@@ -261,7 +261,7 @@ static void gicv3_enable_sre(void)
 static void gicv3_do_wait_for_rwp(void __iomem *base)
 {
     uint32_t val;
-    bool_t timeout = 0;
+    bool timeout = false;
     s_time_t deadline = NOW() + MILLISECS(1000);
 
     do {
@@ -270,7 +270,7 @@ static void gicv3_do_wait_for_rwp(void __iomem *base)
             break;
         if ( NOW() > deadline )
         {
-            timeout = 1;
+            timeout = true;
             break;
         }
         cpu_relax();
@@ -590,7 +590,7 @@ static void __init gicv3_dist_init(void)
 static int gicv3_enable_redist(void)
 {
     uint32_t val;
-    bool_t timeout = 0;
+    bool timeout = false;
     s_time_t deadline = NOW() + MILLISECS(1000);
 
     /* Wake up this CPU redistributor */
@@ -604,7 +604,7 @@ static int gicv3_enable_redist(void)
             break;
         if ( NOW() > deadline )
         {
-            timeout = 1;
+            timeout = true;
             break;
         }
         cpu_relax();
@@ -1005,7 +1005,7 @@ static void gicv3_write_lr(int lr_reg, const struct gic_lr *lr)
     gicv3_ich_write_lr(lr_reg, lrv);
 }
 
-static void gicv3_hcr_status(uint32_t flag, bool_t status)
+static void gicv3_hcr_status(uint32_t flag, bool status)
 {
     uint32_t hcr;
 
xen/arch/arm/vgic-v2.c +2 -2
index cf4ab89f81..2bdb25261a 100644
@@ -33,7 +33,7 @@
 #include <asm/vgic-emul.h>
 
 static struct {
-    bool_t enabled;
+    bool enabled;
     /* Distributor interface address */
     paddr_t dbase;
     /* CPU interface address & size */
@@ -49,7 +49,7 @@ static struct {
 void vgic_v2_setup_hw(paddr_t dbase, paddr_t cbase, paddr_t csize,
                       paddr_t vbase, uint32_t aliased_offset)
 {
-    vgic_v2_hw.enabled = 1;
+    vgic_v2_hw.enabled = true;
     vgic_v2_hw.dbase = dbase;
     vgic_v2_hw.cbase = cbase;
     vgic_v2_hw.csize = csize;
xen/arch/arm/vgic-v3.c +2 -2
index a0cf993d13..af16dfd005 100644
@@ -52,7 +52,7 @@
 #define VGICD_CTLR_DEFAULT  (GICD_CTLR_ARE_NS)
 
 static struct {
-    bool_t enabled;
+    bool enabled;
     /* Distributor interface address */
     paddr_t dbase;
     /* Re-distributor regions */
@@ -68,7 +68,7 @@ void vgic_v3_setup_hw(paddr_t dbase,
                       uint32_t rdist_stride,
                       unsigned int intid_bits)
 {
-    vgic_v3_hw.enabled = 1;
+    vgic_v3_hw.enabled = true;
     vgic_v3_hw.dbase = dbase;
     vgic_v3_hw.nr_rdist_regions = nr_rdist_regions;
     vgic_v3_hw.regions = regions;
xen/include/asm-arm/gic.h +1 -1
index 6203dc59f4..977e75b1d2 100644
@@ -345,7 +345,7 @@ struct gic_hw_operations {
     void (*update_lr)(int lr, const struct pending_irq *pending_irq,
                       unsigned int state);
     /* Update HCR status register */
-    void (*update_hcr_status)(uint32_t flag, bool_t set);
+    void (*update_hcr_status)(uint32_t flag, bool set);
     /* Clear LR register */
     void (*clear_lr)(int lr);
     /* Read LR register and populate gic_lr structure */
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#5 lore raw

Re: [PATCH 02/12] arm/{v,}gic: switch to plain bool

Hi Wei,

xen/include/asm-arm/gic.h struct gic_hw_operations { · line 348

Quoted 10 lines · Wei Liu
xen/include/asm-arm/gic.h +1 -1
index 6203dc59f4..977e75b1d2 100644
@@ -345,7 +345,7 @@ struct gic_hw_operations {
      void (*update_lr)(int lr, const struct pending_irq *pending_irq,
                        unsigned int state);
      /* Update HCR status register */
-    void (*update_hcr_status)(uint32_t flag, bool_t set);
+    void (*update_hcr_status)(uint32_t flag, bool set);

The callers of update_hcr_status are still using 1/0 (see arch/arm/gic.c). Would you mind to fix it?

I can also send a follow-up patch :).

xen/include/asm-arm/gic.h struct gic_hw_operations { · line 351

Quoted 4 lines
xen/include/asm-arm/gic.h +0 -0
      /* Clear LR register */
      void (*clear_lr)(int lr);
      /* Read LR register and populate gic_lr structure */

Cheers,

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
author
#6 lore raw

Re: [PATCH 02/12] arm/{v,}gic: switch to plain bool

Quoted 16 lines · Julien Grall

Hi Wei,

xen/include/asm-arm/gic.h struct gic_hw_operations { · line 348

Quoted 10 lines · Wei Liu
xen/include/asm-arm/gic.h +1 -1
index 6203dc59f4..977e75b1d2 100644
@@ -345,7 +345,7 @@ struct gic_hw_operations {
      void (*update_lr)(int lr, const struct pending_irq *pending_irq,
                        unsigned int state);
      /* Update HCR status register */
-    void (*update_hcr_status)(uint32_t flag, bool_t set);
+    void (*update_hcr_status)(uint32_t flag, bool set);

The callers of update_hcr_status are still using 1/0 (see arch/arm/gic.c). Would you mind to fix it?

I will squash in the following diff:

xen/arch/arm/gic.c +2 -2
index 6c803bf09b..f578f3c566 100644
@@ -606,7 +606,7 @@ void gic_clear_lrs(struct vcpu *v)
     if ( is_idle_vcpu(v) )
         return;
 
-    gic_hw_ops->update_hcr_status(GICH_HCR_UIE, 0);
+    gic_hw_ops->update_hcr_status(GICH_HCR_UIE, false);
 
     spin_lock_irqsave(&v->arch.vgic.lock, flags);
 
@@ -731,7 +731,7 @@ void gic_inject(void)
     gic_restore_pending_irqs(current);
 
     if ( !list_empty(&current->arch.vgic.lr_pending) && lr_all_full() )
-        gic_hw_ops->update_hcr_status(GICH_HCR_UIE, 1);
+        gic_hw_ops->update_hcr_status(GICH_HCR_UIE, true);
 }
 

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

Reviewed-by
#7 lore raw

Re: [PATCH 02/12] arm/{v,}gic: switch to plain bool

Quoted 18 lines · Wei Liu
Quoted 16 lines · Julien Grall

Hi Wei,

xen/include/asm-arm/gic.h struct gic_hw_operations { · line 348

Quoted 10 lines · Wei Liu
xen/include/asm-arm/gic.h +1 -1
index 6203dc59f4..977e75b1d2 100644
@@ -345,7 +345,7 @@ struct gic_hw_operations {
       void (*update_lr)(int lr, const struct pending_irq *pending_irq,
                         unsigned int state);
       /* Update HCR status register */
-    void (*update_hcr_status)(uint32_t flag, bool_t set);
+    void (*update_hcr_status)(uint32_t flag, bool set);

The callers of update_hcr_status are still using 1/0 (see arch/arm/gic.c). Would you mind to fix it?

Quoted 1 line

I will squash in the following diff:

With that:

Cheers,

Quoted 22 lines
xen/arch/arm/gic.c +2 -2
index 6c803bf09b..f578f3c566 100644
@@ -606,7 +606,7 @@ void gic_clear_lrs(struct vcpu *v)
      if ( is_idle_vcpu(v) )
          return;
 
-    gic_hw_ops->update_hcr_status(GICH_HCR_UIE, 0);
+    gic_hw_ops->update_hcr_status(GICH_HCR_UIE, false);
 
      spin_lock_irqsave(&v->arch.vgic.lock, flags);
 
@@ -731,7 +731,7 @@ void gic_inject(void)
      gic_restore_pending_irqs(current);
 
      if ( !list_empty(&current->arch.vgic.lr_pending) && lr_all_full() )
-        gic_hw_ops->update_hcr_status(GICH_HCR_UIE, 1);
+        gic_hw_ops->update_hcr_status(GICH_HCR_UIE, true);
  }
 
Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
author
#8 lore raw

PATCH 3/12 arm/domain_build: switch to plain bool

In reply to Wei Liu

Also fixed a coding style issue.

---
 xen/arch/arm/domain_build.c | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)
xen/arch/arm/domain_build.c +13 -12
index d6f9585503..c34238ec1b 100644
@@ -98,10 +98,10 @@ static unsigned int get_11_allocation_size(paddr_t size)
  * Returns false if the memory would be below bank 0 or we have run
  * out of banks. In this case it will free the pages.
  */
-static bool_t insert_11_bank(struct domain *d,
-                             struct kernel_info *kinfo,
-                             struct page_info *pg,
-                             unsigned int order)
+static bool insert_11_bank(struct domain *d,
+                           struct kernel_info *kinfo,
+                           struct page_info *pg,
+                           unsigned int order)
 {
     int res, i;
     paddr_t spfn;
@@ -254,7 +254,7 @@ static void allocate_memory(struct domain *d, struct kernel_info *kinfo)
     unsigned int order = get_11_allocation_size(kinfo->unassigned_mem);
     int i;
 
-    bool_t lowmem = true;
+    bool lowmem = true;
     unsigned int bits;
 
     /*
@@ -678,7 +678,7 @@ static int make_cpus_node(const struct domain *d, void *fdt,
     /* Placeholder for cpu@ + a 32-bit number + \0 */
     char buf[15];
     u32 clock_frequency;
-    bool_t clock_valid;
+    bool clock_valid;
     uint64_t mpidr_aff;
 
     dt_dprintk("Create cpus node\n");
@@ -756,7 +756,8 @@ static int make_cpus_node(const struct domain *d, void *fdt,
         if ( res )
             return res;
 
-        if (clock_valid) {
+        if ( clock_valid )
+        {
             res = fdt_property_cell(fdt, "clock-frequency", clock_frequency);
             if ( res )
                 return res;
@@ -864,7 +865,7 @@ static int make_timer_node(const struct domain *d, void *fdt,
     unsigned int irq;
     gic_interrupt_t intrs[3];
     u32 clock_frequency;
-    bool_t clock_valid;
+    bool clock_valid;
 
     dt_dprintk("Create timer node\n");
 
@@ -924,7 +925,7 @@ static int make_timer_node(const struct domain *d, void *fdt,
 }
 
 static int map_irq_to_domain(struct domain *d, unsigned int irq,
-                             bool_t need_mapping, const char *devname)
+                             bool need_mapping, const char *devname)
 
 {
     int res;
@@ -966,7 +967,7 @@ static int map_dt_irq_to_domain(const struct dt_device_node *dev,
     struct domain *d = data;
     unsigned int irq = dt_irq->irq;
     int res;
-    bool_t need_mapping = !dt_device_for_passthrough(dev);
+    bool need_mapping = !dt_device_for_passthrough(dev);
 
     if ( irq < NR_LOCAL_IRQS )
     {
@@ -996,7 +997,7 @@ static int map_range_to_domain(const struct dt_device_node *dev,
 {
     struct map_range_data *mr_data = data;
     struct domain *d = mr_data->d;
-    bool_t need_mapping = !dt_device_for_passthrough(dev);
+    bool need_mapping = !dt_device_for_passthrough(dev);
     int res;
 
     res = iomem_permit_access(d, paddr_to_pfn(addr),
@@ -1080,7 +1081,7 @@ static int handle_device(struct domain *d, struct dt_device_node *dev,
     int res;
     struct dt_raw_irq rirq;
     u64 addr, size;
-    bool_t need_mapping = !dt_device_for_passthrough(dev);
+    bool need_mapping = !dt_device_for_passthrough(dev);
 
     nirq = dt_number_of_irq(dev);
     naddr = dt_number_of_address(dev);
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
author
#10 lore raw

PATCH 4/12 arm/irq: switch to plain bool

In reply to Wei Liu

Also removed a redundant pair of brackets.

---
 xen/arch/arm/irq.c        | 12 ++++++------
 xen/include/asm-arm/irq.h |  4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)
xen/arch/arm/irq.c +6 -6
index f3f20a69c7..cbc7e6ebb8 100644
@@ -315,7 +315,7 @@ void release_irq(unsigned int irq, const void *dev_id)
 static int __setup_irq(struct irq_desc *desc, unsigned int irqflags,
                        struct irqaction *new)
 {
-    bool_t shared = !!(irqflags & IRQF_SHARED);
+    bool shared = irqflags & IRQF_SHARED;
 
     ASSERT(new != NULL);
 
@@ -344,7 +344,7 @@ int setup_irq(unsigned int irq, unsigned int irqflags, struct irqaction *new)
     int rc;
     unsigned long flags;
     struct irq_desc *desc;
-    bool_t disabled;
+    bool disabled;
 
     desc = irq_to_desc(irq);
 
@@ -387,10 +387,10 @@ err:
     return rc;
 }
 
-bool_t is_assignable_irq(unsigned int irq)
+bool is_assignable_irq(unsigned int irq)
 {
     /* For now, we can only route SPIs to the guest */
-    return ((irq >= NR_LOCAL_IRQS) && (irq < gic_number_lines()));
+    return (irq >= NR_LOCAL_IRQS) && (irq < gic_number_lines());
 }
 
 /*
@@ -399,7 +399,7 @@ bool_t is_assignable_irq(unsigned int irq)
  *
  * XXX: See whether it is possible to let any domain configure the type.
  */
-bool_t irq_type_set_by_domain(const struct domain *d)
+bool irq_type_set_by_domain(const struct domain *d)
 {
     return (d == hardware_domain);
 }
@@ -602,7 +602,7 @@ void pirq_set_affinity(struct domain *d, int pirq, const cpumask_t *mask)
     BUG();
 }
 
-static bool_t irq_validate_new_type(unsigned int curr, unsigned new)
+static bool irq_validate_new_type(unsigned int curr, unsigned new)
 {
     return (curr == IRQ_TYPE_INVALID || curr == new );
 }
xen/include/asm-arm/irq.h +2 -2
index 7c7662608a..2de76d0f56 100644
@@ -51,7 +51,7 @@ static inline bool is_lpi(unsigned int irq)
 
 #define domain_pirq_to_irq(d, pirq) (pirq)
 
-bool_t is_assignable_irq(unsigned int irq);
+bool is_assignable_irq(unsigned int irq);
 
 void init_IRQ(void);
 void init_secondary_IRQ(void);
@@ -77,7 +77,7 @@ void irq_set_affinity(struct irq_desc *desc, const cpumask_t *cpu_mask);
  * Use this helper in places that need to know whether the IRQ type is
  * set by the domain.
  */
-bool_t irq_type_set_by_domain(const struct domain *d);
+bool irq_type_set_by_domain(const struct domain *d);
 
 #endif /* _ASM_HW_IRQ_H */
 /*
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
author
#12 lore raw

PATCH 5/12 arm/platform: switch to plain bool

In reply to Wei Liu
---
 xen/arch/arm/platform.c          | 14 +++++++-------
 xen/arch/arm/platforms/exynos5.c |  4 ++--
 xen/include/asm-arm/platform.h   |  4 ++--
 3 files changed, 11 insertions(+), 11 deletions(-)
xen/arch/arm/platform.c +7 -7
index 0af6d57bfe..3f2989ef2b 100644
@@ -28,20 +28,20 @@ extern const struct platform_desc _splatform[], _eplatform[];
 static const struct platform_desc *platform;
 
 
-static bool_t __init platform_is_compatible(const struct platform_desc *plat)
+static bool __init platform_is_compatible(const struct platform_desc *plat)
 {
     const char *const *compat;
 
     if ( !plat->compatible )
-        return 0;
+        return false;
 
     for ( compat = plat->compatible; *compat; compat++ )
     {
         if ( dt_machine_is_compatible(*compat) )
-            return 1;
+            return true;
     }
 
-    return 0;
+    return false;
 }
 
 void __init platform_init(void)
@@ -127,17 +127,17 @@ void platform_poweroff(void)
         platform->poweroff();
 }
 
-bool_t platform_has_quirk(uint32_t quirk)
+bool platform_has_quirk(uint32_t quirk)
 {
     uint32_t quirks = 0;
 
     if ( platform && platform->quirks )
         quirks = platform->quirks();
 
-    return !!(quirks & quirk);
+    return (quirks & quirk);
 }
 
-bool_t platform_device_is_blacklisted(const struct dt_device_node *node)
+bool platform_device_is_blacklisted(const struct dt_device_node *node)
 {
     const struct dt_device_match *blacklist = NULL;
 
xen/arch/arm/platforms/exynos5.c +2 -2
index 2ae5fa66e0..01247cb6a5 100644
@@ -27,7 +27,7 @@
 #include <asm/platform.h>
 #include <asm/io.h>
 
-static bool_t secure_firmware;
+static bool secure_firmware;
 
 #define EXYNOS_ARM_CORE0_CONFIG     0x2000
 #define EXYNOS_ARM_CORE_CONFIG(_nr) (EXYNOS_ARM_CORE0_CONFIG + (0x80 * (_nr)))
@@ -108,7 +108,7 @@ static int __init exynos5_smp_init(void)
         /* Have to use sysram_ns_base_addr + 0x1c for boot address */
         compatible = "samsung,exynos4210-sysram-ns";
         sysram_offset = 0x1c;
-        secure_firmware = 1;
+        secure_firmware = true;
         printk("Running under secure firmware.\n");
     }
     else
xen/include/asm-arm/platform.h +2 -2
index 08010ba09b..2591d7bb03 100644
@@ -55,8 +55,8 @@ int platform_cpu_up(int cpu);
 #endif
 void platform_reset(void);
 void platform_poweroff(void);
-bool_t platform_has_quirk(uint32_t quirk);
-bool_t platform_device_is_blacklisted(const struct dt_device_node *node);
+bool platform_has_quirk(uint32_t quirk);
+bool platform_device_is_blacklisted(const struct dt_device_node *node);
 
 #define PLATFORM_START(_name, _namestr)                         \
 static const struct platform_desc  __plat_desc_##_name __used   \
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Reviewed-by on v1 5/12
#13 lore raw

Re: [PATCH 05/12] arm/platform: switch to plain bool

Quoted 1 line · Wei Liu
Quoted 94 lines
---
  xen/arch/arm/platform.c          | 14 +++++++-------
  xen/arch/arm/platforms/exynos5.c |  4 ++--
  xen/include/asm-arm/platform.h   |  4 ++--
  3 files changed, 11 insertions(+), 11 deletions(-)
xen/arch/arm/platform.c +7 -7
index 0af6d57bfe..3f2989ef2b 100644
@@ -28,20 +28,20 @@ extern const struct platform_desc _splatform[], _eplatform[];
  static const struct platform_desc *platform;
 
 
-static bool_t __init platform_is_compatible(const struct platform_desc *plat)
+static bool __init platform_is_compatible(const struct platform_desc *plat)
  {
      const char *const *compat;
 
      if ( !plat->compatible )
-        return 0;
+        return false;
 
      for ( compat = plat->compatible; *compat; compat++ )
      {
          if ( dt_machine_is_compatible(*compat) )
-            return 1;
+            return true;
      }
 
-    return 0;
+    return false;
  }
 
  void __init platform_init(void)
@@ -127,17 +127,17 @@ void platform_poweroff(void)
          platform->poweroff();
  }
 
-bool_t platform_has_quirk(uint32_t quirk)
+bool platform_has_quirk(uint32_t quirk)
  {
      uint32_t quirks = 0;
 
      if ( platform && platform->quirks )
          quirks = platform->quirks();
 
-    return !!(quirks & quirk);
+    return (quirks & quirk);
  }
 
-bool_t platform_device_is_blacklisted(const struct dt_device_node *node)
+bool platform_device_is_blacklisted(const struct dt_device_node *node)
  {
      const struct dt_device_match *blacklist = NULL;
 
xen/arch/arm/platforms/exynos5.c +2 -2
index 2ae5fa66e0..01247cb6a5 100644
@@ -27,7 +27,7 @@
  #include <asm/platform.h>
  #include <asm/io.h>
 
-static bool_t secure_firmware;
+static bool secure_firmware;
 
  #define EXYNOS_ARM_CORE0_CONFIG     0x2000
  #define EXYNOS_ARM_CORE_CONFIG(_nr) (EXYNOS_ARM_CORE0_CONFIG + (0x80 * (_nr)))
@@ -108,7 +108,7 @@ static int __init exynos5_smp_init(void)
          /* Have to use sysram_ns_base_addr + 0x1c for boot address */
          compatible = "samsung,exynos4210-sysram-ns";
          sysram_offset = 0x1c;
-        secure_firmware = 1;
+        secure_firmware = true;
          printk("Running under secure firmware.\n");
      }
      else
xen/include/asm-arm/platform.h +2 -2
index 08010ba09b..2591d7bb03 100644
@@ -55,8 +55,8 @@ int platform_cpu_up(int cpu);
  #endif
  void platform_reset(void);
  void platform_poweroff(void);
-bool_t platform_has_quirk(uint32_t quirk);
-bool_t platform_device_is_blacklisted(const struct dt_device_node *node);
+bool platform_has_quirk(uint32_t quirk);
+bool platform_device_is_blacklisted(const struct dt_device_node *node);
 
  #define PLATFORM_START(_name, _namestr)                         \
  static const struct platform_desc  __plat_desc_##_name __used   \
Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
author
#14 lore raw

PATCH 6/12 arm/alternative.c: switch to plain bool

In reply to Wei Liu
---
 xen/arch/arm/alternative.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
xen/arch/arm/alternative.c +4 -4
index a3bcda3117..9ffdc475d6 100644
@@ -46,17 +46,17 @@ struct alt_region {
 /*
  * Check if the target PC is within an alternative block.
  */
-static bool_t branch_insn_requires_update(const struct alt_instr *alt,
-                                          unsigned long pc)
+static bool branch_insn_requires_update(const struct alt_instr *alt,
+                                        unsigned long pc)
 {
     unsigned long replptr;
 
     if ( is_active_kernel_text(pc) )
-        return 1;
+        return true;
 
     replptr = (unsigned long)ALT_REPL_PTR(alt);
     if ( pc >= replptr && pc <= (replptr + alt->alt_len) )
-        return 0;
+        return false;
 
     /*
      * Branching into *another* alternate sequence is doomed, and
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Reviewed-by on v1 6/12
#15 lore raw

Re: [PATCH 06/12] arm/alternative.c: switch to plain bool

Hi Wei,

Quoted 1 line · Wei Liu

Cheers,

Quoted 31 lines
---
  xen/arch/arm/alternative.c | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
xen/arch/arm/alternative.c +4 -4
index a3bcda3117..9ffdc475d6 100644
@@ -46,17 +46,17 @@ struct alt_region {
  /*
   * Check if the target PC is within an alternative block.
   */
-static bool_t branch_insn_requires_update(const struct alt_instr *alt,
-                                          unsigned long pc)
+static bool branch_insn_requires_update(const struct alt_instr *alt,
+                                        unsigned long pc)
  {
      unsigned long replptr;
 
      if ( is_active_kernel_text(pc) )
-        return 1;
+        return true;
 
      replptr = (unsigned long)ALT_REPL_PTR(alt);
      if ( pc >= replptr && pc <= (replptr + alt->alt_len) )
-        return 0;
+        return false;
 
      /*
       * Branching into *another* alternate sequence is doomed, and
Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
author
#16 lore raw

PATCH 7/12 arm/cpu{errata, feature}.[ch]: switch to plain bool

In reply to Wei Liu
---
 xen/arch/arm/cpuerrata.c         | 2 +-
 xen/include/asm-arm/cpuerrata.h  | 8 ++++----
 xen/include/asm-arm/cpufeature.h | 6 +++---
 3 files changed, 8 insertions(+), 8 deletions(-)
xen/arch/arm/cpuerrata.c +1 -1
index f89c0abe7e..fe9e9facbe 100644
@@ -7,7 +7,7 @@
     .midr_range_min = min,              \
     .midr_range_max = max
 
-static bool_t __maybe_unused
+static bool __maybe_unused
 is_affected_midr_range(const struct arm_cpu_capabilities *entry)
 {
     return MIDR_IS_CPU_MODEL_RANGE(boot_cpu_data.midr.bits, entry->midr_model,
xen/include/asm-arm/cpuerrata.h +4 -4
index 7b504418da..18a7d495d2 100644
@@ -9,13 +9,13 @@ void check_local_cpu_errata(void);
 #ifdef CONFIG_HAS_ALTERNATIVE
 
 #define CHECK_WORKAROUND_HELPER(erratum, feature, arch)         \
-static inline bool_t check_workaround_##erratum(void)           \
+static inline bool check_workaround_##erratum(void)             \
 {                                                               \
     if ( !IS_ENABLED(arch) )                                    \
         return 0;                                               \
     else                                                        \
     {                                                           \
-        bool_t ret;                                             \
+        bool ret;                                               \
                                                                 \
         asm volatile (ALTERNATIVE("mov %0, #0",                 \
                                   "mov %0, #1",                 \
@@ -29,10 +29,10 @@ static inline bool_t check_workaround_##erratum(void)           \
 #else /* CONFIG_HAS_ALTERNATIVE */
 
 #define CHECK_WORKAROUND_HELPER(erratum, feature, arch)         \
-static inline bool_t check_workaround_##erratum(void)           \
+static inline bool check_workaround_##erratum(void)             \
 {                                                               \
     if ( !IS_ENABLED(arch) )                                    \
-        return 0;                                               \
+        return false;                                           \
     else                                                        \
         return unlikely(cpus_have_cap(feature));                \
 }
xen/include/asm-arm/cpufeature.h +3 -3
index b3cf706332..f00b6dbd39 100644
@@ -53,10 +53,10 @@
 
 extern DECLARE_BITMAP(cpu_hwcaps, ARM_NCAPS);
 
-static inline bool_t cpus_have_cap(unsigned int num)
+static inline bool cpus_have_cap(unsigned int num)
 {
     if ( num >= ARM_NCAPS )
-        return 0;
+        return false;
 
     return test_bit(num, cpu_hwcaps);
 }
@@ -73,7 +73,7 @@ static inline void cpus_set_cap(unsigned int num)
 struct arm_cpu_capabilities {
     const char *desc;
     u16 capability;
-    bool_t (*matches)(const struct arm_cpu_capabilities *);
+    bool (*matches)(const struct arm_cpu_capabilities *);
     union {
         struct {    /* To be used for eratum handling only */
             u32 midr_model;
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Acked-by on v1 7/12
#17 lore raw

Re: [PATCH 07/12] arm/cpu{errata, feature}.[ch]: switch to plain bool

Hi Wei,

Quoted 25 lines · Wei Liu
---
  xen/arch/arm/cpuerrata.c         | 2 +-
  xen/include/asm-arm/cpuerrata.h  | 8 ++++----
  xen/include/asm-arm/cpufeature.h | 6 +++---
  3 files changed, 8 insertions(+), 8 deletions(-)
xen/arch/arm/cpuerrata.c +1 -1
index f89c0abe7e..fe9e9facbe 100644
@@ -7,7 +7,7 @@
      .midr_range_min = min,              \
      .midr_range_max = max
 
-static bool_t __maybe_unused
+static bool __maybe_unused
  is_affected_midr_range(const struct arm_cpu_capabilities *entry)
  {
      return MIDR_IS_CPU_MODEL_RANGE(boot_cpu_data.midr.bits, entry->midr_model,
xen/include/asm-arm/cpuerrata.h +0 -0
index 7b504418da..18a7d495d2 100644

xen/include/asm-arm/cpuerrata.h void check_local_cpu_errata(void); · line 15

Quoted 8 lines
xen/include/asm-arm/cpuerrata.h +1 -1
@@ -9,13 +9,13 @@ void check_local_cpu_errata(void);
  #ifdef CONFIG_HAS_ALTERNATIVE
 
  #define CHECK_WORKAROUND_HELPER(erratum, feature, arch)         \
-static inline bool_t check_workaround_##erratum(void)           \
+static inline bool check_workaround_##erratum(void)             \
  {                                                               \
      if ( !IS_ENABLED(arch) )                                    \
          return 0;                                               \

return false;

With that:

Cheers,

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
author
#18 lore raw

PATCH 8/12 arm/bootfdt.c: switch to plain bool

In reply to Wei Liu
---
 xen/arch/arm/bootfdt.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
xen/arch/arm/bootfdt.c +7 -7
index ea188a08b1..4a687e725d 100644
@@ -16,8 +16,8 @@
 #include <xsm/xsm.h>
 #include <asm/setup.h>
 
-static bool_t __init device_tree_node_matches(const void *fdt, int node,
-                                              const char *match)
+static bool __init device_tree_node_matches(const void *fdt, int node,
+                                            const char *match)
 {
     const char *name;
     size_t match_len;
@@ -31,8 +31,8 @@ static bool_t __init device_tree_node_matches(const void *fdt, int node,
         && (name[match_len] == '@' || name[match_len] == '\0');
 }
 
-static bool_t __init device_tree_node_compatible(const void *fdt, int node,
-                                                 const char *match)
+static bool __init device_tree_node_compatible(const void *fdt, int node,
+                                               const char *match)
 {
     int len, l;
     int mlen;
@@ -42,17 +42,17 @@ static bool_t __init device_tree_node_compatible(const void *fdt, int node,
 
     prop = fdt_getprop(fdt, node, "compatible", &len);
     if ( prop == NULL )
-        return 0;
+        return false;
 
     while ( len > 0 ) {
         if ( !dt_compat_cmp(prop, match) )
-            return 1;
+            return true;
         l = strlen(prop) + 1;
         prop += l;
         len -= l;
     }
 
-    return 0;
+    return false;
 }
 
 static void __init device_tree_get_reg(const __be32 **cell, u32 address_cells,
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Reviewed-by on v1 8/12
#19 lore raw

Re: [PATCH 08/12] arm/bootfdt.c: switch to plain bool

Hi Wei,

Quoted 1 line · Wei Liu

Cheers,

Quoted 52 lines
---
  xen/arch/arm/bootfdt.c | 14 +++++++-------
  1 file changed, 7 insertions(+), 7 deletions(-)
xen/arch/arm/bootfdt.c +7 -7
index ea188a08b1..4a687e725d 100644
@@ -16,8 +16,8 @@
  #include <xsm/xsm.h>
  #include <asm/setup.h>
 
-static bool_t __init device_tree_node_matches(const void *fdt, int node,
-                                              const char *match)
+static bool __init device_tree_node_matches(const void *fdt, int node,
+                                            const char *match)
  {
      const char *name;
      size_t match_len;
@@ -31,8 +31,8 @@ static bool_t __init device_tree_node_matches(const void *fdt, int node,
          && (name[match_len] == '@' || name[match_len] == '\0');
  }
 
-static bool_t __init device_tree_node_compatible(const void *fdt, int node,
-                                                 const char *match)
+static bool __init device_tree_node_compatible(const void *fdt, int node,
+                                               const char *match)
  {
      int len, l;
      int mlen;
@@ -42,17 +42,17 @@ static bool_t __init device_tree_node_compatible(const void *fdt, int node,
 
      prop = fdt_getprop(fdt, node, "compatible", &len);
      if ( prop == NULL )
-        return 0;
+        return false;
 
      while ( len > 0 ) {
          if ( !dt_compat_cmp(prop, match) )
-            return 1;
+            return true;
          l = strlen(prop) + 1;
          prop += l;
          len -= l;
      }
 
-    return 0;
+    return false;
  }
 
  static void __init device_tree_get_reg(const __be32 **cell, u32 address_cells,
Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
author
#20 lore raw

PATCH 9/12 arm/decode.c: switch to plain bool

In reply to Wei Liu
---
 xen/arch/arm/decode.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
xen/arch/arm/decode.c +3 -3
index 514b7a21a5..795d126f02 100644
@@ -26,7 +26,7 @@
 #include "decode.h"
 
 static void update_dabt(struct hsr_dabt *dabt, int reg,
-                        uint8_t size, bool_t sign)
+                        uint8_t size, bool sign)
 {
     dabt->reg = reg;
     dabt->size = size;
@@ -47,8 +47,8 @@ static int decode_thumb2(register_t pc, struct hsr_dabt *dabt, uint16_t hw1)
     {
     case 12:
     {
-        bool_t sign = !!(hw1 & (1 << 8));
-        bool_t load = !!(hw1 & (1 << 4));
+        bool sign = (hw1 & (1u << 8));
+        bool load = (hw1 & (1u << 4));
 
         if ( (hw1 & 0x0110) == 0x0100 )
             /* NEON instruction */
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Reviewed-by on v1 9/12
#21 lore raw

Re: [PATCH 09/12] arm/decode.c: switch to plain bool

Hi Wei,

Quoted 10 lines · Wei Liu
---
  xen/arch/arm/decode.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
xen/arch/arm/decode.c +0 -0
index 514b7a21a5..795d126f02 100644

xen/arch/arm/decode.c line 29

Quoted 5 lines
xen/arch/arm/decode.c +1 -1
@@ -26,7 +26,7 @@
  #include "decode.h"
 
  static void update_dabt(struct hsr_dabt *dabt, int reg,
-                        uint8_t size, bool_t sign)
+                        uint8_t size, bool sign)

You probably want to switch from 0 to false all the callers of update_dabt.

Regardless that:

Cheers,

Quoted 15 lines
xen/arch/arm/decode.c +2 -2
  {
      dabt->reg = reg;
      dabt->size = size;
@@ -47,8 +47,8 @@ static int decode_thumb2(register_t pc, struct hsr_dabt *dabt, uint16_t hw1)
      {
      case 12:
      {
-        bool_t sign = !!(hw1 & (1 << 8));
-        bool_t load = !!(hw1 & (1 << 4));
+        bool sign = (hw1 & (1u << 8));
+        bool load = (hw1 & (1u << 4));
 
          if ( (hw1 & 0x0110) == 0x0100 )
              /* NEON instruction */
Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
author
#22 lore raw

Re: [PATCH 09/12] arm/decode.c: switch to plain bool

Quoted 8 lines · Julien Grall

Hi Wei,

Quoted 5 lines · Wei Liu
---
  xen/arch/arm/decode.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
Quoted 12 lines

xen/arch/arm/decode.c line 28

Quoted 9 lines
xen/arch/arm/decode.c +1 -1
index 514b7a21a5..795d126f02 100644
@@ -26,7 +26,7 @@
  #include "decode.h"
  static void update_dabt(struct hsr_dabt *dabt, int reg,
-                        uint8_t size, bool_t sign)
+                        uint8_t size, bool sign)

You probably want to switch from 0 to false all the callers of update_dabt.

The following diff will be folded in.

xen/arch/arm/decode.c +0 -0
index 795d126f02..8b1e15d118 100644
@@ -101,16 +101,16 @@ static int decode_thumb(register_t pc, struct

hsr_dabt *dabt)

         switch ( opB & 0x3 )
         {
         case 0: /* Non-signed word */

- update_dabt(dabt, reg, 2, 0);
+ update_dabt(dabt, reg, 2, false);
break;
case 1: /* Non-signed halfword */
- update_dabt(dabt, reg, 1, 0);
+ update_dabt(dabt, reg, 1, false);
break;
case 2: /* Non-signed byte */
- update_dabt(dabt, reg, 0, 0);
+ update_dabt(dabt, reg, 0, false);
break;
case 3: /* Signed byte */
- update_dabt(dabt, reg, 0, 1);

+            update_dabt(dabt, reg, 0, true);
             break;
         }

@@ -118,19 +118,19 @@ static int decode_thumb(register_t pc, struct hsr_dabt *dabt)

     }
     case 6:
         /* Load/Store word immediate offset */
-        update_dabt(dabt, instr & 7, 2, 0);
+        update_dabt(dabt, instr & 7, 2, false);
         break;
     case 7:
         /* Load/Store byte immediate offset */
-        update_dabt(dabt, instr & 7, 0, 0);
+        update_dabt(dabt, instr & 7, 0, false);
         break;
     case 8:
         /* Load/Store halfword immediate offset */
-        update_dabt(dabt, instr & 7, 1, 0);
+        update_dabt(dabt, instr & 7, 1, false);
         break;
     case 9:
         /* Load/Store word sp offset */

- update_dabt(dabt, (instr >> 8) & 7, 2, 0);
+ update_dabt(dabt, (instr >> 8) & 7, 2, false);

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#23 lore raw

Re: [PATCH 09/12] arm/decode.c: switch to plain bool

Quoted 22 lines · Wei Liu
Quoted 8 lines · Julien Grall

Hi Wei,

Quoted 5 lines · Wei Liu
---
   xen/arch/arm/decode.c | 6 +++---
   1 file changed, 3 insertions(+), 3 deletions(-)
Quoted 12 lines

xen/arch/arm/decode.c line 28

Quoted 9 lines
xen/arch/arm/decode.c +1 -1
index 514b7a21a5..795d126f02 100644
@@ -26,7 +26,7 @@
   #include "decode.h"
   static void update_dabt(struct hsr_dabt *dabt, int reg,
-                        uint8_t size, bool_t sign)
+                        uint8_t size, bool sign)

You probably want to switch from 0 to false all the callers of update_dabt.

Quoted 1 line

The following diff will be folded in.

Looks good to me.

Cheers,

Quoted 50 lines
xen/arch/arm/decode.c +8 -8
index 795d126f02..8b1e15d118 100644
@@ -101,16 +101,16 @@ static int decode_thumb(register_t pc, struct
 hsr_dabt *dabt)
          switch ( opB & 0x3 )
          {
          case 0: /* Non-signed word */
-            update_dabt(dabt, reg, 2, 0);
+            update_dabt(dabt, reg, 2, false);
              break;
          case 1: /* Non-signed halfword */
-            update_dabt(dabt, reg, 1, 0);
+            update_dabt(dabt, reg, 1, false);
              break;
          case 2: /* Non-signed byte */
-            update_dabt(dabt, reg, 0, 0);
+            update_dabt(dabt, reg, 0, false);
              break;
          case 3: /* Signed byte */
-            update_dabt(dabt, reg, 0, 1);
+            update_dabt(dabt, reg, 0, true);
              break;
          }
@@ -118,19 +118,19 @@ static int decode_thumb(register_t pc, struct
 hsr_dabt *dabt)
      }
      case 6:
          /* Load/Store word immediate offset */
-        update_dabt(dabt, instr & 7, 2, 0);
+        update_dabt(dabt, instr & 7, 2, false);
          break;
      case 7:
          /* Load/Store byte immediate offset */
-        update_dabt(dabt, instr & 7, 0, 0);
+        update_dabt(dabt, instr & 7, 0, false);
          break;
      case 8:
          /* Load/Store halfword immediate offset */
-        update_dabt(dabt, instr & 7, 1, 0);
+        update_dabt(dabt, instr & 7, 1, false);
          break;
      case 9:
          /* Load/Store word sp offset */
-        update_dabt(dabt, (instr >> 8) & 7, 2, 0);
+        update_dabt(dabt, (instr >> 8) & 7, 2, false);
 
Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
author
#24 lore raw

PATCH 10/12 arm/smpboot.c: switch to plain bool

In reply to Wei Liu
---
 xen/arch/arm/smpboot.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
xen/arch/arm/smpboot.c +5 -5
index 32e87221c0..1255185a9c 100644
@@ -59,7 +59,7 @@ struct init_info __initdata init_data =
 /* Shared state for coordinating CPU bringup */
 unsigned long smp_up_cpu = MPIDR_INVALID;
 /* Shared state for coordinating CPU teardown */
-static bool_t cpu_is_dead = 0;
+static bool cpu_is_dead;
 
 /* ID of the PCPU we're running on */
 DEFINE_PER_CPU(unsigned int, cpu_id);
@@ -105,7 +105,7 @@ static void __init dt_smp_init_cpus(void)
     {
         [0 ... NR_CPUS - 1] = MPIDR_INVALID
     };
-    bool_t bootcpu_valid = 0;
+    bool bootcpu_valid = false;
     int rc;
 
     mpidr = boot_cpu_data.mpidr.bits & MPIDR_HWID_MASK;
@@ -197,7 +197,7 @@ static void __init dt_smp_init_cpus(void)
         if ( hwid == mpidr )
         {
             i = 0;
-            bootcpu_valid = 1;
+            bootcpu_valid = true;
         }
         else
             i = cpuidx++;
@@ -352,7 +352,7 @@ void __cpu_disable(void)
 void stop_cpu(void)
 {
     local_irq_disable();
-    cpu_is_dead = 1;
+    cpu_is_dead = true;
     /* Make sure the write happens before we sleep forever */
     dsb(sy);
     isb();
@@ -454,7 +454,7 @@ void __cpu_die(unsigned int cpu)
             printk(KERN_ERR "CPU %u still not dead...\n", cpu);
         smp_mb();
     }
-    cpu_is_dead = 0;
+    cpu_is_dead = false;
     smp_mb();
 }
 
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Reviewed-by on v1 10/12
#25 lore raw

Re: [PATCH 10/12] arm/smpboot.c: switch to plain bool

Hi Wei,

Quoted 1 line · Wei Liu
Quoted 54 lines
---
  xen/arch/arm/smpboot.c | 10 +++++-----
  1 file changed, 5 insertions(+), 5 deletions(-)
xen/arch/arm/smpboot.c +5 -5
index 32e87221c0..1255185a9c 100644
@@ -59,7 +59,7 @@ struct init_info __initdata init_data =
  /* Shared state for coordinating CPU bringup */
  unsigned long smp_up_cpu = MPIDR_INVALID;
  /* Shared state for coordinating CPU teardown */
-static bool_t cpu_is_dead = 0;
+static bool cpu_is_dead;
 
  /* ID of the PCPU we're running on */
  DEFINE_PER_CPU(unsigned int, cpu_id);
@@ -105,7 +105,7 @@ static void __init dt_smp_init_cpus(void)
      {
          [0 ... NR_CPUS - 1] = MPIDR_INVALID
      };
-    bool_t bootcpu_valid = 0;
+    bool bootcpu_valid = false;
      int rc;
 
      mpidr = boot_cpu_data.mpidr.bits & MPIDR_HWID_MASK;
@@ -197,7 +197,7 @@ static void __init dt_smp_init_cpus(void)
          if ( hwid == mpidr )
          {
              i = 0;
-            bootcpu_valid = 1;
+            bootcpu_valid = true;
          }
          else
              i = cpuidx++;
@@ -352,7 +352,7 @@ void __cpu_disable(void)
  void stop_cpu(void)
  {
      local_irq_disable();
-    cpu_is_dead = 1;
+    cpu_is_dead = true;
      /* Make sure the write happens before we sleep forever */
      dsb(sy);
      isb();
@@ -454,7 +454,7 @@ void __cpu_die(unsigned int cpu)
              printk(KERN_ERR "CPU %u still not dead...\n", cpu);
          smp_mb();
      }
-    cpu_is_dead = 0;
+    cpu_is_dead = false;
      smp_mb();
  }
 
Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
author
#26 lore raw

PATCH 11/12 arm/vtimer.c: switch to plain bool

In reply to Wei Liu
---
 xen/arch/arm/vtimer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/arm/vtimer.c +1 -1
index 0460962f08..3f84893a74 100644
@@ -100,7 +100,7 @@ int domain_vtimer_init(struct domain *d, struct xen_arch_domainconfig *config)
 int vcpu_vtimer_init(struct vcpu *v)
 {
     struct vtimer *t = &v->arch.phys_timer;
-    bool_t d0 = is_hardware_domain(v->domain);
+    bool d0 = is_hardware_domain(v->domain);
 
     /*
      * Hardware domain uses the hardware interrupts, guests get the virtual
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Reviewed-by on v1 11/12
#27 lore raw

Re: [PATCH 11/12] arm/vtimer.c: switch to plain bool

Hi Wei,

Quoted 1 line · Wei Liu

Cheers,

Quoted 18 lines
---
  xen/arch/arm/vtimer.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/arm/vtimer.c +1 -1
index 0460962f08..3f84893a74 100644
@@ -100,7 +100,7 @@ int domain_vtimer_init(struct domain *d, struct xen_arch_domainconfig *config)
  int vcpu_vtimer_init(struct vcpu *v)
  {
      struct vtimer *t = &v->arch.phys_timer;
-    bool_t d0 = is_hardware_domain(v->domain);
+    bool d0 = is_hardware_domain(v->domain);
 
      /*
       * Hardware domain uses the hardware interrupts, guests get the virtual
Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
author
#28 lore raw

PATCH 12/12 arm: use plain bool in various headers

In reply to Wei Liu
---
 xen/include/asm-arm/altp2m.h       | 4 ++--
 xen/include/asm-arm/arm64/insn.h   | 2 +-
 xen/include/asm-arm/domain.h       | 2 +-
 xen/include/asm-arm/guest_access.h | 2 +-
 xen/include/asm-arm/p2m.h          | 8 ++++----
 5 files changed, 9 insertions(+), 9 deletions(-)
xen/include/asm-arm/altp2m.h +2 -2
index a87747a291..df50cb2f09 100644
@@ -22,10 +22,10 @@
 #include <xen/sched.h>
 
 /* Alternate p2m on/off per domain */
-static inline bool_t altp2m_active(const struct domain *d)
+static inline bool altp2m_active(const struct domain *d)
 {
     /* Not implemented on ARM. */
-    return 0;
+    return false;
 }
 
 /* Alternate p2m VCPU */
xen/include/asm-arm/arm64/insn.h +1 -1
index 2ec4ad7c7f..4e0d364d41 100644
@@ -55,7 +55,7 @@ enum aarch64_insn_branch_type {
 };
 
 #define	__AARCH64_INSN_FUNCS(abbr, mask, val)	\
-static always_inline bool_t aarch64_insn_is_##abbr(u32 code) \
+static always_inline bool aarch64_insn_is_##abbr(u32 code) \
 { return (code & (mask)) == (val); } \
 static always_inline u32 aarch64_insn_get_##abbr##_value(void) \
 { return (val); }
xen/include/asm-arm/domain.h +1 -1
index 8dfc1d1ec2..b174c65080 100644
@@ -280,7 +280,7 @@ struct arch_vcpu
 
     struct vtimer phys_timer;
     struct vtimer virt_timer;
-    bool_t vtimer_initialized;
+    bool   vtimer_initialized;
 }  __cacheline_aligned;
 
 void vcpu_show_execution_state(struct vcpu *);
xen/include/asm-arm/guest_access.h +1 -1
index cc73ce820f..6796801cfe 100644
@@ -12,7 +12,7 @@ unsigned long raw_copy_from_guest(void *to, const void *from, unsigned len);
 unsigned long raw_clear_guest(void *to, unsigned len);
 
 int access_guest_memory_by_ipa(struct domain *d, paddr_t ipa, void *buf,
-                               uint32_t size, bool_t is_write);
+                               uint32_t size, bool is_write);
 
 #define __raw_copy_to_guest raw_copy_to_guest
 #define __raw_copy_from_guest raw_copy_from_guest
xen/include/asm-arm/p2m.h +4 -4
index aa0d60ae3a..bc5bbf0db7 100644
@@ -82,10 +82,10 @@ struct p2m_domain {
      * If true, and an access fault comes in and there is no vm_event listener,
      * pause domain. Otherwise, remove access restrictions.
      */
-    bool_t access_required;
+    bool access_required;
 
     /* Defines if mem_access is in use for the domain. */
-    bool_t mem_access_enabled;
+    bool mem_access_enabled;
 
     /*
      * Default P2M access type for each page in the the domain: new pages,
@@ -338,9 +338,9 @@ static inline int get_page_and_type(struct page_info *page,
 /* get host p2m table */
 #define p2m_get_hostp2m(d) (&(d)->arch.p2m)
 
-static inline bool_t p2m_vm_event_sanity_check(struct domain *d)
+static inline bool p2m_vm_event_sanity_check(struct domain *d)
 {
-    return 1;
+    return true;
 }
 
 /*
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Acked-by on v1 12/12
#29 lore raw

Re: [PATCH 12/12] arm: use plain bool in various headers

Hi Wei,

Quoted 31 lines · Wei Liu
---
  xen/include/asm-arm/altp2m.h       | 4 ++--
  xen/include/asm-arm/arm64/insn.h   | 2 +-
  xen/include/asm-arm/domain.h       | 2 +-
  xen/include/asm-arm/guest_access.h | 2 +-
  xen/include/asm-arm/p2m.h          | 8 ++++----
  5 files changed, 9 insertions(+), 9 deletions(-)
xen/include/asm-arm/altp2m.h +2 -2
index a87747a291..df50cb2f09 100644
@@ -22,10 +22,10 @@
  #include <xen/sched.h>
 
  /* Alternate p2m on/off per domain */
-static inline bool_t altp2m_active(const struct domain *d)
+static inline bool altp2m_active(const struct domain *d)
  {
      /* Not implemented on ARM. */
-    return 0;
+    return false;
  }
 
  /* Alternate p2m VCPU */
xen/include/asm-arm/arm64/insn.h +0 -0
index 2ec4ad7c7f..4e0d364d41 100644

xen/include/asm-arm/arm64/insn.h enum aarch64_insn_branch_type { · line 58

Quoted 5 lines
xen/include/asm-arm/arm64/insn.h +1 -1
@@ -55,7 +55,7 @@ enum aarch64_insn_branch_type {
  };
 
  #define	__AARCH64_INSN_FUNCS(abbr, mask, val)	\
-static always_inline bool_t aarch64_insn_is_##abbr(u32 code) \
+static always_inline bool aarch64_insn_is_##abbr(u32 code) \

Hmmm, I am not sure why this was turned to a bool_t at first the hand. This file was supposed to be a copy of the Linux version.

Cheers,

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel