As there, update and compact parameter names to later match the driver
ones.

Signed-off-by: Andrea Bastoni <[email protected]>
---
 hypervisor/arch/arm64/coloring.c | 19 ++++++++++---------
 include/jailhouse/cell-config.h  |  2 +-
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/hypervisor/arch/arm64/coloring.c b/hypervisor/arch/arm64/coloring.c
index 123e191b..ff3b5a78 100644
--- a/hypervisor/arch/arm64/coloring.c
+++ b/hypervisor/arch/arm64/coloring.c
@@ -115,7 +115,7 @@ static int dispatch_op(struct cell *cell, struct 
jailhouse_memory *mr,
  *  The function assumes bitmask is not 0.
  */
 static inline void get_bit_range(
-       size_t *bitmask,
+       u64 *bitmask,
        unsigned int *low,
        unsigned int *size)
 {
@@ -137,16 +137,17 @@ int color_cell_op(struct cell *cell,
                  const struct jailhouse_memory *col_mem,
                  unsigned int op, unsigned int flags)
 {
-       size_t colors;
        u64 phys_start = col_mem->phys_start;
        u64 virt_start = col_mem->virt_start;
        struct jailhouse_memory mr;
-       unsigned int start, low, size;
+       /* bit: start, low, contiguous bit range width */
+       unsigned int bs, bl, bw;
        unsigned int n;
+       u64 colors;
        int err = -EINVAL;
 
        col_print("OP 0x%x: PHYS 0x%08llx -> VIRT 0x%08llx "
-                       "(C: 0x%08lx, F: 0x%x)\n",
+                       "(C: 0x%08llx, F: 0x%x)\n",
                        op, col_mem->phys_start,
                        col_mem->virt_start,
                        col_mem->colors, flags);
@@ -154,15 +155,15 @@ int color_cell_op(struct cell *cell,
        n = 0;
        mr.flags = col_mem->flags;
        while (virt_start < col_mem->virt_start + col_mem->size) {
-               start = low = size = 0;
+               bs = bl = bw = 0;
                colors = col_mem->colors;
 
                while (colors != 0) {
                        /* update colors with next color-range */
-                       get_bit_range(&colors, &low, &size);
-                       start += low;
-                       mr.size = size * PAGE_SIZE;
-                       mr.phys_start = phys_start + (start * PAGE_SIZE) +
+                       get_bit_range(&colors, &bl, &bw);
+                       bs += bl;
+                       mr.size = bw * PAGE_SIZE;
+                       mr.phys_start = phys_start + (bs * PAGE_SIZE) +
                                        (n * coloring_way_size);
                        mr.virt_start = virt_start;
                        /* update next round */
diff --git a/include/jailhouse/cell-config.h b/include/jailhouse/cell-config.h
index 8934a1f2..af5b5098 100644
--- a/include/jailhouse/cell-config.h
+++ b/include/jailhouse/cell-config.h
@@ -129,7 +129,7 @@ struct jailhouse_memory {
        __u64 size;
        __u64 flags;
        /* only meaningful with JAILHOUSE_MEM_COLORED */
-       size_t colors;
+       __u64 colors;
 } __attribute__((packed));
 
 struct jailhouse_coloring {
-- 
2.29.2

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/20210125120044.56794-18-andrea.bastoni%40tum.de.

Reply via email to