From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932444AbdJZT3O (ORCPT ); Thu, 26 Oct 2017 15:29:14 -0400 Received: from server.eikelenboom.it ([91.121.65.215]:43494 "EHLO server.eikelenboom.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751489AbdJZT3N (ORCPT ); Thu, 26 Oct 2017 15:29:13 -0400 Subject: Re: ce56a86e2a ("x86/mm: Limit mmap() of /dev/mem to valid physical addresses"): kernel BUG at arch/x86/mm/physaddr.c:79! To: Craig Bergstrom , Ingo Molnar Cc: Boris Ostrovsky , Fengguang Wu , wfg@linux.intel.com, linux-kernel@vger.kernel.org, LKP , Linus Torvalds , Xen-devel References: <20171024024439.u3ywfgvi67fe4mbg@wfg-t540p.sh.intel.com> <440615a7-6cc0-a607-ce7c-22a34b69e8fe@eikelenboom.it> <1d203c07-0595-a33a-620b-c51eea9721d1@eikelenboom.it> <8721eeac-a644-e815-55e9-5f01956dd22a@eikelenboom.it> <20171026163911.dnovh4zaik5qumtt@gmail.com> From: Sander Eikelenboom Message-ID: <207b6a75-2eff-8e92-d50c-ec2022fddbf9@eikelenboom.it> Date: Thu, 26 Oct 2017 21:29:07 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 26/10/17 19:49, Craig Bergstrom wrote: > Sander, thanks for the details, they've been very useful. > > I suspect that your host system's mem=2048M parameter is causing the > problem. Any chance you can confirm by removing the parameter and > running the guest code path? I removed it, but kept the hypervisor limiting dom0 memory to 2046M intact (in grub using the xen bootcmd: "multiboot /xen-4.10.gz dom0_mem=2048M,max:2048M ....." Unfortunately that doesn't change anything, the guest still fails to start with the same errors. > More specifically, since you're telling the kernel that it's high > memory address is at 2048M and your device is at 0xfe1fe000 (~4G), the > new mmap() limits are preventing you from mapping addresses that are > explicitly disallowed by the parameter. > Which would probably mean the current patch prohibits hard limiting the dom0 memory to a certain value (below 4G) at least in combination with PCI-passthrough. So the only thing left would be to have no hard memory restriction on dom0 and rely on auto-ballooning, but I'm not a great fan of that. I don't know how KVM handles setting memory limits for the host system, but perhaps it suffers from the same issue. I also tried the patch from one of your last mails to make the check "less strict", but still get the same errors (when using the hard memory limits). -- Sander > > On Thu, Oct 26, 2017 at 10:39 AM, Ingo Molnar wrote: >> >> * Craig Bergstrom wrote: >> >>> Yes, not much time left for 4.14, it might be reasonable to pull the >>> change out since it's causing problems. [...] >> >> Ok, I'll queue up a revert tomorrow morning and send it to Linus ASAP if there's >> no good fix by then. In hindsight I should have queued it for v4.15 ... >> >> Thanks, >> >> Ingo