Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp644137ybl; Fri, 30 Aug 2019 05:10:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqw6ac5Kal9hhY6gQ+nJ0wSua9y4GR6rD2NdN41F6lGjA9potcQiPB9NoNnerVn4NeyknZUn X-Received: by 2002:a62:8344:: with SMTP id h65mr17801032pfe.85.1567167049546; Fri, 30 Aug 2019 05:10:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567167049; cv=none; d=google.com; s=arc-20160816; b=VAuOVqDnIbeh+ZwCs6hUWBnr0cj9nkNlEDK0Jja11jYPY//Fd6yV/dpePsmyPKWrMe WtCDDKk/qWbnEFeIm9CpaZGOkBM5ZOZoNstklA+GK6y6FgBoSA7Q6hRf60re/ehkS7Uq yhKSPmsH4rBYbA3mmy+0idyh44TVN361alIQOq+uj+PE26H0k+UmjpMItkdCfve9Khul mx5sFCFW1ORg5fFzxpLtXy/kc4iQCWbQaPMcYoQG5nr68nGe3swqCbH+7Wcw2Tmtvnb/ iy774uTz/ECwANxn6S1WwSM75tDXu0y5Leddcq3x/YBDUK9Qcs7SCdxhn7R04A29xR74 Ykog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:date:subject:cc:to:from; bh=leKUpyDV5EMBQXmS1XlP9Yj56RIMmJIxg8eOMBaOWp0=; b=PorATPdw7kFk/7oDLTPSx+xmrG4WZB875OyF24xs9I0f2kymlfM3YUW3GvX69H3iwm 41ZYtgp3m80u5xTCz8/Q7YkTG+URN2QM/vriMfnY+ByRF2sIIuvgzchfBk6ssWPi7V1H HNEmHi+glRghMwUz4/LxfQ+DHupb3CahBvO3xkC9d7Hc8N/pj6/3OHU5jDXoQUEydJoP zcjdOVpVtSpvUunTzvPJjE6wsnCFX4O27xG0t52p1o1Ld8XWp5TYnZik4qRdkJ1IH5T9 QKq9BuoA8yIIwx03fjatc+k6YaVeF3Loggdth10gSq6xaZZIB3PI20RgHgndWbEg72VH Zw4g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f8si4298032pgi.191.2019.08.30.05.10.32; Fri, 30 Aug 2019 05:10:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728135AbfH3MHd (ORCPT + 99 others); Fri, 30 Aug 2019 08:07:33 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:11496 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728209AbfH3MHX (ORCPT ); Fri, 30 Aug 2019 08:07:23 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x7UC32Xt056909 for ; Fri, 30 Aug 2019 08:07:22 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 2uq2jwte0e-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 30 Aug 2019 08:07:21 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 30 Aug 2019 13:07:19 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 30 Aug 2019 13:07:16 +0100 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x7UC7ELY37355652 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Aug 2019 12:07:14 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7E1E04204F; Fri, 30 Aug 2019 12:07:14 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B398742047; Fri, 30 Aug 2019 12:07:13 +0000 (GMT) Received: from pomme.com (unknown [9.145.17.35]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 30 Aug 2019 12:07:13 +0000 (GMT) From: Laurent Dufour To: mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org, aneesh.kumar@linux.ibm.com, npiggin@gmail.com Cc: linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/3] powerpc/mm: Conditionally call H_BLOCK_REMOVE Date: Fri, 30 Aug 2019 14:07:09 +0200 X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 19083012-0016-0000-0000-000002A4A2D8 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19083012-0017-0000-0000-00003304FD2D Message-Id: <20190830120712.22971-1-ldufour@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-08-30_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=790 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908300132 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since the commit ba2dd8a26baa ("powerpc/pseries/mm: call H_BLOCK_REMOVE"), the call to H_BLOCK_REMOVE is always done if the feature is exhibited. On some system, the hypervisor may not support all the combination of segment base page size and page size. When this happens the hcall is returning H_PARAM, which is triggering a BUG_ON check leading to a panic. The PAPR document is specifying a TLB Block Invalidate Characteristics item detailing which couple base page size, page size the hypervisor is supporting through H_BLOCK_REMOVE. Furthermore, the characteristics are also providing the size of the block the hcall could process. Supporting various block size seems not needed as all systems I was able to play with was support an 8 addresses block size, which is the maximum through the hcall. Supporting various size may complexify the algorithm in call_block_remove() so unless this is required, this is not done. In the case of block size different from 8, a warning message is displayed at boot time and that block size will be ignored checking for the H_BLOCK_REMOVE support. Due to the minimal amount of hardware showing a limited set of H_BLOCK_REMOVE supported page size, I don't think there is a need to push this series to the stable mailing list. The first patch is initializing the penc values for each page size to an invalid value to be able to detect those which have been initialized as 0 is a valid value. The second patch is reading the characteristic through the hcall ibm,get-system-parameter and record the supported block size for each page size. The third patch is changing the check used to detect the H_BLOCK_REMOVE availability to take care of the base page size and page size couple. Laurent Dufour (3): powerpc/mm: Initialize the HPTE encoding values powperc/mm: read TLB Block Invalidate Characteristics powerpc/mm: call H_BLOCK_REMOVE when supported arch/powerpc/include/asm/book3s/64/mmu.h | 3 + arch/powerpc/mm/book3s64/hash_utils.c | 8 +- arch/powerpc/platforms/pseries/lpar.c | 118 ++++++++++++++++++++++- 3 files changed, 125 insertions(+), 4 deletions(-) -- 2.23.0