Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753513AbeAQOE2 (ORCPT + 1 other); Wed, 17 Jan 2018 09:04:28 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:44114 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753062AbeAQOEZ (ORCPT ); Wed, 17 Jan 2018 09:04:25 -0500 Subject: Re: [PATCH 2/6] s390: implement nospec_[load|ptr] To: David Hildenbrand , Martin Schwidefsky , linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, kvm@vger.kernel.org Cc: Heiko Carstens , Paolo Bonzini , Cornelia Huck , Greg Kroah-Hartman , Jon Masters , Marcus Meissner , Jiri Kosina References: <1516182519-10623-1-git-send-email-schwidefsky@de.ibm.com> <1516182519-10623-3-git-send-email-schwidefsky@de.ibm.com> <08d3bfc0-97ae-6f2b-c44b-531be00737cc@redhat.com> From: Christian Borntraeger Date: Wed, 17 Jan 2018 15:04:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <08d3bfc0-97ae-6f2b-c44b-531be00737cc@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 18011714-0016-0000-0000-00000518CC34 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18011714-0017-0000-0000-0000285541F4 Message-Id: <4f3c7daf-6669-9908-8307-17d394b76f52@de.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-01-17_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801170201 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On 01/17/2018 02:58 PM, David Hildenbrand wrote: > On 17.01.2018 10:48, Martin Schwidefsky wrote: >> Implement nospec_load() and nospec_ptr() for s390 with the new >> gmb() barrier between the boundary condition and the load that >> may not be done speculatively. >> >> Acked-by: Christian Borntraeger >> Signed-off-by: Martin Schwidefsky >> --- >> arch/s390/include/asm/barrier.h | 38 ++++++++++++++++++++++++++++++++++++++ >> arch/s390/kernel/alternative.c | 7 +++++++ >> 2 files changed, 45 insertions(+) >> >> diff --git a/arch/s390/include/asm/barrier.h b/arch/s390/include/asm/barrier.h >> index 1043260..b8836a6 100644 >> --- a/arch/s390/include/asm/barrier.h >> +++ b/arch/s390/include/asm/barrier.h >> @@ -8,6 +8,8 @@ >> #ifndef __ASM_BARRIER_H >> #define __ASM_BARRIER_H >> >> +#include >> + >> /* >> * Force strict CPU ordering. >> * And yes, this is required on UP too when we're talking >> @@ -23,6 +25,42 @@ >> >> #define mb() do { asm volatile(__ASM_BARRIER : : : "memory"); } while (0) >> >> +static inline void gmb(void) >> +{ >> + asm volatile( >> + ALTERNATIVE("", ".long 0xb2e8f000", 81) >> + : : : "memory"); >> +} > > Just to be sure: > > There are now 2 new facilities: > > 81 and 82. > > Is 82 just the virtualization (SIE) support for 81? 81 is for ppa15 (see this patch) and 82 is for ppa12 and 13 (see patch 3). In KVM we want to provide both (and let the guest decide what to do).