Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965815AbcDMJfZ (ORCPT ); Wed, 13 Apr 2016 05:35:25 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:35999 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965471AbcDMJfW (ORCPT ); Wed, 13 Apr 2016 05:35:22 -0400 Date: Wed, 13 Apr 2016 11:35:17 +0200 From: Ingo Molnar To: Toshi Kani Cc: bp@suse.de, hpa@zytor.com, tglx@linutronix.de, ying.huang@linux.intel.com, x86@kernel.org, xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, David Vrabel Subject: Re: [PATCH v2] x86/mm/pat: Fix BUG_ON in mmap_mem on QEMU/i386 Message-ID: <20160413093517.GA3273@gmail.com> References: <1460403360-25441-1-git-send-email-toshi.kani@hpe.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1460403360-25441-1-git-send-email-toshi.kani@hpe.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1726 Lines: 55 * Toshi Kani wrote: > The following BUG_ON error was reported on QEMU/i386: > > kernel BUG at arch/x86/mm/physaddr.c:79! > Call Trace: > phys_mem_access_prot_allowed > mmap_mem > ? mmap_region > mmap_region > do_mmap > vm_mmap_pgoff > SyS_mmap_pgoff > do_int80_syscall_32 > entry_INT80_32 > > after commit edfe63ec97ed ("x86/mtrr: Fix Xorg crashes in > Qemu sessions"). > > PAT is now set to disabled state when MTRRs are disabled. > Thus, reactivating the __pa(high_memory) check in > phys_mem_access_prot_allowed(). > > When CONFIG_DEBUG_VIRTUAL is set, __pa() calls __phys_addr(), > which in turn calls slow_virt_to_phys() for 'high_memory'. > Because 'high_memory' is set to (the max direct mapped virt > addr + 1), it is not a valid virtual address. Hence, > slow_virt_to_phys() returns 0 and hit the BUG_ON. Using > __pa_nodebug() instead of __pa() will fix this BUG_ON. > > However, this code block, originally written for Pentiums and > earlier, is no longer adequate since a 32-bit Xen guest has > MTRRs disabled and supports ZONE_HIGHMEM. In this setup, > this code sets UC attribute for accessing RAM in high memory > range. > > Delete this code block as it has been unused for a long time. > > Reported-by: kernel test robot > Link: https://lkml.org/lkml/2016/4/1/608 > Signed-off-by: Toshi Kani > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: H. Peter Anvin > Cc: Borislav Petkov > Cc: David Vrabel So you missed the Reviewed-by tag from Boris ... I've added it, but please try to propagate tags! Thanks, Ingo