Message ID | 20231109123624.37314-1-imbrenda@linux.ibm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp401104vqs; Thu, 9 Nov 2023 04:37:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IEWXRT/JWWlOOE+7TsGWRMoeLHvpuRNSBHyFHKdJQEuZbLNSG/DI0SeUrZ9kt44McuWvIzy X-Received: by 2002:a17:902:8c83:b0:1cc:dade:2788 with SMTP id t3-20020a1709028c8300b001ccdade2788mr3914106plo.3.1699533464246; Thu, 09 Nov 2023 04:37:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699533464; cv=none; d=google.com; s=arc-20160816; b=G/ZCqgeiU50DGOHNrD7LOezDtjUMWJFwID71UHt/0AXwWrL3APfQSpXCiPvKVsh0pe d5/m617KDU3bUOok4hCWNz4+015YYTIcAK1rkH6OJYT8uIPPBNHNeko58ezK6TIP4J+7 9NdbVabrAxNIuY04ILDErN8yIYMGz4VwnBArxsU7hAUF4efRrl3K7zgXOSDClybncAMm ogn++k/exxSNd1i9Y0tUugN8Rfaz6ED/cP1AYyB9yrVyDpxG2LAOoewwroyZcTszq9S6 M5+TtTJxCd/vM2yyw9q6aJhZuzoR1rAZICZ2yTrAI5ubDCBkDKV7SYtkfNl9E9gbNT37 CTQQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=8M+6oE/mGzBR3l5KMdntkJh/cY/+e85xL1ajn5Bglik=; fh=2CREB5H0UetwZ3RB8FW9VP8xf1n/I/ABCTwW3cvoddk=; b=PrtT1OqyanNvJDYazOXs6W/lUA/8/3nPHtw1S6lJFE3yorxDex6fQ1ka6G3uOKHkfY IZlTrwEmB64PRdHuNKntJH5RHIS/PK7JAMFoL8XxqGJENz7nH95K++aq4FOqt10PCfry FtrKYQncG0uBP6hQL7bmwXH6Q/7IoG/OfIav4ah1OWm1SPQ68tMibFwVV0XOE12c4zq2 wTyqkt2bWXmPy3KLmt4JMfDeCz1kkrfPF4PUJRHYYVuXdsy+9qu8mYkuj/2UHYDMIY3u qirQapIVckV12PdADbzNLPxiNpkJ8zd0O7HhGsBCJZ/N1RrEgMvwFYp08ixQydieM3za aRsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=OGfbZp8o; 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 kk15-20020a170903070f00b001c9e890f42bsi4577168plb.78.2023.11.09.04.37.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 04:37:44 -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=OGfbZp8o; 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 CD4158048694; Thu, 9 Nov 2023 04:36:44 -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 S230229AbjKIMgj (ORCPT <rfc822;jaysivo@gmail.com> + 32 others); Thu, 9 Nov 2023 07:36:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229898AbjKIMgh (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 9 Nov 2023 07:36:37 -0500 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 272A82590; Thu, 9 Nov 2023 04:36:35 -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 3A9CIhTJ014827; Thu, 9 Nov 2023 12:36:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=pp1; bh=8M+6oE/mGzBR3l5KMdntkJh/cY/+e85xL1ajn5Bglik=; b=OGfbZp8oiUDCHbLPpzrWR3tf+EWaoHZE2JS8Vrdm2hzEqEQKjwsTTUr/Bp/gng/Ub7gu WItNQf17BBIGMEohY06snuxZhTzEzBf3skFHZprBF4dAY7/c3xaOVyH+vKzWU6Qj+CyI iBURYURC/yWuTcCPloV3Fcoz55Xrz4ITKJWVEdKJcMzbar/4GE8Vtj+k5soDi0JYb2mg iJ883uP/OHOXLsSK2h8frZ3DYb0lETxgBs6O7IZbFhvJTzNA8G7jgsCnXJzBbwTzuqRB 5tRei91GI+gIdhNPgpIQFsFcd+fXD7I7luRMNNbYdbsAOSJDYxvHNQT+I66474xGJaS6 0g== 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 3u8y1x12s0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Nov 2023 12:36:33 +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 3A9BA6dh019224; Thu, 9 Nov 2023 12:36:30 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 3u7w243paq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Nov 2023 12:36:30 +0000 Received: from smtpav03.fra02v.mail.ibm.com (smtpav03.fra02v.mail.ibm.com [10.20.54.102]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3A9CaPel15729308 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 9 Nov 2023 12:36:25 GMT Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9ACF520043; Thu, 9 Nov 2023 12:36:25 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3F50F20040; Thu, 9 Nov 2023 12:36:25 +0000 (GMT) Received: from p-imbrenda.boeblingen.de.ibm.com (unknown [9.152.224.66]) by smtpav03.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 9 Nov 2023 12:36:25 +0000 (GMT) From: Claudio Imbrenda <imbrenda@linux.ibm.com> To: kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, frankja@linux.ibm.com, nrb@linux.ibm.com, nsg@linux.ibm.com, borntraeger@de.ibm.com, hca@linux.ibm.com, gerald.schaefer@de.ibm.com, gor@linux.ibm.com, svens@linux.ibm.com, agordeev@linux.ibm.com Subject: [PATCH v1 1/1] KVM: s390/mm: Properly reset no-dat Date: Thu, 9 Nov 2023 13:36:24 +0100 Message-ID: <20231109123624.37314-1-imbrenda@linux.ibm.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: myYyJj0L8_5WghP5f341tFr1DjuECp_V X-Proofpoint-ORIG-GUID: myYyJj0L8_5WghP5f341tFr1DjuECp_V 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-09_10,2023-11-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 bulkscore=0 impostorscore=0 spamscore=0 lowpriorityscore=0 mlxlogscore=564 clxscore=1015 phishscore=0 adultscore=0 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311090094 Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> 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]); Thu, 09 Nov 2023 04:36:44 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782090001991979166 X-GMAIL-MSGID: 1782090001991979166 |
Series |
[v1,1/1] KVM: s390/mm: Properly reset no-dat
|
|
Commit Message
Claudio Imbrenda
Nov. 9, 2023, 12:36 p.m. UTC
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.
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
---
arch/s390/mm/pgtable.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Sorry, I had copy-pasted the wrong email address for Gerald, fixed now On Thu, 9 Nov 2023 13:36:24 +0100 Claudio Imbrenda <imbrenda@linux.ibm.com> wrote: > 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. > > Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com> > --- > 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(); > }
Am 09.11.23 um 13:36 schrieb Claudio Imbrenda: > 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. This happens during reset of a guest (or whenever QEMU calls the CLR_CMMA thingi). I think after reset a normal Linux guest has no DAT tables and very likely a cpu reset (with explicit full guest flush) will happen. It will very likely also set the CMMA state during boot before setting up its DAT tables. So for the normal reboot this should be ok. But I can imagine cases that would not be ok. So maybe add cc stable?
Quoting Claudio Imbrenda (2023-11-09 13:36:24) > 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. > > Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Please Cc stable and add my: Reviewed-by: Nico Boehr <nrb@linux.ibm.com>
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(); }