Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp36947039rwd; Tue, 11 Jul 2023 07:38:33 -0700 (PDT) X-Google-Smtp-Source: APBJJlEguQzVCmBwctXGFxojB1G1xIi3OZ8DA8kKJpGULVRd+0bpDHC4/cH3FD4ZH4+5kJRzGiwG X-Received: by 2002:a2e:a40f:0:b0:2b6:efcf:1463 with SMTP id p15-20020a2ea40f000000b002b6efcf1463mr13453416ljn.6.1689086312759; Tue, 11 Jul 2023 07:38:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689086312; cv=none; d=google.com; s=arc-20160816; b=KVRfQADfcT70fUAj62dK9UJlt4W4TnYpJPTnuyzk/WrPGTBw4DWvPtTTD4+4NqfAmn e/B1DiGpmsPcaw5JEW74NP+s7K6bt/nuEchkO8lFP2xzJNVcuKIbw4ugZvEX9fBVevQV UY4f2IYfuJT7flfnPiDkTloKjM+xsnqkkySsnCE/+Ljug3us5cA6iZY27f3myu4Togbk 7SfVZoGyOf2B19WjxZJ+y63vEkw6gF6tbUPjwjdw8ZUWMOGBnwgJFQUJ8NmDq1oa0jVN nXH1GZxpzNDVE4r1Ei2LQgm3jEECFxmV2gj2RqIk8NDiX28YVp/lv1UbiG4A2Mv+ybMs UdPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=9ZAVi6KiU/ro/z+p6FjNut0qxPvIL3XbeOtGZatE0Io=; fh=AF+HAUWO3g70tv0f8WFu+IcvvFMifLWBs3EjCqLy/Rc=; b=jo7yxW4/vfu13oEwkfh4SICkl/lLjpA5z+u6z0gVaAZejNDaYlK+Es8+M8Pv/arC+f M0m+RYfNa5B4QdIgOfwC1jsO+iu5MVgJlZejloLivwkcgzBe3+Hgoz5jb0SWW9Juu/Eg 5kHgi3IuYwHVcoydjBPl0ZZgmejw31sO1fyFKgGACbX2/0ssUtBxvBHvBIFTGQPC0HFG ZOWVculZyZzaVCsiJ5dtZGjwpkuKzpO4aEw1D6MC65+I0rRxjm4XugHp9LyGSrAGPg5u SYgUPi+AVGx4O/+6AjNKy6p9jnExw1aNQ1mV8npoXI528T5DUkLbhYoBNdYt5X14Bf5k FDgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=SZQLnI57; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x24-20020a170906b09800b009885e680300si1966385ejy.266.2023.07.11.07.38.07; Tue, 11 Jul 2023 07:38:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=SZQLnI57; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231931AbjGKOcC (ORCPT + 99 others); Tue, 11 Jul 2023 10:32:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229970AbjGKOcB (ORCPT ); Tue, 11 Jul 2023 10:32:01 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4C8EF4; Tue, 11 Jul 2023 07:31:56 -0700 (PDT) Received: from pps.filterd (m0353726.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36BEVkNw005194; Tue, 11 Jul 2023 14:31:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=pp1; bh=9ZAVi6KiU/ro/z+p6FjNut0qxPvIL3XbeOtGZatE0Io=; b=SZQLnI57GBZIxjTJMUb8Nfoe8TwYYannXVn6Qs4T2T9VetR0+sVdnnPXBQVQfKH7lhFo LRqmLH6oGTkQHBE7BzScclxFRiG0PgGS5MTkS5hhfa4kSsg/T4q2dsD1yYI9teTFwjCA n7V1RU8x/sIsXEs0baPWXTx/OEAKj9iJgRaOc4k/Yk75Y4/dRwpVIdFt7wbkPisfY4c0 vuEQmE5QXVdFI+KZ5yAh6zZQu62eIKZwdsZLtLIFwTjIHFCjFX/BROASSND9PkcNtuQE wKVgTYhpL2T0KPQgH3OkxV8qx6E3b2kkvx2AnMaR7C+7Bz2CxAScq+6JBISukZqcat1S PA== Received: from ppma03fra.de.ibm.com (6b.4a.5195.ip4.static.sl-reverse.com [149.81.74.107]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rs8wur081-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 11 Jul 2023 14:31:55 +0000 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 36BAl28h009204; Tue, 11 Jul 2023 14:31:52 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma03fra.de.ibm.com (PPS) with ESMTPS id 3rpye51c8m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 11 Jul 2023 14:31:52 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 36BEVmNp15794878 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 11 Jul 2023 14:31:48 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3D65420040; Tue, 11 Jul 2023 14:31:48 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D8A6220049; Tue, 11 Jul 2023 14:31:47 +0000 (GMT) Received: from p-imbrenda (unknown [9.152.224.66]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 11 Jul 2023 14:31:47 +0000 (GMT) Date: Tue, 11 Jul 2023 16:31:46 +0200 From: Claudio Imbrenda To: Philippe =?UTF-8?B?TWF0aGlldS1EYXVkw6k=?= Cc: kvm@vger.kernel.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, frankja@linux.ibm.com, mhartmay@linux.ibm.com, nsg@linux.ibm.com, borntraeger@de.ibm.com, nrb@linux.ibm.com Subject: Re: [PATCH v2 2/2] KVM: s390: pv: fix index value of replaced ASCE Message-ID: <20230711163146.557e9d75@p-imbrenda> In-Reply-To: References: <20230705111937.33472-1-imbrenda@linux.ibm.com> <20230705111937.33472-3-imbrenda@linux.ibm.com> Organization: IBM X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: ZBw8A1FRQ1_ZGYCeZHiP55nMwpdpnDNq X-Proofpoint-ORIG-GUID: ZBw8A1FRQ1_ZGYCeZHiP55nMwpdpnDNq X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-11_08,2023-07-11_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 bulkscore=0 suspectscore=0 phishscore=0 lowpriorityscore=0 mlxlogscore=971 impostorscore=0 mlxscore=0 clxscore=1011 spamscore=0 malwarescore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307110131 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 11 Jul 2023 16:12:54 +0200 Philippe Mathieu-Daud=C3=A9 wrote: > On 5/7/23 13:19, Claudio Imbrenda wrote: > > The index field of the struct page corresponding to a guest ASCE should > > be 0. When replacing the ASCE in s390_replace_asce(), the index of the > > new ASCE should also be set to 0. > >=20 > > Having the wrong index might lead to the wrong addresses being passed > > around when notifying pte invalidations, and eventually to validity > > intercepts (VM crash) if the prefix gets unmapped and the notifier gets > > called with the wrong address. =20 >=20 > Can that also happen in crst_table_alloc()? no. ->index is only used for gmap page tables (guest mapping), from the root to pmd tables. the last level (ptes) is shared between guest mapping and QEMU address space. i.e. the ptes are the ones from QEMU. the last level of page tables is not expected to have ->index set (since that one actually belongs to QEMU and not to the guest mapping) guest page tables (all levels, except ptes) are allocated with gmap_alloc_table(), which correctly sets ->index the top level of a guest mapping is allocated in gmap_alloc(), which also correctly sets ->index to 0. >=20 > > Signed-off-by: Claudio Imbrenda > > --- > > arch/s390/mm/gmap.c | 1 + > > 1 file changed, 1 insertion(+) =20 >=20 > Reviewed-by: Philippe Mathieu-Daud=C3=A9 thank you! =20