Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp14829pxf; Tue, 23 Mar 2021 20:15:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqhwoDrwe4lRUN2iG9yCqesFm9covsck2COWehmBsHtTThoXXdiVCPcCW+dT3OMsJPJm4f X-Received: by 2002:a05:6402:1613:: with SMTP id f19mr1101312edv.222.1616555737197; Tue, 23 Mar 2021 20:15:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616555737; cv=none; d=google.com; s=arc-20160816; b=RavAXl6J8sGQ74e/2z3JyYtiDwZYGwB34mJ3yIlrOVnYiyvPccxtT6kNl/v8BHYLsc 1uEpjFuoZULHlGR50EDO2ih1lbKO8wdvfqVeix4y6CMkH5MSYKORnxot9ICASthqERas 493bNpt01atqqL7yBMZkF78P5J0aYxfOA9ZZEhF2vPfgnTuZyNLVbEmhWYcIagrPnCtR eiFfC7iNYzhK3zEYuBSSQsn2wDFH+IfEatauKhZLZU29C8vej55S/rV4Arh4Qkyqm5QP ekPJaIvPJI0Ehi0D3NL8OYxLerlQicbyojd+NIevpKwtuqxk/0dvlMA5MGQX40SIjw5O IDRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:dkim-signature; bh=rokvBybpsA1xI8rKalCTyXiK0DREHebY1MIs1ueg/nA=; b=F/fLXS9fwYbYxBVNLwtoJSlBGRvB9IYqZXS/JPNDXlxERSIYUOdfz60Y442faXJ8q/ l1gfWCxWHthkqOXHNmCNtrkXswc4a0xVf8jvDkq+gTbSnEyb+NrJVxf26CmBQtwq+wTe q/40wtl7bIBdWpmwPomkKfVZkuMOL23Sfhqi033/5QM37mwmKDbtx2UiFNfwhLasJZb4 nB749noy6dL2UOVaoP7TJ959M+NsBaP4zgrs80bd+hZeKJSh9ir8H1aEFVORCE8eceOx BdOkiegI05FnFHf96EXRtrgzbLNU8nltx7I79565GcKQPo9Wz5R/GsYoHrYXcf+RCxtZ FoCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YKGFbP7O; 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 h16si671063ejk.221.2021.03.23.20.15.14; Tue, 23 Mar 2021 20:15:37 -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=YKGFbP7O; 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 S232457AbhCWPMH (ORCPT + 99 others); Tue, 23 Mar 2021 11:12:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:33585 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232621AbhCWPLy (ORCPT ); Tue, 23 Mar 2021 11:11:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616512313; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rokvBybpsA1xI8rKalCTyXiK0DREHebY1MIs1ueg/nA=; b=YKGFbP7OKDGAWOQ5PHot4epTrzB3hsdwo7YD0XU2ls5+OgMIPPS7ayrQ3xpzHme2563YPD AuXXFfCk4OCYvgaun5u0luQ/5ifbTkRjjL4ps8wOIgbWGkRL7+0zuUneZSZ352ruHEfXf3 R4N7DeeYx7EgHz03YxSo0AZMFm/6Mks= 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-585-RCajBCL7O_CrPkmclr7GKg-1; Tue, 23 Mar 2021 11:11:49 -0400 X-MC-Unique: RCajBCL7O_CrPkmclr7GKg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C6391108BD07; Tue, 23 Mar 2021 15:11:47 +0000 (UTC) Received: from [10.36.115.54] (ovpn-115-54.ams2.redhat.com [10.36.115.54]) by smtp.corp.redhat.com (Postfix) with ESMTP id CE20E5D6BA; Tue, 23 Mar 2021 15:11:45 +0000 (UTC) Subject: Re: [PATCH v2 2/2] s390/kvm: VSIE: fix MVPG handling for prefixing and MSO To: Christian Borntraeger , Claudio Imbrenda , linux-kernel@vger.kernel.org Cc: frankja@linux.ibm.com, cohuck@redhat.com, kvm@vger.kernel.org, linux-s390@vger.kernel.org, stable@vger.kernel.org References: <20210322140559.500716-1-imbrenda@linux.ibm.com> <20210322140559.500716-3-imbrenda@linux.ibm.com> <433933f5-1b6e-ea58-618d-3c844edc73a6@de.ibm.com> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <830ca8c6-4d21-b1ed-ccaf-e0c12237849e@redhat.com> Date: Tue, 23 Mar 2021 16:11:44 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <433933f5-1b6e-ea58-618d-3c844edc73a6@de.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23.03.21 16:07, Christian Borntraeger wrote: > > > On 22.03.21 15:05, Claudio Imbrenda wrote: >> Prefixing needs to be applied to the guest real address to translate it >> into a guest absolute address. >> >> The value of MSO needs to be added to a guest-absolute address in order to >> obtain the host-virtual. >> >> Fixes: 223ea46de9e79 ("s390/kvm: VSIE: correctly handle MVPG when in VSIE") >> Cc: stable@vger.kernel.org >> Signed-off-by: Claudio Imbrenda >> Reported-by: Janosch Frank >> --- >> arch/s390/kvm/vsie.c | 6 +++++- >> 1 file changed, 5 insertions(+), 1 deletion(-) >> >> diff --git a/arch/s390/kvm/vsie.c b/arch/s390/kvm/vsie.c >> index 48aab6290a77..ac86f11e46dc 100644 >> --- a/arch/s390/kvm/vsie.c >> +++ b/arch/s390/kvm/vsie.c >> @@ -1002,7 +1002,7 @@ static u64 vsie_get_register(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page, >> static int vsie_handle_mvpg(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page) >> { >> struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; >> - unsigned long pei_dest, pei_src, src, dest, mask; >> + unsigned long pei_dest, pei_src, dest, src, mask, mso, prefix; >> u64 *pei_block = &vsie_page->scb_o->mcic; >> int edat, rc_dest, rc_src; >> union ctlreg0 cr0; >> @@ -1010,9 +1010,13 @@ static int vsie_handle_mvpg(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page) >> cr0.val = vcpu->arch.sie_block->gcr[0]; >> edat = cr0.edat && test_kvm_facility(vcpu->kvm, 8); >> mask = _kvm_s390_logical_to_effective(&scb_s->gpsw, PAGE_MASK); >> + mso = scb_s->mso & ~(1UL << 20); > shouldnt that be ~((1UL << 20 ) -1) > Looking at shadow_scb(), we can simply take scb_s->mso unmodified. -- Thanks, David / dhildenb