From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A841C07E95 for ; Wed, 7 Jul 2021 08:54:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7114F61CC0 for ; Wed, 7 Jul 2021 08:54:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231218AbhGGI4v (ORCPT ); Wed, 7 Jul 2021 04:56:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:59988 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230467AbhGGI4u (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: kvm@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