[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v5 08/12] arm/mem_access: Introduce GENMASK_ULL bit operation



Hi Sergej,

On 06/27/2017 12:52 PM, Sergej Proskurin wrote:
The current implementation of GENMASK is capable of creating bitmasks of
32-bit values on AArch32 and 64-bit values on AArch64. As we need to
create masks for 64-bit values on AArch32 as well, in this commit we
introduce the GENMASK_ULL bit operation.

Signed-off-by: Sergej Proskurin <proskurin@xxxxxxxxxxxxx> > ---
Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>
Cc: Julien Grall <julien.grall@xxxxxxx>
---
  xen/include/asm-arm/config.h | 2 ++ >   xen/include/xen/bitops.h     | 2 ++

This is common code and the relevant maintainers should have been CCed.

This is not the first time we are trying to introduce GENMASK_ULL. I would recommend you to read the following discussion:

https://patchwork.kernel.org/patch/9665869/

Cheers,

  2 files changed, 4 insertions(+)

diff --git a/xen/include/asm-arm/config.h b/xen/include/asm-arm/config.h
index 5b6f3c985d..7fa412f1b1 100644
--- a/xen/include/asm-arm/config.h
+++ b/xen/include/asm-arm/config.h
@@ -19,6 +19,8 @@
  #define BITS_PER_LONG (BYTES_PER_LONG << 3)
  #define POINTER_ALIGN BYTES_PER_LONG
+#define BITS_PER_LONG_LONG 64
+
  /* xen_ulong_t is always 64 bits */
  #define BITS_PER_XEN_ULONG 64
diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h
index bd0883ab22..47170c9bfd 100644
--- a/xen/include/xen/bitops.h
+++ b/xen/include/xen/bitops.h
@@ -9,6 +9,8 @@
   */
  #define GENMASK(h, l) \
      (((~0UL) << (l)) & (~0UL >> (BITS_PER_LONG - 1 - (h))))
+#define GENMASK_ULL(h, l) \
+    (((~0ULL) << (l)) & (~0ULL >> (BITS_PER_LONG_LONG - 1 - (h))))
/*
   * ffs: find first bit set. This is defined the same way as


--
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.