Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2245485ybe; Thu, 12 Sep 2019 06:48:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqzYC4+CKKzFANMXLorzCYpx87gQL67GOzdcc2serLxwixc3vtsLIO7n44KhLo2A8QNSuR+0 X-Received: by 2002:a05:6402:350:: with SMTP id r16mr14288354edw.296.1568296124504; Thu, 12 Sep 2019 06:48:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568296124; cv=none; d=google.com; s=arc-20160816; b=BHbcO2seSa69iatq+SAJ6r7teveeHmaEdL2Fb8/ytPa7+Qi1eX7lQmdzgfGAIpQS1x 7lC7lmoMYIi3+tp+bSdlb2LQBGXfWZO2pBwb7Z2aVsYPqC88KZPfSJqxMfTy1B4pxF0Y jac2Me3lDo63/790HqPiyLML0YyZX4m7M7puBkFUzBly/jV0cHBQTcIW8jaQuXdU3dBm vU9Ae5+royJHU02rzAfnlx9E+m9JsCcnnZWwGn9OiIvE26+NXaxZu3XLe5Ifdn3qsxrG 4yWVyqxZHNJJ+IZj2zt0UduXxxgTNk5IdiDu05zZ8HtYnW3nV+8ODullb/f1IDOcQviv QULg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=YdCmhycNUt9nG95QlEloq3Eqe69NXJ4nYXuQ+s2wpEw=; b=j9D94HaBJlgw9B0sUAS5kv2Po3lDEFAPmTrJv8bozpP1gZW5jbYtEefEhULpkmN2ON CBeT7XASS3X3B0ZgktJ8Py+iJ3SKGQH3QF4ECNH8MF52dLKiaqWMj7LrKWgDbDUr/l9W qXlQuZcsgr6PJ3WOL+Yx9SJnb6CP+2M35MAHnSGupfgBZY9hnNb7nv/yXlqIu9Jtc52h CY2PjExBJLi9nyBjg3LZwtGdaEIeeGFUepojtedl6/+znVB4N6K9e/VrshVgfAkkSwJn r7IsZTbVT0ceJEu9ExfUNmbGu6YceWD0LXaZ3NTPYTXZLuc5YdgIpf3uO7osg2ypQZ5E uWQw== 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 f8si12542746edv.198.2019.09.12.06.48.20; Thu, 12 Sep 2019 06:48:44 -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 S1732273AbfILNom (ORCPT + 99 others); Thu, 12 Sep 2019 09:44:42 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:18744 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732179AbfILNol (ORCPT ); Thu, 12 Sep 2019 09:44:41 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x8CDgOHM044345; Thu, 12 Sep 2019 09:44:22 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 2uynr63kkr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Sep 2019 09:44:22 -0400 Received: from m0098394.ppops.net (m0098394.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.27/8.16.0.27) with SMTP id x8CDgjqP045448; Thu, 12 Sep 2019 09:44:22 -0400 Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0a-001b2d01.pphosted.com with ESMTP id 2uynr63kjr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Sep 2019 09:44:21 -0400 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x8CDhYDB006998; Thu, 12 Sep 2019 13:44:20 GMT Received: from b03cxnp08027.gho.boulder.ibm.com (b03cxnp08027.gho.boulder.ibm.com [9.17.130.19]) by ppma03dal.us.ibm.com with ESMTP id 2uv468xxmb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Sep 2019 13:44:20 +0000 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x8CDiJb821954972 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 12 Sep 2019 13:44:19 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 44532136051; Thu, 12 Sep 2019 13:44:19 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B159513605D; Thu, 12 Sep 2019 13:44:16 +0000 (GMT) Received: from [9.199.32.243] (unknown [9.199.32.243]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP; Thu, 12 Sep 2019 13:44:16 +0000 (GMT) Subject: Re: [PATCH 0/3] powerpc/mm: Conditionally call H_BLOCK_REMOVE To: Laurent Dufour , mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org, npiggin@gmail.com Cc: linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20190830120712.22971-1-ldufour@linux.ibm.com> From: "Aneesh Kumar K.V" Message-ID: <1c499131-36f2-9d89-ed4c-5cb59a08398d@linux.ibm.com> Date: Thu, 12 Sep 2019 19:14:15 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190830120712.22971-1-ldufour@linux.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-09-12_06:,, 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-1906280000 definitions=main-1909120144 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/30/19 5:37 PM, Laurent Dufour wrote: > 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. > So ibm,segment-page-sizes indicates wether we support a combination of base page size and actual page size. You are suggesting that the value reported by that is not correct? Can you also share the early part of dmesg as below. [ 0.000000] hash-mmu: Page sizes from device-tree: [ 0.000000] hash-mmu: base_shift=12: shift=12, sllp=0x0000, avpnm=0x00000000, tlbiel=1, penc=0 [ 0.000000] hash-mmu: base_shift=12: shift=16, sllp=0x0000, avpnm=0x00000000, tlbiel=1, penc=7 [ 0.000000] hash-mmu: base_shift=12: shift=24, sllp=0x0000, avpnm=0x00000000, tlbiel=1, penc=56 [ 0.000000] hash-mmu: base_shift=16: shift=16, sllp=0x0110, avpnm=0x00000000, tlbiel=1, penc=1 [ 0.000000] hash-mmu: base_shift=16: shift=24, sllp=0x0110, avpnm=0x00000000, tlbiel=1, penc=8 [ 0.000000] hash-mmu: base_shift=24: shift=24, sllp=0x0100, avpnm=0x00000001, tlbiel=0, penc=0 [ 0.000000] hash-mmu: base_shift=34: shift=34, sllp=0x0120, avpnm=0x000007ff, tlbiel=0, penc=3 That shows different base page size and actual page size combination. > 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(-) > -aneesh