Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753345Ab2HNWya (ORCPT ); Tue, 14 Aug 2012 18:54:30 -0400 Received: from va3ehsobe004.messaging.microsoft.com ([216.32.180.14]:15943 "EHLO va3outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752664Ab2HNWy1 (ORCPT ); Tue, 14 Aug 2012 18:54:27 -0400 X-Forefront-Antispam-Report: CIP:163.181.249.109;KIP:(null);UIP:(null);IPV:NLI;H:ausb3twp02.amd.com;RD:none;EFVD:NLI X-SpamScore: -5 X-BigFish: VPS-5(zzbb2dI98dI9371I148cI1432Izz1202hzz8275dhz2dh668h839h944hd25hd2bhf0ah107ah) X-WSS-ID: 0M8ROYI-02-3MT-02 X-M-MSG: Date: Tue, 14 Aug 2012 17:54:16 -0500 From: Jacob Shin To: Dave Young CC: X86-ML , LKML , Yinghai Lu , "H. Peter Anvin" , Andreas Herrmann , Tejun Heo , Borislav Petkov , Chao Wang , Vivek Goyal Subject: Re: [PATCH V2 0/5] x86: Create direct mappings for E820_RAM only Message-ID: <20120814225416.GB32453@jshin-Toonie> References: <1344894424-4434-1-git-send-email-jacob.shin@amd.com> <502A0D9F.4010509@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <502A0D9F.4010509@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-OriginatorOrg: amd.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5948 Lines: 139 On Tue, Aug 14, 2012 at 04:34:39PM +0800, Dave Young wrote: > On 08/14/2012 05:46 AM, Jacob Shin wrote: > > > Currently kernel direct mappings are created for all pfns between > > [ 0 to max_low_pfn ) and [ 4GB to max_pfn ). When we introduce memory > > holes, we end up mapping memory ranges that are not backed by physical > > DRAM. This is fine for lower memory addresses which can be marked as UC > > by fixed/variable range MTRRs, however we run in to trouble with high > > addresses. > > > > The following patchset creates direct mappings only for E820_RAM regions > > between 0 ~ max_low_pfn and 4GB ~ max_pfn. And leaves non-E820_RAM and > > memory holes unmapped. > > > Hi, > > Chaowang did some kdump test in a kvm guest with this patchset, 2nd > kenrel just reboot after some ACPI printk, see below dmesg of 2nd kernel: Hello, thanks for testing, since I have not tested under KVM .. I also have not tested passing in user supplied memory maps as your kernel log suggests. Looking into this, it seems like we get a page fault while trying to set up fixmap for the APIC. I think the fixmap is set up even before we get to setup_arch(), and it is sitting in memory that is not marked as usable by your user supplied e820. Could you give V3 a try? I just sent it out a minute ago, this version won't try to remap what has already been mapped as part of the boot process before we get to setup_arch, it'll just take what its given. > > After a crash: > [snip] > I'm in purgatory > [ 0.000000] Initializing cgroup subsys cpuset > [ 0.000000] Initializing cgroup subsys cpu > [ 0.000000] Linux version 3.5.0-0.23.el7.bz846531.x86_64 (mockbuild@) > (gcc version 4.7.1 20120720 (Red Hat 4.7.1-5) (GCC) ) #1 SMP Mon Aug 13 > 22:17:46 EDT 2012 > [ 0.000000] Command line: > BOOT_IMAGE=/vmlinuz-3.5.0-0.23.el7.bz846531.x86_64 > root=/dev/mapper/vg_none-lv_root ro rd.md=0 rd.lvm.lv=vg_none/lv_swap > rd.dm=0 rd.lvm.lv=vg_none/lv_root rd.luks=0 LANG=en_US.UTF-8 > console=ttyS0,115200 SYSFONT=True KEYTABLE=us earlyprintk=serial > irqpoll nr_cpus=1 reset_devices cgroup_disable=memory mce=off > earlyprintk=serial memmap=exactmap memmap=567K@64K > memmap=261552K@589824K elfcorehdr=851376K > [ 0.000000] e820: BIOS-provided physical RAM map: > [ 0.000000] BIOS-e820: [mem 0x0000000000000100-0x000000000009dbff] usable > [ 0.000000] BIOS-e820: [mem 0x000000000009dc00-0x000000000009ffff] > reserved > [ 0.000000] BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] > reserved > [ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000003fffdfff] usable > [ 0.000000] BIOS-e820: [mem 0x000000003fffe000-0x000000003fffffff] > reserved > [ 0.000000] BIOS-e820: [mem 0x00000000feffc000-0x00000000feffffff] > reserved > [ 0.000000] BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] > reserved > [ 0.000000] bootconsole [earlyser0] enabled > [ 0.000000] ERROR: earlyprintk= earlyser already used > [ 0.000000] e820: last_pfn = 0x3fffe max_arch_pfn = 0x400000000 > [ 0.000000] NX (Execute Disable) protection: active > [ 0.000000] e820: user-defined physical RAM map: > [ 0.000000] user: [mem 0x0000000000010000-0x000000000009dbff] usable > [ 0.000000] user: [mem 0x0000000024000000-0x0000000033f6bfff] usable > [ 0.000000] DMI 2.4 present. > [ 0.000000] No AGP bridge found > [ 0.000000] e820: last_pfn = 0x33f6c max_arch_pfn = 0x400000000 > [ 0.000000] PAT not supported by CPU. > [ 0.000000] found SMP MP-table at [mem 0x000fdae0-0x000fdaef] mapped > at [ffff8800000fdae0] > [ 0.000000] init_memory_mapping: [mem 0x24000000-0x33f6bfff] > [ 0.000000] init_memory_mapping: [mem 0x00000000-0x000fffff] > [ 0.000000] RAMDISK: [mem 0x3378a000-0x33f58fff] > [ 0.000000] ACPI: RSDP 00000000000fd980 00014 (v00 BOCHS ) > [ 0.000000] ACPI: RSDT 000000003fffe5b0 00038 (v01 BOCHS BXPCRSDT > 00000001 BXPC 00000001) > [ 0.000000] ACPI: FACP 000000003fffff80 00074 (v01 BOCHS BXPCFACP > 00000001 BXPC 00000001) > [ 0.000000] ACPI: DSDT 000000003fffe5f0 01121 (v01 BXPC BXDSDT > 00000001 INTL 20100528) > [ 0.000000] ACPI: FACS 000000003fffff40 00040 > [ 0.000000] ACPI: SSDT 000000003ffffea0 0009E (v01 BOCHS BXPCSSDT > 00000001 BXPC 00000001) > [ 0.000000] ACPI: APIC 000000003ffffdb0 00078 (v01 BOCHS BXPCAPIC > 00000001 BXPC 00000001) > [ 0.000000] ACPI: HPET 000000003ffffd70 00038 (v01 BOCHS BXPCHPET > 00000001 BXPC 00000001) > [ 0.000000] ACPI: SSDT 000000003ffff720 00644 (v01 BXPC BXSSDTPC > 00000001 INTL 20100528) > > ====2nd kernel reboot here===== > > > > > > This revision of the patchset attempts to resolve comments and concerns > > from the following threads: > > > > https://lkml.org/lkml/2012/8/11/95 > > > > and > > > > https://lkml.org/lkml/2011/12/16/486 > > > > Jacob Shin (5): > > x86: Only direct map addresses that are marked as E820_RAM > > x86: find_early_table_space based on memory ranges that are being > > mapped > > x86: Keep track of direct mapped pfn ranges > > x86: Fixup code testing if a pfn is direct mapped > > x86: Move enabling of PSE and PGE out of init_memory_mapping > > > > arch/x86/include/asm/page_types.h | 9 +++ > > arch/x86/kernel/amd_gart_64.c | 4 +- > > arch/x86/kernel/cpu/amd.c | 6 +- > > arch/x86/kernel/setup.c | 118 ++++++++++++++++++++++++++++++++----- > > arch/x86/mm/init.c | 72 +++++++++++----------- > > arch/x86/mm/init_64.c | 3 +- > > arch/x86/platform/efi/efi.c | 8 +-- > > arch/x86/platform/efi/efi_64.c | 2 + > > 8 files changed, 157 insertions(+), 65 deletions(-) > > > > > > -- > Thanks > Dave > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/