From patchwork Wed Jan 10 04:53:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 857937 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zGcBv0ssMz9s7M for ; Wed, 10 Jan 2018 15:55:19 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3zGcBt6y8yzF0fb for ; Wed, 10 Jan 2018 15:55:18 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=linux.vnet.ibm.com (client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com; envelope-from=khandual@linux.vnet.ibm.com; receiver=) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3zGc951pN8zF0dn for ; Wed, 10 Jan 2018 15:53:44 +1100 (AEDT) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w0A4mjf1115467 for ; Tue, 9 Jan 2018 23:53:41 -0500 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0b-001b2d01.pphosted.com with ESMTP id 2fd6eaw8qm-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 09 Jan 2018 23:53:41 -0500 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 10 Jan 2018 04:53:40 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 10 Jan 2018 04:53:38 -0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w0A4rc8431850690; Wed, 10 Jan 2018 04:53:38 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 30A054C046; Wed, 10 Jan 2018 04:47:56 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BB9B14C04A; Wed, 10 Jan 2018 04:47:54 +0000 (GMT) Received: from localhost.in.ibm.com (unknown [9.79.222.38]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 10 Jan 2018 04:47:54 +0000 (GMT) From: Anshuman Khandual To: linuxppc-dev@lists.ozlabs.org Subject: [RFC] powerpc/mm: Enable TLB flush during native_register_proc_table() Date: Wed, 10 Jan 2018 10:23:33 +0530 X-Mailer: git-send-email 2.9.3 X-TM-AS-GCONF: 00 x-cbid: 18011004-0020-0000-0000-000003E8E250 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18011004-0021-0000-0000-0000427B04CD Message-Id: <20180110045333.10550-1-khandual@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-01-10_03:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801100066 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: aneesh.kumar@linux.vnet.ibm.com Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" From: Anshuman Khandual Any changes to the partition table must be followed by appropriate TLB flush which is not happening at present in native_register_proc_table() path. Fix this by calling mmu_partition_table_set_entry() which does take care of TLB flushing after the partition table update. Signed-off-by: Anshuman Khandual --- - From code inspection - Compile, boot tested without CONFIG_PPC_RADIX_MMU - Though it seems to be not getting called from any where arch/powerpc/mm/hash_native_64.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/mm/hash_native_64.c b/arch/powerpc/mm/hash_native_64.c index 640cf56..89be5a6 100644 --- a/arch/powerpc/mm/hash_native_64.c +++ b/arch/powerpc/mm/hash_native_64.c @@ -758,12 +758,14 @@ static void native_flush_hash_range(unsigned long number, int local) static int native_register_proc_table(unsigned long base, unsigned long page_size, unsigned long table_size) { - unsigned long patb1 = base << 25; /* VSID */ + unsigned long patb0, patb1; + patb1 = base << 25; /* VSID */ patb1 |= (page_size << 5); /* sllp */ patb1 |= table_size; - partition_tb->patb1 = cpu_to_be64(patb1); + patb0 = be64_to_cpu(partition_tb[0].patb0); + mmu_partition_table_set_entry(0, patb0, patb1); return 0; }