Received: by 10.192.165.148 with SMTP id m20csp831164imm; Fri, 27 Apr 2018 08:11:31 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpBbdbyNW01sbAP7S/A5K7P5C7HW/JS+vxlzssguJE0FqscixhyPL+HG6ZAsIekGpYQ4Jk2 X-Received: by 10.98.55.69 with SMTP id e66mr2524534pfa.253.1524841891694; Fri, 27 Apr 2018 08:11:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524841891; cv=none; d=google.com; s=arc-20160816; b=d924B7c9nwfsXSbG/iYXYZ3aei7qncYPpcfQK0JdvgTxMr2ti8KQWF6g0upsMBLxZX 3UdSlTVDlGNJSr6GhdW1PAZwG5jnjUtSBxFLLjkWBj3ZnOXRLzhHkXQW+juYfr6BlWGf FMz9m1ashRv3Zd9xwD81tkPyy11S4vMjxTwKk+GF/SBDV1Sq94XmjDkB8CZoJGfpow7q 9UQy1imN74cNtrBWZgPOwHXQay7gnC78rdCL/Wy6GCPpZCU0hhMnN8PQD87eEln5XE19 EBJNPy1VkcJ4a4vVOp8UuIHKLZaLU3FjDyl/DIzezdir7SRKGeF8++H4CGsuaC0apaOa DDOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date:openpgp :from:references:cc:to:subject:arc-authentication-results; bh=GhuM+DiOn4EWWPdXjF763JQScHnYSE/wA3BRWu3v7ro=; b=ulFynLJgizYJ8R9IpDHD3Vs716e3yOrlzMqD1bqPLDcVTY3Zx5dRIuZsdngUzyUwI8 +JOlKfQ+MHknDBkjIfN93/JCU89G4xU/4PXB7D/Mj7GXgy/b/YnsR88FnNzYAjR15HIc lvweVbXX8bCwezgetAGGe83UJ0NzgxYUF6k29kJQHTOvrbczToS2X5BxxkF26U/6LAyg RN/D0HglLoR2D2TWOGH9huWkeAg+/5xveSiNVIABlMxeb0rwbvovUbFfbfsYne/2LPdN uigEv5MtBWadq5geX11p6WuVnyhUC9IUnkoIXT3eTqeiwjYNBZuma1mGIHy/idjU+hz0 49EQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y8-v6si1436193pli.242.2018.04.27.08.11.17; Fri, 27 Apr 2018 08:11:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933912AbeD0PKP (ORCPT + 99 others); Fri, 27 Apr 2018 11:10:15 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:52366 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933448AbeD0PKN (ORCPT ); Fri, 27 Apr 2018 11:10:13 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w3RF88iw119667 for ; Fri, 27 Apr 2018 11:10:12 -0400 Received: from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107]) by mx0b-001b2d01.pphosted.com with ESMTP id 2hm3r9yjq5-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 27 Apr 2018 11:10:11 -0400 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 27 Apr 2018 16:10:08 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 27 Apr 2018 16:10:05 +0100 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w3RFA4M516449952; Fri, 27 Apr 2018 15:10:04 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BE5E742054; Fri, 27 Apr 2018 16:01:23 +0100 (BST) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5FEFF4204F; Fri, 27 Apr 2018 16:01:23 +0100 (BST) Received: from oc7330422307.ibm.com (unknown [9.152.99.68]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 27 Apr 2018 16:01:23 +0100 (BST) Subject: Re: [PATCH 4.4 12/50] KVM: s390: wire up bpb feature To: Greg Kroah-Hartman , linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org, Martin Schwidefsky , David Hildenbrand , Cornelia Huck , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= References: <20180427135655.623669681@linuxfoundation.org> <20180427135656.428437126@linuxfoundation.org> From: Christian Borntraeger Openpgp: preference=signencrypt Date: Fri, 27 Apr 2018 17:10:04 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180427135656.428437126@linuxfoundation.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 18042715-0040-0000-0000-00000452C5EE X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18042715-0041-0000-0000-000020F6D406 Message-Id: <2764478b-8acb-653b-779f-1fb51d9a5931@de.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-04-27_04:,, 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-1804270145 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > > From: Christian Borntraeger > > [ Upstream commit 35b3fde6203b932b2b1a5b53b3d8808abc9c4f60 ] > > The new firmware interfaces for branch prediction behaviour changes > are transparently available for the guest. Nevertheless, there is > new state attached that should be migrated and properly resetted. > Provide a mechanism for handling reset, migration and VSIE. > > Signed-off-by: Christian Borntraeger > Reviewed-by: David Hildenbrand > Reviewed-by: Cornelia Huck > [Changed capability number to 152. - Radim] > Signed-off-by: Radim Krčmář > Signed-off-by: Martin Schwidefsky > Signed-off-by: Greg Kroah-Hartman Something went wrong during the backport of this to 4.4 [...] > --- > arch/s390/include/asm/kvm_host.h | 3 ++- > arch/s390/include/uapi/asm/kvm.h | 3 +++ > arch/s390/kvm/kvm-s390.c | 13 ++++++++++++- > include/uapi/linux/kvm.h | 1 + > 4 files changed, 18 insertions(+), 2 deletions(-) > > --- a/arch/s390/include/asm/kvm_host.h > +++ b/arch/s390/include/asm/kvm_host.h > @@ -1286,7 +1291,6 @@ void kvm_arch_vcpu_load(struct kvm_vcpu > if (test_fp_ctl(current->thread.fpu.fpc)) > /* User space provided an invalid FPC, let's clear it */ > current->thread.fpu.fpc = 0; > - unrelated whitespace change > save_access_regs(vcpu->arch.host_acrs); > restore_access_regs(vcpu->run->s.regs.acrs); > gmap_enable(vcpu->arch.gmap); > @@ -1327,6 +1331,7 @@ static void kvm_s390_vcpu_initial_reset( > current->thread.fpu.fpc = 0; > vcpu->arch.sie_block->gbea = 1; > vcpu->arch.sie_block->pp = 0; > + vcpu->arch.sie_block->fpf &= ~FPF_BPBC; > vcpu->arch.pfault_token = KVM_S390_PFAULT_TOKEN_INVALID; > kvm_clear_async_pf_completion_queue(vcpu); > if (!kvm_s390_user_cpu_state_ctrl(vcpu->kvm)) > @@ -2162,6 +2167,7 @@ static void store_regs(struct kvm_vcpu * > kvm_run->s.regs.pft = vcpu->arch.pfault_token; > kvm_run->s.regs.pfs = vcpu->arch.pfault_select; > kvm_run->s.regs.pfc = vcpu->arch.pfault_compare; > + kvm_run->s.regs.bpbc = (vcpu->arch.sie_block->fpf & FPF_BPBC) == FPF_BPBC; > } > > int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) > @@ -2194,6 +2200,11 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_v > kvm_run->exit_reason = KVM_EXIT_INTR; > rc = -EINTR; > } > + if ((kvm_run->kvm_dirty_regs & KVM_SYNC_BPBC) && > + test_kvm_facility(vcpu->kvm, 82)) { > + vcpu->arch.sie_block->fpf &= ~FPF_BPBC; > + vcpu->arch.sie_block->fpf |= kvm_run->s.regs.bpbc ? FPF_BPBC : 0; > + } > This looks misplaced and should go into the sync_regs function.