Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp293056ybe; Thu, 12 Sep 2019 20:31:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqy3FE6z7quQfykyMPKDQg6Habi0IKZ0jiS4TecgwYlBFD6cpxCjC3i4dK29Ovi1h97cykB4 X-Received: by 2002:a17:906:d922:: with SMTP id rn2mr36893581ejb.169.1568345512133; Thu, 12 Sep 2019 20:31:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568345512; cv=none; d=google.com; s=arc-20160816; b=GFXQLHXV8iFu7o0iezUdlasu5cDzhuNG3lYEkY0nwGQsTHBIn/tBe1xnlKLo+me3xv SvwOykN8fqlpchXuGcktDNsnVgzyT4I9lbTzIU8m/JEngG5LTkFCTqwigcl+N8RHiKij 3OyoRX66EgiuJHWWq2SvGkXhuODnQjEKN2KHBuapKJSMFcVHZEoxyE0bCJvDzOkB6eh/ 386RK58/bGrZHVbpG7kOLrU3CV0odKfqyLDgNrImQHiy5Wv8RAszs9W13Ey/qCE6xNLt Ie243mtky9DSqgjfs3EIvj5PQeSqCwsYYA35y0BsX4w/CpGXS24Tb9KyuKuxlADNzPIg xipQ== 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=ZM5vPOX6nGeVogVlis0rbi7FOlw/+N5xH5YmO/LDba8=; b=C6O6+2nHcXnsk8fqZGYFrSTYhzk8L9kqheARHLf6m7lVBiAKFQip0/3I6OQeJsq+3R OdsKEAeeHmooG/j5Wy+hVF3ZaE5JoC5l8nsSik3eRAhnArQu+CVP607qXwfV7RgnOeuF P40fY+Y6IJGQJlcEMVRpt0HQ9vj5RjFbjKd1B+gC8eiY500E/sYYhX0LoJBz2O/tMeSn qfxjKQjDPjiX6XdqQqpQnUj13KP+hanrsKnmMztlIp/SWmBtkPPnERJLVr9tgdznlBeL lLwPn5rUx2GIj53Feu9hTmbelC5m4hA8ZNYpgKRWlB90Chv/1IMqX65xshiObhG+275o QM6A== 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 n25si15502215edq.32.2019.09.12.20.30.55; Thu, 12 Sep 2019 20:31:52 -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 S1727104AbfIMCBR (ORCPT + 99 others); Thu, 12 Sep 2019 22:01:17 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:6776 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726262AbfIMCBR (ORCPT ); Thu, 12 Sep 2019 22:01:17 -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 x8D1ud3I117254; Thu, 12 Sep 2019 22:00:50 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 2uywn4xv48-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Sep 2019 22:00:50 -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 x8D1vR0D124274; Thu, 12 Sep 2019 22:00:49 -0400 Received: from ppma03wdc.us.ibm.com (ba.79.3fa9.ip4.static.sl-reverse.com [169.63.121.186]) by mx0a-001b2d01.pphosted.com with ESMTP id 2uywn4xv3h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Sep 2019 22:00:49 -0400 Received: from pps.filterd (ppma03wdc.us.ibm.com [127.0.0.1]) by ppma03wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x8D1sm19022449; Fri, 13 Sep 2019 02:00:48 GMT Received: from b03cxnp07028.gho.boulder.ibm.com (b03cxnp07028.gho.boulder.ibm.com [9.17.130.15]) by ppma03wdc.us.ibm.com with ESMTP id 2uytdx37je-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 13 Sep 2019 02:00:48 +0000 Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x8D20lSw46858692 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 13 Sep 2019 02:00:47 GMT Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1E896BE058; Fri, 13 Sep 2019 02:00:47 +0000 (GMT) Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7F809BE04F; Fri, 13 Sep 2019 02:00:44 +0000 (GMT) Received: from [9.199.46.176] (unknown [9.199.46.176]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTP; Fri, 13 Sep 2019 02:00:44 +0000 (GMT) Subject: Re: [PATCH 2/3] powperc/mm: read TLB Block Invalidate Characteristics 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> <20190830120712.22971-3-ldufour@linux.ibm.com> <87impxshfk.fsf@linux.ibm.com> <468a53a6-a970-5526-8035-eef59dcf48ed@linux.ibm.com> From: "Aneesh Kumar K.V" Message-ID: <97bafb53-6ae9-1d42-1816-ef81b845b80c@linux.ibm.com> Date: Fri, 13 Sep 2019 07:30:42 +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: <468a53a6-a970-5526-8035-eef59dcf48ed@linux.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-09-13_01:,, 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=856 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1909130019 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/13/19 12:56 AM, Laurent Dufour wrote: > Le 12/09/2019 à 16:44, Aneesh Kumar K.V a écrit : >> Laurent Dufour writes: >>> + >>> +    idx = 2; >>> +    while (idx < len) { >>> +        unsigned int block_size = local_buffer[idx++]; >>> +        unsigned int npsize; >>> + >>> +        if (!block_size) >>> +            break; >>> + >>> +        block_size = 1 << block_size; >>> +        if (block_size != 8) >>> +            /* We only support 8 bytes size TLB invalidate buffer */ >>> +            pr_warn("Unsupported H_BLOCK_REMOVE block size : %d\n", >>> +                block_size); >> >> Should we skip setting block size if we find block_size != 8? Also can >> we avoid doing that pr_warn in loop and only warn if we don't find >> block_size 8 in the invalidate characteristics array? > > My idea here is to fully read and process the data returned by the > hcall, and to put the limitation to 8 when checking before calling > H_BLOCK_REMOVE. > The warning is there because I want it to be displayed once at boot. > Can we have two block size reported for the same base page size/actual page size combination? If so we will overwrite the hblk[actual_psize] ? >> >>> + >>> +        for (npsize = local_buffer[idx++];  npsize > 0; npsize--) >>> +            check_lp_set_hblk((unsigned int) local_buffer[idx++], >>> +                      block_size); >>> +    } >>> + >>> +    for (bpsize = 0; bpsize < MMU_PAGE_COUNT; bpsize++) >>> +        for (idx = 0; idx < MMU_PAGE_COUNT; idx++) >>> +            if (mmu_psize_defs[bpsize].hblk[idx]) >>> +                pr_info("H_BLOCK_REMOVE supports base psize:%d >>> psize:%d block size:%d", >>> +                    bpsize, idx, >>> +                    mmu_psize_defs[bpsize].hblk[idx]); >>> + >>> +    return 0; >>> +} >>> +machine_arch_initcall(pseries, read_tlbbi_characteristics); >>> + >>>   /* >>>    * Take a spinlock around flushes to avoid bouncing the hypervisor >>> tlbie >>>    * lock. -aneesh