From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57504) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eb9Iu-0003GE-UJ for qemu-devel@nongnu.org; Mon, 15 Jan 2018 13:16:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eb9Ir-0006Eq-RE for qemu-devel@nongnu.org; Mon, 15 Jan 2018 13:16:16 -0500 Received: from mail-pl0-x234.google.com ([2607:f8b0:400e:c01::234]:44092) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eb9Ir-0006EI-KB for qemu-devel@nongnu.org; Mon, 15 Jan 2018 13:16:13 -0500 Received: by mail-pl0-x234.google.com with SMTP id f8so2237835plk.11 for ; Mon, 15 Jan 2018 10:16:13 -0800 (PST) References: <20180113004338.16867-1-laurent@vivier.eu> <20180113004338.16867-3-laurent@vivier.eu> From: Richard Henderson Message-ID: Date: Mon, 15 Jan 2018 10:16:09 -0800 MIME-Version: 1.0 In-Reply-To: <20180113004338.16867-3-laurent@vivier.eu> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 2/7] target/m68k: add MC68040 MMU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier , qemu-devel@nongnu.org Cc: Thomas Huth On 01/12/2018 04:43 PM, Laurent Vivier wrote: > + ret = get_physical_address(&cpu->env, &physical, &prot, > + address, access_type, &page_size); > + if (ret == 0) { > + tlb_set_page(cs, address & -page_size, > + physical & -page_size, > + prot, mmu_idx, page_size); > + return 0; > + } Having raised TARGET_PAGE_BITS to 12 hasn't eliminated the tlb_add_large_page path, merely reduced it to when the OS uses 8K pages. What you'd do to eliminate it is if (ret == 0) { address &= TARGET_PAGE_MASK; physical += address & (page_size - 1); tlb_set_page(cs, address, physical, prot, mmu_idx, TARGET_PAGE_SIZE); return 0; } Note that physical is always already aligned, because we pulled it out of the page tables that way. r~