Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4338067pxf; Tue, 23 Mar 2021 08:20:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz55IzRZ2BvniQD5TSHEymsjfihpJoM21zCeYw8F+UwgMZboaGUPTk6W2l0ROSi3WxOUVPZ X-Received: by 2002:a17:906:90d8:: with SMTP id v24mr5316678ejw.547.1616512802315; Tue, 23 Mar 2021 08:20:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616512802; cv=none; d=google.com; s=arc-20160816; b=i4OD+wspMtjlL7S6uRsjtoy/ND/H0pFx/lku0XWymcGwQbYwbHM+ANOt5UJxN/kSlf ajRgYqpB6uPLffVXsffaco/fl/Tg30R94vYFKC5GpRjrhcTj86E6IA7xlE7CZv6oNMJY uSn4X071FSXXPp+pxMC3fBxvdWFmOgrJId8qtcA9PaJmCtFPzsfAJbVzdXhUuPrWqGka qUBthESb5bYQFI9vqWfwYqkZ0uCDttogIYaAa3FF3f4KtJQKms/eEwSN90l8tGSfASsY StCyj4ylK0vsWwpPsLc35Yue6QAp+LYzubAYJVs3pqxqK6mRwovKcqSbnyEAu3sS85lP Gs9g== 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=1jq2tvJtDPz72d+/3bbC8VgDfAbuUx+LKrL/pY9II6o=; b=Yms+15/tGw79FW1NDOZyMI+gO7rMU5U4v8KlR1nEynKoivWi6/noaGtGMDeVkZJUp4 cZrwCbJ1pq1R5SEh4swhQhIlYC/IDMnu19DYTHujiKXhKMHFvbpZPpNSjegfA7dO6f1R VlN0CV1dmy5f7/WwB6siJxi2k1dfL7nHI3HkLnOFFaOP95aHHhOlHps362HrCTxW2kJ0 4wth3L5xibFcLEOjyxXgVpBOsjcnhnfZQOsXlvGhZjiT5kOz6l4VFpB6Si3K5ABBIAke 62et2C05y0CIDjZ6cVnUCw6Nd75eqnr6IXPCVKahNxGhlnM0vndpXPH1kgyOVlEZDioO ibfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DPgN6SQ1; 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 dc11si12871317edb.17.2021.03.23.08.19.39; Tue, 23 Mar 2021 08:20:02 -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=DPgN6SQ1; 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 S232762AbhCWPSA (ORCPT + 99 others); Tue, 23 Mar 2021 11:18:00 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:57948 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232727AbhCWPR3 (ORCPT ); Tue, 23 Mar 2021 11:17:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616512648; 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=1jq2tvJtDPz72d+/3bbC8VgDfAbuUx+LKrL/pY9II6o=; b=DPgN6SQ1Q5LvUba5YAh1r7Yff+ZkXJfe4rSrwM24sFW7/GOEnLQ06fNQNDyoClnph2QyjF QLCzNL7z4M+oA13KwX+bspZSjaxVFacAf1zu+4Iy41q+3gk8gbLWzSVY4aIHVOuLODfHRi JxTMhQ+Ay5b0GJbaDVewipqUJz9IfCU= 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-250-xnmbI6VjN4uvnFuDKYhAVQ-1; Tue, 23 Mar 2021 11:17:22 -0400 X-MC-Unique: xnmbI6VjN4uvnFuDKYhAVQ-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 E106181625; Tue, 23 Mar 2021 15:17:20 +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 E655F5C1C5; Tue, 23 Mar 2021 15:17:18 +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> <830ca8c6-4d21-b1ed-ccaf-e0c12237849e@redhat.com> <9293b208-0f1d-fb58-290c-66a8ae30d60c@de.ibm.com> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: Date: Tue, 23 Mar 2021 16:17:17 +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: <9293b208-0f1d-fb58-290c-66a8ae30d60c@de.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23.03.21 16:16, Christian Borntraeger wrote: > > > On 23.03.21 16:11, David Hildenbrand wrote: >> 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. > > Right, I think I can fix this up (and get rid of the local mso variable) > when queueing. Or shall Claudio send a new version of the patch? > IMHO, you can just fix it up. -- Thanks, David / dhildenb