Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2073717ybb; Thu, 2 Apr 2020 12:33:34 -0700 (PDT) X-Google-Smtp-Source: APiQypL0LBg+BzPIdRKAuEVxWA0hjTgFL5XLctQVM+5VSKnqm7Fngz0ncptQisjcA8zNFSxGeseZ X-Received: by 2002:aca:efd4:: with SMTP id n203mr489582oih.159.1585856014081; Thu, 02 Apr 2020 12:33:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585856014; cv=none; d=google.com; s=arc-20160816; b=VsX1yta0vxfxPRqlKTME8ri6jSAr3SFHx1PGk85Aaa9pcbE1d6DcRPi2sResznjHR1 1Z99NJguX2LgRQHyXXUUx2PP3eGd/u4jHp64Tnehrj2vbMhsSnWWDpnSBGQsGqA8CkMj Wl6P/3ZCgj08vGYzJiTJFJlQoB2OYNU5Zpvh3Jo18jgtp4FSXAKX+cuu2xvDAxTlKZVl Dvx779Qd2oRTOFmQ0omEp0bP2hMPVK22Vlz2+Gho+na7SS70rt+hPZzOfRAJgnfKTsZR bDr5XRFh2FxWAwD82GEBfu1MTtz4b8HsY+G7+ZV9BAH1jZ7GxDGN0BFSgHCucGyblVGw TwXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=J1iTHN+tnT2p+g/fi18lrfKuFFUGCiTi5w5obFOSEB4=; b=TBIkALJxSlYGkSu+ttgulTHixo+oYcVyADLPWiN02fqB0uYm91XSX2yWvz70XEnr+/ JTBI43ZwiJ/YWV4sC5QTK8+l/g0RvVAOEpNoDY/Jajji1uAbVEMD0dR04Omp90FpZQ94 jb72H3+z5gosdI4xpi7cuHy7+eqDTH+N5iLERdr6kyWVEJucfbmXwOYU8fhW/qRkjo+R FxZDZVwOZdR5KI1ChJ6/SPCbj4yXQ5dyePVkGzGs6FWeerQeA3WDqfxXT0mopmMFbaA/ GNkzJ+5j5/c4zmRy8VuNHBvKYQZeqcqliKVCqSgdINxSH9OHfxGbGbnBnAHda3LBpOMd VCEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=h1oM8tqP; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l21si2811629otd.63.2020.04.02.12.33.20; Thu, 02 Apr 2020 12:33:34 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=h1oM8tqP; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389956AbgDBSsg (ORCPT + 99 others); Thu, 2 Apr 2020 14:48:36 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:29894 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2389905AbgDBSsf (ORCPT ); Thu, 2 Apr 2020 14:48:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585853314; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=J1iTHN+tnT2p+g/fi18lrfKuFFUGCiTi5w5obFOSEB4=; b=h1oM8tqPfU5CRPhh2Qt3e3vizTdAifsUg3e1Ggaz8aprdivxAzYXzfwrhrk3FjnMgagmnW FYj/HpmqrvkG+O88VzVdSyJ7XmhRs3GsiiHbHocmIYLg4D8JbplUKBMyjRpz2Wkm8hh1zN rrFDQ36LMyDpQRLBq3lNl72HYiqEElc= 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-283-ggkVwfV3P3KDHLgJNeELUA-1; Thu, 02 Apr 2020 14:48:31 -0400 X-MC-Unique: ggkVwfV3P3KDHLgJNeELUA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C55AC1926DA5; Thu, 2 Apr 2020 18:48:29 +0000 (UTC) Received: from t480s.redhat.com (ovpn-114-29.ams2.redhat.com [10.36.114.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id B900360BF3; Thu, 2 Apr 2020 18:48:27 +0000 (UTC) From: David Hildenbrand To: kvm@vger.kernel.org Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, Vasily Gorbik , Heiko Carstens , Cornelia Huck , Janosch Frank , Christian Borntraeger , David Hildenbrand , stable@vger.kernel.org Subject: [PATCH v1 2/5] KVM: s390: vsie: Fix delivery of addressing exceptions Date: Thu, 2 Apr 2020 20:48:16 +0200 Message-Id: <20200402184819.34215-3-david@redhat.com> In-Reply-To: <20200402184819.34215-1-david@redhat.com> References: <20200402184819.34215-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Whenever we get an -EFAULT, we failed to read in guest 2 physical address space. Such addressing exceptions are reported via a program intercept to the nested hypervisor. We faked the intercept, we have to return to guest 2. Instead, right now we would be returning -EFAULT from the intercept handler, eventually crashing the VM. Addressing exceptions can only happen if the g2->g3 page tables reference invalid g2 addresses (say, either a table or the final page is not accessible - so something that basically never happens in sane environments. Identified by manual code inspection. Fixes: a3508fbe9dc6 ("KVM: s390: vsie: initial support for nested virtual= ization") Cc: # v4.8+ Signed-off-by: David Hildenbrand --- arch/s390/kvm/vsie.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/s390/kvm/vsie.c b/arch/s390/kvm/vsie.c index 076090f9e666..4f6c22d72072 100644 --- a/arch/s390/kvm/vsie.c +++ b/arch/s390/kvm/vsie.c @@ -1202,6 +1202,7 @@ static int vsie_run(struct kvm_vcpu *vcpu, struct v= sie_page *vsie_page) scb_s->iprcc =3D PGM_ADDRESSING; scb_s->pgmilc =3D 4; scb_s->gpsw.addr =3D __rewind_psw(scb_s->gpsw, 4); + rc =3D 1; } return rc; } --=20 2.25.1