From mboxrd@z Thu Jan 1 00:00:00 1970 Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 04 Aug 2014 12:09:02 +0200 (CEST) Received: from mailapp01.imgtec.com ([195.59.15.196]:35432 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org with ESMTP id S6860164AbaHDKI6NijZs (ORCPT ); Mon, 4 Aug 2014 12:08:58 +0200 Received: from KLMAIL01.kl.imgtec.org (unknown [192.168.5.35]) by Websense Email Security Gateway with ESMTPS id EBD3E110E0E77; Mon, 4 Aug 2014 11:08:48 +0100 (IST) Received: from LEMAIL01.le.imgtec.org (192.168.152.62) by KLMAIL01.kl.imgtec.org (192.168.5.35) with Microsoft SMTP Server (TLS) id 14.3.195.1; Mon, 4 Aug 2014 11:08:51 +0100 Received: from [192.168.154.101] (192.168.154.101) by LEMAIL01.le.imgtec.org (192.168.152.62) with Microsoft SMTP Server (TLS) id 14.3.195.1; Mon, 4 Aug 2014 11:08:50 +0100 Message-ID: <53DF5BB2.70502@imgtec.com> Date: Mon, 4 Aug 2014 11:08:50 +0100 From: James Hogan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Aurelien Jarno , David Daney CC: Huacai Chen , James Hogan , "Linux MIPS Mailing List" , Ralf Baechle , John Crispin , "Steven J. Hill" , Fuxin Zhang , Zhangjin Wu , Binbin Zhou , stable Subject: Re: [PATCH] MIPS: tlbex: fix a missing statement for HUGETLB References: <1406616880-17142-1-git-send-email-chenhc@lemote.com> <2357839.vPXx615ci5@radagast> <53D9674E.4000507@caviumnetworks.com> <53D99854.8090109@caviumnetworks.com> <53DA2E66.20200@imgtec.com> <53DA7E03.9090306@caviumnetworks.com> <20140802213538.GC19066@hall.aurel32.net> In-Reply-To: <20140802213538.GC19066@hall.aurel32.net> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.154.101] Return-Path: X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0) X-Orcpt: rfc822;linux-mips@linux-mips.org Original-Recipient: rfc822;linux-mips@linux-mips.org X-archive-position: 41873 X-ecartis-version: Ecartis v1.0.0 Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org X-original-sender: james.hogan@imgtec.com Precedence: bulk List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: linux-mips X-List-ID: linux-mips List-subscribe: List-owner: List-post: List-archive: X-list: linux-mips Hi Aurelien, On 02/08/14 22:35, Aurelien Jarno wrote: > On Thu, Jul 31, 2014 at 10:33:55AM -0700, David Daney wrote: >> diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c >> index f99ec587..341add1 100644 >> --- a/arch/mips/mm/tlbex.c >> +++ b/arch/mips/mm/tlbex.c >> @@ -1299,6 +1299,8 @@ static void build_r4000_tlb_refill_handler(void) >> } >> #ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT >> uasm_l_tlb_huge_update(&l, p); >> + if (!use_bbit_insns()) >> + UASM_i_LW(&p, K0, 0, K1); >> build_huge_update_entries(&p, htlb_info.huge_pte, K1); >> build_huge_tlb_write_entry(&p, &l, &r, K0, tlb_random, >> htlb_info.restore_scratch); > > This patch fixes the issue, thanks. That said it doesn't look fully > correct. The test should be done the same way as for > build_fast_tlb_refill_handler. For example the fast handler is not > called on a 32-bit machine with bbit instructions, so it would need > to reload K0. In the non fast case build_is_huge_pte() will still use bbit1 if available after restoring K0, and I don't think the bbit1 would clobber K0 when the branch is taken, so I think the test for !use_bbit_insns() is correct. Cheers James