diff mbox series

[1/2] x86/hyperv: drop usage of GENMASK_ULL from hyperv-tlfs.h

Message ID 20200107173902.13768-2-liuwe@microsoft.com (mailing list archive)
State New, archived
Headers show
Series Misc Hyper-V TLFS fixes | expand

Commit Message

Wei Liu Jan. 7, 2020, 5:39 p.m. UTC
I'm told that GENMASK_ULL shouldn't be used outside of Arm code in its
current form.

Requested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Wei Liu <liuwe@microsoft.com>
---
 xen/include/asm-x86/guest/hyperv-tlfs.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Jan Beulich Jan. 8, 2020, 12:26 p.m. UTC | #1
On 07.01.2020 18:39, Wei Liu wrote:
> --- a/xen/include/asm-x86/guest/hyperv-tlfs.h
> +++ b/xen/include/asm-x86/guest/hyperv-tlfs.h
> @@ -415,13 +415,13 @@ enum HV_GENERIC_SET_FORMAT {
>  	HV_GENERIC_SET_ALL,
>  };
>  
> -#define HV_HYPERCALL_RESULT_MASK	GENMASK_ULL(15, 0)
> +#define HV_HYPERCALL_RESULT_MASK	0xffff /* GENMASK_ULL(15, 0) */
>  #define HV_HYPERCALL_FAST_BIT		BIT(16, UL)
>  #define HV_HYPERCALL_VARHEAD_OFFSET	17
>  #define HV_HYPERCALL_REP_COMP_OFFSET	32
> -#define HV_HYPERCALL_REP_COMP_MASK	GENMASK_ULL(43, 32)
> +#define HV_HYPERCALL_REP_COMP_MASK	0xfff00000000 /* GENMASK_ULL(43, 32) */
>  #define HV_HYPERCALL_REP_START_OFFSET	48
> -#define HV_HYPERCALL_REP_START_MASK	GENMASK_ULL(59, 48)
> +#define HV_HYPERCALL_REP_START_MASK	0xfff000000000000 /* GENMASK_ULL(59, 48) */

The last two should gain ULL (or at least UL) suffixes. I also
wonder whether both wouldn't better be expressed as (0xfffULL << N).
With at least the suffixes added
Acked-by: Jan Beulich <jbeulich@suse.com>

Jan
Wei Liu Jan. 8, 2020, 12:31 p.m. UTC | #2
On Wed, Jan 08, 2020 at 01:26:20PM +0100, Jan Beulich wrote:
> On 07.01.2020 18:39, Wei Liu wrote:
> > --- a/xen/include/asm-x86/guest/hyperv-tlfs.h
> > +++ b/xen/include/asm-x86/guest/hyperv-tlfs.h
> > @@ -415,13 +415,13 @@ enum HV_GENERIC_SET_FORMAT {
> >  	HV_GENERIC_SET_ALL,
> >  };
> >  
> > -#define HV_HYPERCALL_RESULT_MASK	GENMASK_ULL(15, 0)
> > +#define HV_HYPERCALL_RESULT_MASK	0xffff /* GENMASK_ULL(15, 0) */
> >  #define HV_HYPERCALL_FAST_BIT		BIT(16, UL)
> >  #define HV_HYPERCALL_VARHEAD_OFFSET	17
> >  #define HV_HYPERCALL_REP_COMP_OFFSET	32
> > -#define HV_HYPERCALL_REP_COMP_MASK	GENMASK_ULL(43, 32)
> > +#define HV_HYPERCALL_REP_COMP_MASK	0xfff00000000 /* GENMASK_ULL(43, 32) */
> >  #define HV_HYPERCALL_REP_START_OFFSET	48
> > -#define HV_HYPERCALL_REP_START_MASK	GENMASK_ULL(59, 48)
> > +#define HV_HYPERCALL_REP_START_MASK	0xfff000000000000 /* GENMASK_ULL(59, 48) */
> 
> The last two should gain ULL (or at least UL) suffixes. I also
> wonder whether both wouldn't better be expressed as (0xfffULL << N).
> With at least the suffixes added

Thanks. I will fix those up.

Using (0xffffULL << N) works for me too. Let's see what form Paul
prefers.

Wei.

> Acked-by: Jan Beulich <jbeulich@suse.com>
> 
> Jan
diff mbox series

Patch

diff --git a/xen/include/asm-x86/guest/hyperv-tlfs.h b/xen/include/asm-x86/guest/hyperv-tlfs.h
index 5b43f99de8..e4183c802c 100644
--- a/xen/include/asm-x86/guest/hyperv-tlfs.h
+++ b/xen/include/asm-x86/guest/hyperv-tlfs.h
@@ -415,13 +415,13 @@  enum HV_GENERIC_SET_FORMAT {
 	HV_GENERIC_SET_ALL,
 };
 
-#define HV_HYPERCALL_RESULT_MASK	GENMASK_ULL(15, 0)
+#define HV_HYPERCALL_RESULT_MASK	0xffff /* GENMASK_ULL(15, 0) */
 #define HV_HYPERCALL_FAST_BIT		BIT(16, UL)
 #define HV_HYPERCALL_VARHEAD_OFFSET	17
 #define HV_HYPERCALL_REP_COMP_OFFSET	32
-#define HV_HYPERCALL_REP_COMP_MASK	GENMASK_ULL(43, 32)
+#define HV_HYPERCALL_REP_COMP_MASK	0xfff00000000 /* GENMASK_ULL(43, 32) */
 #define HV_HYPERCALL_REP_START_OFFSET	48
-#define HV_HYPERCALL_REP_START_MASK	GENMASK_ULL(59, 48)
+#define HV_HYPERCALL_REP_START_MASK	0xfff000000000000 /* GENMASK_ULL(59, 48) */
 
 /* hypercall status code */
 #define HV_STATUS_SUCCESS			0