From patchwork Wed Nov 15 12:51:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudio Imbrenda X-Patchwork-Id: 165337 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp2512647vqg; Wed, 15 Nov 2023 04:51:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IHzNwZ3EfKMWGhHC9sl19sz5WHUQFdN9RVFR9fhnNSCSR9nhp9tZW+N+pi6rGEwj58RtPqy X-Received: by 2002:a05:6808:211:b0:3a7:4e0c:faa9 with SMTP id l17-20020a056808021100b003a74e0cfaa9mr13626787oie.29.1700052690231; Wed, 15 Nov 2023 04:51:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700052690; cv=none; d=google.com; s=arc-20160816; b=pGVz76lDmF7quHnikUHqxjcxyha7JCICXLnWHM1NUfx6N9uIMhzhAlWERC+/HQ/UhR tjK//YQb/r6MNAFbX6Evw89yYUA6LoghdaSgKsRjKqAGuY0naFkIxS2G2Qh3Uq3h3n1P U90ASZOs26GLrcNlQl+HPNe7PC/v7KWvL38b44hWoplOHIeQqH2oAs0JWnmNZrI/jJ09 2jR6Yyp6lVDJdhHvk15AbWpu6ik8RLu4vFjn387tAgiPcHJm5ygClGXhrerleiGIKPPz LqQQTCkatQfuXMEJnLKLGOSlqiaBVnIgHgDJ2+nLHUKhcp/9e5PE2DLE4/rgzFPZC0w4 1qAw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4qA5GmaLa+DXGP5sGQVRqL71vYDH1BLSkmB+4VfMGro=; fh=j7faUdWCTRu8QrPplXAuGjdyLNrbbH3w0Mw/NSQabfc=; b=i/I39uC+m5+/7fXw23Y79O0k1kwqb1L3lyhHM2ZdPWt3tfaKOeoL00ycCw5JDDwWk8 nZAtqb2XyFxgHYMQ1bqQAyC/4oiNMOIXzz7dkIChqqv3NtbY1c4bnA/qgJ0nN3nX5tBC H7+RjoOllzBPKUhpEnrT3ub5t084Cjp6uosU9gvflA7EvO5bdkrBqErzNsbWy7TQffzl e1D5lEldc3/+NfJwFj6KDlQqIPHwTOcZQVRzPN9NiGD33ogaITYLIJjmO56HBUQNIeTM yGhen9s7RGCdrVhSYA1MGF9mZfDEe8kkIUASr4tnks7Z2i6bMbxCwnlUn3zbxj7UCl7q zcqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=T1GzNkMB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id i185-20020a6387c2000000b005be1b2503ebsi8972671pge.194.2023.11.15.04.51.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 04:51:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=T1GzNkMB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 56237818ABE3; Wed, 15 Nov 2023 04:51:29 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343837AbjKOMv0 (ORCPT + 28 others); Wed, 15 Nov 2023 07:51:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234953AbjKOMvY (ORCPT ); Wed, 15 Nov 2023 07:51:24 -0500 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A7AE122; Wed, 15 Nov 2023 04:51:20 -0800 (PST) Received: from pps.filterd (m0353724.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AFCjnVs031670; Wed, 15 Nov 2023 12:51:19 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=4qA5GmaLa+DXGP5sGQVRqL71vYDH1BLSkmB+4VfMGro=; b=T1GzNkMB4mINdt2xkiIUqEdFD/HtH/E9GXb1YDbIo1u/MeUK4N8qXPJOjvi8F1cLih10 CndZ6IYh/PUSuexAr1HGuHXhwgXeYVEfqURg/iPwolKEGoLK6FXHq0GdCyqa4IX/yss0 D1uqFNbHdPvQrgWLu2dMzJrI/b1PYHKE8+mXdYSWaC57d8eAGX8xn2/JXpfkEkMvAdzS B0cYKyG0TA+rPDsyL/hSS111hUciE+abI+CxlYTsHl3lY+ryGbrW5+S1168gFtXPEjVK Ev0qZGUDThuhC4hjvmi3kh0fP5jx2kZwyv3kBxf5J1u9hX6nCXvA53YeMKG+ci+S4eTX 6w== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ucx94g4vw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 Nov 2023 12:51:18 +0000 Received: from m0353724.ppops.net (m0353724.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3AFCjnso031688; Wed, 15 Nov 2023 12:51:18 GMT Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ucx94g4v9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 Nov 2023 12:51:18 +0000 Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3AFCYGB9001920; Wed, 15 Nov 2023 12:51:17 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3uamayfc6g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 Nov 2023 12:51:17 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3AFCpBVJ4063846 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Nov 2023 12:51:11 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BA68620040; Wed, 15 Nov 2023 12:51:11 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 986C42004B; Wed, 15 Nov 2023 12:51:11 +0000 (GMT) Received: from p-imbrenda.boeblingen.de.ibm.com (unknown [9.152.224.66]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 15 Nov 2023 12:51:11 +0000 (GMT) From: Claudio Imbrenda To: pbonzini@redhat.com Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-s390@vger.kernel.org, frankja@linux.ibm.com, borntraeger@de.ibm.com, hca@linux.ibm.com, agordeev@linux.ibm.com, gor@linux.ibm.com Subject: [GIT PULL v1 1/2] KVM: s390: vsie: fix wrong VIR 37 when MSO is used Date: Wed, 15 Nov 2023 13:51:10 +0100 Message-ID: <20231115125111.28217-2-imbrenda@linux.ibm.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231115125111.28217-1-imbrenda@linux.ibm.com> References: <20231115125111.28217-1-imbrenda@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: ZvBPf3Xn29TuU7fDIGECsKqtNJLIE2nj X-Proofpoint-ORIG-GUID: y1k0J25N1ejyUe-2XIRg5FnxKE_iio80 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-15_11,2023-11-15_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 suspectscore=0 mlxscore=0 lowpriorityscore=0 spamscore=0 bulkscore=0 malwarescore=0 impostorscore=0 clxscore=1015 priorityscore=1501 adultscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311150099 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H4, 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 15 Nov 2023 04:51:29 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782634449752872656 X-GMAIL-MSGID: 1782634449752872656 When the host invalidates a guest page, it will also check if the page was used to map the prefix of any guest CPUs, in which case they are stopped and marked as needing a prefix refresh. Upon starting the affected CPUs again, their prefix pages are explicitly faulted in and revalidated if they had been invalidated. A bit in the PGSTEs indicates whether or not a page might contain a prefix. The bit is allowed to overindicate. Pages above 2G are skipped, because they cannot be prefixes, since KVM runs all guests with MSO = 0. The same applies for nested guests (VSIE). When the host invalidates a guest page that maps the prefix of the nested guest, it has to stop the affected nested guest CPUs and mark them as needing a prefix refresh. The same PGSTE bit used for the guest prefix is also used for the nested guest. Pages above 2G are skipped like for normal guests, which is the source of the bug. The nested guest runs is the guest primary address space. The guest could be running the nested guest using MSO != 0. If the MSO + prefix for the nested guest is above 2G, the check for nested prefix will skip it. This will cause the invalidation notifier to not stop the CPUs of the nested guest and not mark them as needing refresh. When the nested guest is run again, its prefix will not be refreshed, since it has not been marked for refresh. This will cause a fatal validity intercept with VIR code 37. Fix this by removing the check for 2G for nested guests. Now all invalidations of pages with the notify bit set will always scan the existing VSIE shadow state descriptors. This allows to catch invalidations of nested guest prefix mappings even when the prefix is above 2G in the guest virtual address space. Fixes: a3508fbe9dc6 ("KVM: s390: vsie: initial support for nested virtualization") Tested-by: Nico Boehr Reviewed-by: Nico Boehr Reviewed-by: David Hildenbrand Message-ID: <20231102153549.53984-1-imbrenda@linux.ibm.com> Signed-off-by: Claudio Imbrenda --- arch/s390/kvm/vsie.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/arch/s390/kvm/vsie.c b/arch/s390/kvm/vsie.c index 02dcbe82a8e5..8207a892bbe2 100644 --- a/arch/s390/kvm/vsie.c +++ b/arch/s390/kvm/vsie.c @@ -587,10 +587,6 @@ void kvm_s390_vsie_gmap_notifier(struct gmap *gmap, unsigned long start, if (!gmap_is_shadow(gmap)) return; - if (start >= 1UL << 31) - /* We are only interested in prefix pages */ - return; - /* * Only new shadow blocks are added to the list during runtime, * therefore we can safely reference them all the time. From patchwork Wed Nov 15 12:51:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudio Imbrenda X-Patchwork-Id: 165336 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp2512621vqg; Wed, 15 Nov 2023 04:51:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IFA8rjrxpS2WdBWdS7BkZQxtFo07LtPXG4nbyCX2nim6JnTpjobmTDW7jTrDSxVWRFAcppB X-Received: by 2002:a05:6e02:1d0a:b0:359:7d0:256a with SMTP id i10-20020a056e021d0a00b0035907d0256amr17014100ila.7.1700052686677; Wed, 15 Nov 2023 04:51:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700052686; cv=none; d=google.com; s=arc-20160816; b=R/mA3+MNLOPNj7CTx8n3hOcNS3LH8xrjctX9awx77C3j3SQCg2nR9jHmT06IR/Udh+ YPTn32977TWiEYQ/HKaBO1R1SVtDqdN3n13OCQYJ6IRF2ySEPijXdyOgQVtHytHx7lF+ +SmasRJz63ceeram9gQVSburssXtwy5OTh5NhDdomwYzYC/g8dk66JV6PMGsvQVf8C6c 0PG1sqz447G3HkDWEcGcXmlszmtD1IoZThGW8WlWylaM1uRE9/Y7tIB98dtf9gAYYr7u IhOZ14EC8w0k/31okR9C/Q6BmIqafldDjRZ9X6OWMsE24yfDRiS7wwA3DMsFWq97axWN Jg5Q== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=KUQVuNMVsHi3vAEtNSKfVSjF0aeqM2TchxBEMs7prwU=; fh=j7faUdWCTRu8QrPplXAuGjdyLNrbbH3w0Mw/NSQabfc=; b=SMv0I11hu6wM2Mcu5X4a9ySsfke61YZA3Ok3pepD+mnqxzvghcD6TtFF/dK40vYbpZ 6FPd2GKiqhrAOKKMNcobPUC1U3uGcEUgNeAvkxzOzVktIDqCzBT68d1Dpw6/oljZI5Fz AVt8r0pH6N0GsErZdQuZPZ5PFgy0IKRQHdkUdupm9lJQKjOWezsUIB9qCcUkke9pTMfl 5kKPGYly46DMm5ooR+HcFMUvRJxaHWCEgBkpwJ+lizNGFE3aXeoPxiUWbVehTl77A35W 4EIEukO3gMrl89/e+MYBztrRBvpsKRoU9DkNhS7X3/BYI3NNoVv5GM60skLj3n3WZ7RV wjyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=f44HPr8E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id o8-20020a656a48000000b005b881cc9498si11937043pgu.339.2023.11.15.04.51.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 04:51:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=f44HPr8E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id CEB15818ABE8; Wed, 15 Nov 2023 04:51:25 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343717AbjKOMvZ (ORCPT + 28 others); Wed, 15 Nov 2023 07:51:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234922AbjKOMvY (ORCPT ); Wed, 15 Nov 2023 07:51:24 -0500 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87C65120; Wed, 15 Nov 2023 04:51:19 -0800 (PST) Received: from pps.filterd (m0353722.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AFCFCBk019832; Wed, 15 Nov 2023 12:51:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=KUQVuNMVsHi3vAEtNSKfVSjF0aeqM2TchxBEMs7prwU=; b=f44HPr8Ex2tYSjWeq07VlYyykJ84s5WhziBziI6nBRppjBEG4kIt2MON0hj1YdFP8J9p 1pNCKN5sdi4XTRgeuh6Z2x03x43A5Y2NYnX+HTJ5heT1+IP2koJA9GId/blYEnKb03OU 5NydFV9JWsdF7WeY9gkjyvREIk9itUItHSQ0a19Bake+Hrs4bFyrUCbhcUtsIF9STBZ4 anynYbbOb3IGorn3mvm7acmNwBrp1HoAz90PeaQN2wCCeViEiNU3qOiFtgwPrHF3cSFf ozIHT3BbXKSD27W7WRyT7eEaBLNJUuKzTuFKqf+mjEPTadLFfV6CwWQgCc+d/p8NR+Qg ew== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ucwu08w64-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 Nov 2023 12:51:18 +0000 Received: from m0353722.ppops.net (m0353722.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3AFCneLn009025; Wed, 15 Nov 2023 12:51:17 GMT Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ucwu08w5q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 Nov 2023 12:51:17 +0000 Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3AFCYGGv028926; Wed, 15 Nov 2023 12:51:17 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 3uakxsyjrk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 Nov 2023 12:51:17 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3AFCpCKv40239404 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Nov 2023 12:51:12 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EA9832004B; Wed, 15 Nov 2023 12:51:11 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BF6192004D; Wed, 15 Nov 2023 12:51:11 +0000 (GMT) Received: from p-imbrenda.boeblingen.de.ibm.com (unknown [9.152.224.66]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 15 Nov 2023 12:51:11 +0000 (GMT) From: Claudio Imbrenda To: pbonzini@redhat.com Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-s390@vger.kernel.org, frankja@linux.ibm.com, borntraeger@de.ibm.com, hca@linux.ibm.com, agordeev@linux.ibm.com, gor@linux.ibm.com Subject: [GIT PULL v1 2/2] KVM: s390/mm: Properly reset no-dat Date: Wed, 15 Nov 2023 13:51:11 +0100 Message-ID: <20231115125111.28217-3-imbrenda@linux.ibm.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231115125111.28217-1-imbrenda@linux.ibm.com> References: <20231115125111.28217-1-imbrenda@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: h9Zore0ax-iKu_s-fP91Iv9gno7MXQ9G X-Proofpoint-ORIG-GUID: 6NJJMa9uJdJnid-RAFk1Ym46zM8a9MHB X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-15_11,2023-11-15_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 clxscore=1015 bulkscore=0 phishscore=0 adultscore=0 suspectscore=0 priorityscore=1501 mlxlogscore=657 impostorscore=0 mlxscore=0 malwarescore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311150099 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H4, 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 15 Nov 2023 04:51:25 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782634445812342645 X-GMAIL-MSGID: 1782634445812342645 When the CMMA state needs to be reset, the no-dat bit also needs to be reset. Failure to do so could cause issues in the guest, since the guest expects the bit to be cleared after a reset. Cc: Reviewed-by: Nico Boehr Message-ID: <20231109123624.37314-1-imbrenda@linux.ibm.com> Signed-off-by: Claudio Imbrenda --- arch/s390/mm/pgtable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c index 3bd2ab2a9a34..5cb92941540b 100644 --- a/arch/s390/mm/pgtable.c +++ b/arch/s390/mm/pgtable.c @@ -756,7 +756,7 @@ void ptep_zap_unused(struct mm_struct *mm, unsigned long addr, pte_clear(mm, addr, ptep); } if (reset) - pgste_val(pgste) &= ~_PGSTE_GPS_USAGE_MASK; + pgste_val(pgste) &= ~(_PGSTE_GPS_USAGE_MASK | _PGSTE_GPS_NODAT); pgste_set_unlock(ptep, pgste); preempt_enable(); }