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

Re: [Xen-devel] [PATCH 2/2] x86/HPET: adjustments to constants and their use



On Tue, Jul 17, 2018 at 02:35:40AM -0600, Jan Beulich wrote:
> Drop HPET_TN_ROUTE_SHIFT as redundant with HPET_TN_ROUTE.
> 
> Introduce HPET_TN_INT_ROUTE_CAP paralleling the other HPET_TN_*_CAP
> constants, making it necessary to rename the such named constant in
> hvm/hpet.c. Use MASK_EXTR() / MASK_INSR() instead of kind of open-
> coding them.
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

> 
> --- a/xen/arch/x86/hvm/hpet.c
> +++ b/xen/arch/x86/hvm/hpet.c
> @@ -41,14 +41,8 @@
>  #define guest_time_hpet(hpet) \
>      (hvm_get_guest_time(vhpet_vcpu(hpet)) / STIME_PER_HPET_TICK)
>  
> -#define HPET_TN_INT_ROUTE_CAP_SHIFT 32
> -
>  /* can be routed to IOAPIC.redirect_table[23..20] */
> -#define HPET_TN_INT_ROUTE_CAP      (0x00f00000ULL \
> -                    << HPET_TN_INT_ROUTE_CAP_SHIFT)
> -
> -#define HPET_TN_INT_ROUTE_CAP_MASK (0xffffffffULL \
> -                    << HPET_TN_INT_ROUTE_CAP_SHIFT)
> +#define HPET_TN_INT_ROUTE_CAP_VAL MASK_INSR(0x00f00000, 
> HPET_TN_INT_ROUTE_CAP)

I might be clearer to define this as:
(1 << 20 | 1 << 21 | 1 << 22 | 1 << 23)
but it's also quite cumbersome.

Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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