Received: by 10.223.164.221 with SMTP id h29csp1136203wrb; Thu, 26 Oct 2017 13:05:52 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QyACzRcFNLOGNNrh9FL/fHmD6+nOXyJpPQmpM3uj40aWXQIARNtlHVjNBZeDuPIHKxhvm/ X-Received: by 10.84.213.9 with SMTP id f9mr5080781pli.76.1509048352225; Thu, 26 Oct 2017 13:05:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509048352; cv=none; d=google.com; s=arc-20160816; b=NJlhBGeSZDn2O8zGwdUby8iIRyhoeKRzdJw77OyHzspGy+MW85sIInUpml32ZkwX2s Jpa5XFKgQhORs4lUprwVZejWgoPzjgQVgQan2DZ8cUZ6c5/+FQJp0lW9y4Juz9AOGF8W KGpRm3kCGMh+EsJqKhAj7cGI6PMC3D8HUO/4KfepD9WTXQ/bsX/IBMsD9lBMfZajD5lS gfgkZo6g8wV1pQUn2Le9wY0Wor+IOs8Fp8SlVQM5WFD/pFr9MJkKC8BBhZk9lqLekdFR TftP6WuRYtnVhH4n5e/sL1fVtKapd8kUhz/RopckEWbn8fLNVvSN/4xk2apQEUhl/QNh G5QA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=2zM9PY6WKJT75nf+WnGkEIBpnQt8vkQMIbNa0dnlLpo=; b=liECCtsrLd4YT/mOxA+fmFNvBQVT6S0D3iauBJXAQvHOvpOm4xPX6mjl2vYciT6Y65 vwpAtfY+klUvx3OeeKRPINMcdgl7BcdOI5wmd+FtGCsoNL39DlE78AQroHy/rQ+c5aii Ci9MNBWJX/4X09a0E4dXwXXuvp1Y6j+a9zKrz0mpeWpACcJITmavbdRJz6u/4XkZBDEY jTfooA+RZwPVf0Rx/md42wS3y7HxtYjhbtmmfZd6U0Ph+ItoPFG8KOj/PDhr3VckRkT9 pp9kLgXbfXEJpp1X5hN/uibo9IEXs7ZozIpiDZVZ04IxJw4tlqA+wFk0qLslS7WbBjzK NQYA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s9si4106640pfa.474.2017.10.26.13.05.38; Thu, 26 Oct 2017 13:05:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751651AbdJZUDO (ORCPT + 99 others); Thu, 26 Oct 2017 16:03:14 -0400 Received: from smtp.citrix.com.au ([103.14.252.240]:62494 "EHLO SMTP.CITRIX.COM.AU" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751263AbdJZUDN (ORCPT ); Thu, 26 Oct 2017 16:03:13 -0400 X-IronPort-AV: E=Sophos;i="5.44,301,1505779200"; d="scan'208";a="106522233" Subject: Re: [Xen-devel] ce56a86e2a ("x86/mm: Limit mmap() of /dev/mem to valid physical addresses"): kernel BUG at arch/x86/mm/physaddr.c:79! To: Craig Bergstrom CC: Sander Eikelenboom , Ingo Molnar , Linus Torvalds , , Xen-devel , , Boris Ostrovsky , Fengguang Wu , LKP , Juergen Gross 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> <207b6a75-2eff-8e92-d50c-ec2022fddbf9@eikelenboom.it> From: Andrew Cooper Message-ID: <19584771-c653-5327-b126-3f494ad5717f@citrix.com> Date: Thu, 26 Oct 2017 21:01:00 +0100 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: <207b6a75-2eff-8e92-d50c-ec2022fddbf9@eikelenboom.it> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Content-Language: en-GB X-ClientProxiedBy: AMSPEX02CAS02.citrite.net (10.69.22.113) To AMSPEX02CL02.citrite.net (10.69.22.126) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 26/10/17 20:29, Sander Eikelenboom wrote: > 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). dom0_mem=2048M,max:2048M is used to describe how much RAM the guest has, not its maximum address.  (Whether this is how PVops actually interprets the information and passes it into Linux is a different matter.  I will have to defer to Boris/Juergen on that side of things.) For RAM, PV guests will get a scattering of frames wherever Xen chooses to allocate them, and are likely to not be contiguous or adjacent. For devices, PV guests do get mappings to the real system BARs, which will be the real low and high MMIO holes. ~Andrew From 1582350977146157131@xxx Thu Oct 26 19:51:26 +0000 2017 X-GM-THRID: 1582105239086831553 X-Gmail-Labels: Inbox,Category Forums