Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp3926111ybe; Mon, 16 Sep 2019 03:51:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqwZUBNMkFV7TnXPHs4cwzgeRHj+IyRqs/OLIPIA6T8tv8EswrgavbEKqOb9KAmbt8xcW/D0 X-Received: by 2002:a17:906:3746:: with SMTP id e6mr52492353ejc.35.1568631084528; Mon, 16 Sep 2019 03:51:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568631084; cv=none; d=google.com; s=arc-20160816; b=IgRoz9ba7dmfduT64iVn+lXh1q++sbzxdSJcDKDs060Oo59OTqGxJDAS/N8TGV+nn6 ERCUBDGWFKgIf7pxtDi/aWZcaIYPdLvqL6pZrPF0Nucx0U1x3brIj60Ol42qLeFoe8Qr xMMSyhyHeWn4HzvW2XbreLGOXCcv5RIeJFzkF7NN6owTOZmPlQSIH9a9INchQYraBaOM 8tpqHI7ZVokk8ExNR/ouBFAAId+Aap8K+zpku0WBsuai0yquYVvkabtPOZC6LUBM4+t6 KtCno0QD34n12mY+2XaaxnMlFNoyVFHrnXuoNK7152r5bCihdMwnPNGiqXvPrkCEBCrM Ud7w== 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:to:from; bh=f9szIbT9471AwwQ/P2efz4bSJ4L8dBvu83wjNtND3Mc=; b=KOsX2j4pf6lyHXYza6sCu7I9nWXNz8mwB5zpcOL0gRRRVc7xF/xrc6eXJ3jiF95hH3 MN9ofX1lrausNJh2Vd6GjnFavlKC4nlxxqbJa9uoN/9ldPjGsqVMCpc1++t0pfpb+I/M gQSe0KR351TnbD9XjkmxEzu3U9CP1Al9im/gmSmcGX0U7MJZsMD42+TekKSlrFZjJzCg azJ6B7TnBq7kbQZuH1ohM4yIm+hCBhJoSZT10KayOQtE5/bdMWuz6i8lP2RTof77rdRd 4+lUKpk/xK980kUXGUUtM0tbGetJw8WJEQ4EBrz6Y712LigKDCDiyjcgm6LDqnYizmAq 79ag== 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 c51si22608110edc.317.2019.09.16.03.51.01; Mon, 16 Sep 2019 03:51:24 -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 S1730301AbfIPJ5Y (ORCPT + 99 others); Mon, 16 Sep 2019 05:57:24 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:18100 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729995AbfIPJ5Y (ORCPT ); Mon, 16 Sep 2019 05:57:24 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x8G9qXNc089273 for ; Mon, 16 Sep 2019 05:57:23 -0400 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 2v26vttvue-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 16 Sep 2019 05:57:22 -0400 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 16 Sep 2019 10:57:20 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 16 Sep 2019 10:57:18 +0100 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x8G9vHJW50397298 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 16 Sep 2019 09:57:17 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EC8844C046; Mon, 16 Sep 2019 09:57:16 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E09854C040; Mon, 16 Sep 2019 09:57:14 +0000 (GMT) Received: from pomme.com (unknown [9.145.76.175]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 16 Sep 2019 09:57:14 +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, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 0/2] powerpc/mm: Conditionally call H_BLOCK_REMOVE Date: Mon, 16 Sep 2019 11:55:41 +0200 X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 19091609-0008-0000-0000-00000316E1D3 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19091609-0009-0000-0000-00004A355A78 Message-Id: <20190916095543.17496-1-ldufour@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-09-16_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=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1909160105 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. However, the hypervisor may not support all the block size for the hcall H_BLOCK_REMOVE depending on the segment base page size and actual page size. When unsupported block size is used, the hcall H_BLOCK_REMOVE is returning H_PARAM, which is triggering a BUG_ON check leading to a panic like this: The PAPR document specifies the TLB Block Invalidate Characteristics which tells for each couple segment base page size, actual page size, the size of the block the hcall H_BLOCK_REMOVE is supporting. Supporting various block sizes doesn't seem needed at that time since all systems I was able to play with was supporting an 8 addresses block size, which is the maximum through the hcall, or none at all. Supporting various size would 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 reading the characteristic through the hcall ibm,get-system-parameter and record the supported block size for each page size. The second 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. Changes since V1: - Remove penc initialisation, this is already done in mmu_psize_set_default_penc() - Add details on the TLB Block Invalidate Characteristics's buffer format - Introduce #define instead of using direct numerical values - Function reading the characteristics is now directly called from pSeries_setup_arch() - The characteristics are now stored in a dedciated table static to lpar.c Laurent Dufour (2): powperc/mm: read TLB Block Invalidate Characteristics powerpc/mm: call H_BLOCK_REMOVE when supported .../include/asm/book3s/64/tlbflush-hash.h | 1 + arch/powerpc/platforms/pseries/lpar.c | 173 +++++++++++++++++- arch/powerpc/platforms/pseries/setup.c | 1 + 3 files changed, 173 insertions(+), 2 deletions(-) -- 2.23.0