xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Sergej Proskurin <proskurin@sec.in.tum.de>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wei.liu2@citrix.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Sergej Proskurin <proskurin@sec.in.tum.de>,
	Ian Jackson <ian.jackson@eu.citrix.com>, Tim Deegan <tim@xen.org>,
	Julien Grall <julien.grall@arm.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [PATCH v6 08/14] arm/mem_access: Introduce GENMASK_ULL bit operation
Date: Thu,  6 Jul 2017 13:50:11 +0200	[thread overview]
Message-ID: <20170706115017.23072-9-proskurin@sec.in.tum.de> (raw)
In-Reply-To: <20170706115017.23072-1-proskurin@sec.in.tum.de>

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. Please note that the
GENMASK_ULL implementation has been lifted from the linux kernel source
code.

Signed-off-by: Sergej Proskurin <proskurin@sec.in.tum.de>
---
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Julien Grall <julien.grall@arm.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Tim Deegan <tim@xen.org>
Cc: Wei Liu <wei.liu2@citrix.com>
---
v6: As similar patches have been already submitted and NACKED in the
    past, we resubmit this patch with 'THE REST' maintainers in Cc to
    discuss whether this patch shall be applied into common or put into
    ARM related code.
---
 xen/include/asm-arm/config.h | 2 ++
 xen/include/xen/bitops.h     | 5 ++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

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..3d85164bba 100644
--- a/xen/include/xen/bitops.h
+++ b/xen/include/xen/bitops.h
@@ -10,6 +10,9 @@
 #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
  * the libc and compiler builtin ffs routines, therefore
@@ -128,7 +131,7 @@ static inline int generic_fls64(__u64 x)
 static __inline__ int get_bitmask_order(unsigned int count)
 {
     int order;
-    
+
     order = fls(count);
     return order;   /* We could be slightly more clever with -1 here... */
 }
-- 
2.13.2


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

  parent reply	other threads:[~2017-07-06 11:50 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-06 11:50 [PATCH v6 00/14] arm/mem_access: Walk guest page tables in SW if mem_access is active Sergej Proskurin
2017-07-06 11:50 ` [PATCH v6 01/14] arm/mem_access: Add and cleanup (TCR_|TTBCR_)* defines Sergej Proskurin
2017-07-06 11:50 ` [PATCH v6 02/14] arm/mem_access: Move PAGE_*_* macros to xen/page-defs.h Sergej Proskurin
2017-07-06 12:10   ` Jan Beulich
2017-07-06 14:53     ` Sergej Proskurin
2017-07-06 15:24       ` Jan Beulich
2017-07-06 15:34         ` Sergej Proskurin
2017-07-06 16:20           ` Jan Beulich
2017-07-07  8:27             ` Sergej Proskurin
2017-07-06 11:50 ` [PATCH v6 03/14] arm/mem_access: Add defines supporting PTs with varying page sizes Sergej Proskurin
2017-07-17 14:12   ` Julien Grall
2017-07-06 11:50 ` [PATCH v6 04/14] arm/lpae: Introduce lpae_is_page helper Sergej Proskurin
2017-07-06 11:50 ` [PATCH v6 05/14] arm/mem_access: Add short-descriptor pte typedefs and macros Sergej Proskurin
2017-07-06 11:50 ` [PATCH v6 06/14] arm/mem_access: Introduce GV2M_EXEC permission Sergej Proskurin
2017-07-06 11:50 ` [PATCH v6 07/14] arm/mem_access: Introduce BIT_ULL bit operation Sergej Proskurin
2017-07-06 11:50 ` Sergej Proskurin [this message]
2017-07-06 12:18   ` [PATCH v6 08/14] arm/mem_access: Introduce GENMASK_ULL " Jan Beulich
2017-07-06 14:38     ` Sergej Proskurin
2017-07-06 15:22       ` Jan Beulich
2017-07-06 15:34         ` Sergej Proskurin
2017-07-06 11:50 ` [PATCH v6 09/14] arm/guest_access: Move vgic_access_guest_memory to guest_access.h Sergej Proskurin
2017-07-17 15:38   ` Julien Grall
2017-07-18  9:49     ` Sergej Proskurin
2017-07-18 10:43       ` Julien Grall
2017-07-18 11:59         ` Sergej Proskurin
2017-07-18 12:12           ` Julien Grall
2017-07-18 12:20             ` Sergej Proskurin
2017-07-06 11:50 ` [PATCH v6 10/14] arm/guest_access: Rename vgic_access_guest_memory Sergej Proskurin
2017-07-17 15:43   ` Julien Grall
2017-07-18  8:42     ` Sergej Proskurin
2017-07-18 10:28       ` Julien Grall
2017-07-06 11:50 ` [PATCH v6 11/14] arm/mem_access: Add software guest-page-table walk Sergej Proskurin
2017-07-17 15:47   ` Julien Grall
2017-07-06 11:50 ` [PATCH v6 12/14] arm/mem_access: Add long-descriptor based gpt Sergej Proskurin
2017-07-17 16:18   ` Julien Grall
2017-07-06 11:50 ` [PATCH v6 13/14] arm/mem_access: Add short-descriptor " Sergej Proskurin
2017-07-17 16:26   ` Julien Grall
2017-07-06 11:50 ` [PATCH v6 14/14] arm/mem_access: Walk the guest's pt in software Sergej Proskurin

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=20170706115017.23072-9-proskurin@sec.in.tum.de \
    --to=proskurin@sec.in.tum.de \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien.grall@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).