From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:33032 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750737AbeEGGHR (ORCPT ); Mon, 7 May 2018 02:07:17 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4764J6c070242 for ; Mon, 7 May 2018 02:07:16 -0400 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0a-001b2d01.pphosted.com with ESMTP id 2htejhcqam-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 07 May 2018 02:07:16 -0400 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 7 May 2018 07:07:13 +0100 Date: Mon, 7 May 2018 08:07:07 +0200 From: Martin Schwidefsky To: Greg Kroah-Hartman Cc: Jiri Slaby , linux-kernel@vger.kernel.org, stable@vger.kernel.org, David Hildenbrand , Cornelia Huck Subject: Re: [PATCH 4.4 15/50] s390/alternative: use a copy of the facility bit mask In-Reply-To: <20180504221808.GB24813@kroah.com> References: <20180427135655.623669681@linuxfoundation.org> <20180427135656.637526548@linuxfoundation.org> <20180504221808.GB24813@kroah.com> MIME-Version: 1.0 Message-Id: <20180507080707.2a41ae28@mschwideX1> Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: On Fri, 4 May 2018 15:18:08 -0700 Greg Kroah-Hartman wrote: > On Fri, May 04, 2018 at 09:37:20AM +0200, Jiri Slaby wrote: > > On 04/27/2018, 03:58 PM, Greg Kroah-Hartman wrote: > > > 4.4-stable review patch. If anyone has any objections, please let me know. > > > > > > ------------------ > > > > > > From: Martin Schwidefsky > > > > > > > > > [ Upstream commit cf1489984641369611556bf00c48f945c77bcf02 ] > > > > > > To be able to switch off specific CPU alternatives with kernel parameters > > > make a copy of the facility bit mask provided by STFLE and use the copy > > > for the decision to apply an alternative. > > ... > > > --- a/arch/s390/include/asm/facility.h > > > +++ b/arch/s390/include/asm/facility.h > > > @@ -13,6 +13,24 @@ > > > > > > #define MAX_FACILITY_BIT (256*8) /* stfle_fac_list has 256 bytes */ > > > > I wonder if the below (plus __test_facility) is correct in 4.4, given > > MAX_FACILITY_BIT is defined as such and not as sizeof(stfle_fac_list * > > 8) as in upstream? > > I'm going to defer to Marin here, as he did the backport... > Martin? Good catch. With MAX_FACILITY_BIT == 2048 and the patch applied the result for a test_facility/__test_facility call with a facility number >= 1024 would give an incorrect result. Fortunately there are no such calls in the current 4.4 kernel source. And there are no facilities defined with bit numbers this large, so even out-of-tree code would not do this if it is sane. To correct this the MAX_FACILITY_BIT define needs to be reduced to 1024 which would require the patch pointed out be Heiko: commit 6f5165e864d240d15675cc2fb5a369d57e1f60d0 Author: Heiko Carstens Date: Mon Mar 20 14:29:50 2017 +0100 s390/facilites: use stfle_fac_list array size for MAX_FACILITY_BIT I would say yes, it *does* make sense to include this patch even if it does not fix anything. -- blue skies, Martin. "Reality continues to ruin my life." - Calvin.