Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp5366034pxv; Wed, 7 Jul 2021 01:55:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfDaQWngF+bqi+97r4l+lX0vMHvHSAZ+RoDnCTMiKt4OprVUHwxPEvziyob2c+AR8w/fkd X-Received: by 2002:a17:907:728f:: with SMTP id dt15mr23104695ejc.530.1625648142943; Wed, 07 Jul 2021 01:55:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625648142; cv=none; d=google.com; s=arc-20160816; b=tfv4giM/TEr+e5TMZJTRQtfHCUPtFrdL8/sbNR8kCJNELZTweXJR366BTbmSHgcDgb PK7fXUA4X3zwGo8CZE9PrXFu/fFX4tYj9ojvLMy3ICMf+VYlSh99nX/EQDJzSnkJTYKf ICb0kGgyR8A0FvdrOPMF1Vn8t1WXPWlDQdimBJAnMA1j14qiVodMYT0jNR7dBV2Y0ub9 eU22NTWlP9kyKtRgP6fxybeXF+6+9R1a++x1AJLuZabN15d9pgdc8XxXREccDP1mTvd5 lChq8xqkn1RdhhcToYtKK9gZHWR2Z9xqjuDK5jkwVRUe67ccxiY+s/u+HxxNKK29ImOq Gi4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:user-agent :references:organization:in-reply-to:subject:cc:to:from :dkim-signature; bh=4bNksCUZBGOM01YOqNVk0ERUtPqgiPlg77eX2weUD+s=; b=O1Lj6w1hr4XRlzdRd4qGyobUMfvBDgZbBS9KFDqERXcSHXoySCCQAZT70ry5nDIf9m dD/P+wSEsj6jwqwgxNnjTHhIcTiD3E8Bom+ed2iZi22U+yLA0sNmtqQU64MnHOL/AKE9 3HV2+1hKvQ+lDow35/NYWIAsphT1YJBrRfhRrSGL3LVoEQFC0SAIGus8YViTdYNwwhPV VBn6wgA5gBnvCcJEmV3Tv/v10G8xpiRY6cBOfG1cn/l6wmqQ9/j4SSsj0jgLDc2KDfKh /8F4G3TZ5KeKOGA/UOoz1CFiBaa4mYgYQM6CwKr7bIUJq9DOmrSLsD8x5bhf9jgFq4R+ UC8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PjPDNMLe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jx15si16542043ejc.135.2021.07.07.01.55.20; Wed, 07 Jul 2021 01:55:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PjPDNMLe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231244AbhGGI4v (ORCPT + 99 others); Wed, 7 Jul 2021 04:56:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:31173 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230446AbhGGI4u (ORCPT ); Wed, 7 Jul 2021 04:56:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625648050; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=4bNksCUZBGOM01YOqNVk0ERUtPqgiPlg77eX2weUD+s=; b=PjPDNMLe3Rrv+j/Hp0b2t6et/PB7jklI2d+mvFP29mWhryc2FAfE6xuzL1COWqDNdfPCwN 6Tez8HXjD9LV0Wp7OAHKXtwW4d7ySH9fMzDzNJxhlaEGRgrIxW/6/PyI1cgv1vjqi4hgO6 E8ILFRkR4w5ADQc5zv5HFPNIjM0ngzc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-587-lOc9jp2VOp-3e1dzyLl61A-1; Wed, 07 Jul 2021 04:54:09 -0400 X-MC-Unique: lOc9jp2VOp-3e1dzyLl61A-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DC9B2100C609; Wed, 7 Jul 2021 08:54:07 +0000 (UTC) Received: from localhost (ovpn-112-160.ams2.redhat.com [10.36.112.160]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 018752C6BF; Wed, 7 Jul 2021 08:54:03 +0000 (UTC) From: Cornelia Huck To: Christian Borntraeger , Janis Schoetterl-Glausch , Janosch Frank , Heiko Carstens , Vasily Gorbik Cc: David Hildenbrand , Claudio Imbrenda , "open list:KERNEL VIRTUAL MACHINE for s390 (KVM/s390)" , "open list:S390" , open list Subject: Re: [PATCH] KVM: s390: Enable specification exception interpretation In-Reply-To: <05430c91-6a84-0fc9-0af4-89f408eb691f@de.ibm.com> Organization: Red Hat GmbH References: <20210706114714.3936825-1-scgl@linux.ibm.com> <05430c91-6a84-0fc9-0af4-89f408eb691f@de.ibm.com> User-Agent: Notmuch/0.32.1 (https://notmuchmail.org) Date: Wed, 07 Jul 2021 10:54:02 +0200 Message-ID: <87lf6ifqs5.fsf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 07 2021, Christian Borntraeger wrote: > On 06.07.21 13:47, Janis Schoetterl-Glausch wrote: >> When this feature is enabled the hardware is free to interpret >> specification exceptions generated by the guest, instead of causing >> program interruption interceptions. >> >> This benefits (test) programs that generate a lot of specification >> exceptions (roughly 4x increase in exceptions/sec). >> >> Interceptions will occur as before if ICTL_PINT is set, >> i.e. if guest debug is enabled. > > I think I will add > > There is no indication if this feature is available or not and the hardware > is free to interpret or not. So we can simply set this bit and if the > hardware ignores it we fall back to intercept 8 handling. Sounds good. > > > With that > > Reviewed-by: Christian Borntraeger >> >> Signed-off-by: Janis Schoetterl-Glausch >> --- >> I'll additionally send kvm-unit-tests for testing this feature. >> >> arch/s390/include/asm/kvm_host.h | 1 + >> arch/s390/kvm/kvm-s390.c | 2 ++ >> arch/s390/kvm/vsie.c | 2 ++ >> 3 files changed, 5 insertions(+) (...) >> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c >> index b655a7d82bf0..aadd589a3755 100644 >> --- a/arch/s390/kvm/kvm-s390.c >> +++ b/arch/s390/kvm/kvm-s390.c >> @@ -3200,6 +3200,8 @@ static int kvm_s390_vcpu_setup(struct kvm_vcpu *vcpu) >> vcpu->arch.sie_block->ecb |= ECB_SRSI; >> if (test_kvm_facility(vcpu->kvm, 73)) >> vcpu->arch.sie_block->ecb |= ECB_TE; Maybe add /* no facility bit, but safe as the hardware may ignore it */ or something like that, so that we don't stumble over that in the future? >> + if (!kvm_is_ucontrol(vcpu->kvm)) >> + vcpu->arch.sie_block->ecb |= ECB_SPECI; >> >> if (test_kvm_facility(vcpu->kvm, 8) && vcpu->kvm->arch.use_pfmfi) >> vcpu->arch.sie_block->ecb2 |= ECB2_PFMFI; Reviewed-by: Cornelia Huck