| 
    
 [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v3] psr: fix bug which may cause crash
 On 29.11.2019 11:01, Yi Sun wrote:
> --- a/xen/arch/x86/psr.c
> +++ b/xen/arch/x86/psr.c
> @@ -1271,7 +1271,13 @@ static void do_write_psr_msrs(void *data)
>  
>          for ( j = 0; j < cos_num; j++, index++ )
>          {
> -            if ( feat->cos_reg_val[cos * cos_num + j] != info->val[index] )
> +            /*
> +             * Multiple RDT features may co-exist and their COS_MAX may be
> +             * different. So we should prevent one feature to write COS
> +             * register which exceeds its COS_MAX. Otherwise, panic may 
> happen.
I don't think the last sentence adds much value. Early on I
said "brief" for a reason.
> +             */
> +            if ( cos <= feat->cos_max &&
> +                 feat->cos_reg_val[cos * cos_num + j] != info->val[index] )
As indicated in reply to v2, the added condition is loop
invariant and hence should lead to the loop not getting
entered in the first place.
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
 
  | 
  
![]()  | 
            
         Lists.xenproject.org is hosted with RackSpace, monitoring our  |