From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 852D8C433E9 for ; Thu, 3 Sep 2020 16:38:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3446620578 for ; Thu, 3 Sep 2020 16:38:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="ZAd2L47Q" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3446620578 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A208D6B0037; Thu, 3 Sep 2020 12:38:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9F4686B005A; Thu, 3 Sep 2020 12:38:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 90A386B005C; Thu, 3 Sep 2020 12:38:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0057.hostedemail.com [216.40.44.57]) by kanga.kvack.org (Postfix) with ESMTP id 7B6AF6B0037 for ; Thu, 3 Sep 2020 12:38:51 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 469AA181AC9CC for ; Thu, 3 Sep 2020 16:38:51 +0000 (UTC) X-FDA: 77222309262.29.pull25_3102cdf270ab Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin29.hostedemail.com (Postfix) with ESMTP id E117B18086581 for ; Thu, 3 Sep 2020 16:38:50 +0000 (UTC) X-HE-Tag: pull25_3102cdf270ab X-Filterd-Recvd-Size: 6461 Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com [216.71.155.144]) by imf23.hostedemail.com (Postfix) with ESMTP for ; Thu, 3 Sep 2020 16:38:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1599151130; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=1r9p2+RFoF3u+hOb93ac0ysyr0EJPEppHknwa791fSA=; b=ZAd2L47QLFUhj59M/Dd23pf5UsnVqcnv1kPED2avbqR9o9DvYq5DkR2T JX7oMcWTlDwFqL7Q10rBW4QeNV8y6uyaFPE7YZnGA7ewdgpfDPVA24hak pCB9oeDvJu0gI/L1bSnVy/0RDQ0mpdgxkbHUKDmPAs9NjEGk17Se4j6p2 g=; Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: n1UBm6NTmzRoEEmp6chXaBm2JeGlv1UPeWW4NcDpE6MmwKaEEug3qgxA4LMjLaJkfVteFGd+aK UyQpDEBtpjDgR7UYwd0Jg33GV7o86inlKKFgsaaHyJNUflCzFSfwopxMOWerSgF0XhG9sEzEfL 4RRD4RotP+qyYV2hpJYsl3r0gsfqUIOsSdH5lSVHXWp122/oY9ooFXECyGx/srx7sfWn8zfJG2 vY03kGbKprm5mmB9gPqzwmUs7bHHXQflmjbxrqlmteL5zA03CFuteALBCgRnmyTsXmwaj14XY0 bkc= X-SBRS: 2.7 X-MesageID: 26904079 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.76,387,1592884800"; d="scan'208";a="26904079" Date: Thu, 3 Sep 2020 18:38:37 +0200 From: Roger Pau =?utf-8?B?TW9ubsOp?= To: =?utf-8?B?SsO8cmdlbiBHcm/Dnw==?= CC: , Oleksandr Andrushchenko , David Airlie , "Daniel Vetter" , Boris Ostrovsky , Stefano Stabellini , Dan Carpenter , Wei Liu , Yan Yankovskyi , , , , David Hildenbrand , Michal Hocko , Dan Williams Subject: Re: [PATCH v5 3/3] xen: add helpers to allocate unpopulated memory Message-ID: <20200903163837.GM753@Air-de-Roger> References: <20200901083326.21264-1-roger.pau@citrix.com> <20200901083326.21264-4-roger.pau@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: AMSPEX02CAS02.citrite.net (10.69.22.113) To FTLPEX02CL06.citrite.net (10.13.108.179) X-Rspamd-Queue-Id: E117B18086581 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Sep 03, 2020 at 05:30:07PM +0200, J=C3=BCrgen Gro=C3=9F wrote: > On 01.09.20 10:33, Roger Pau Monne wrote: > > To be used in order to create foreign mappings. This is based on the > > ZONE_DEVICE facility which is used by persistent memory devices in > > order to create struct pages and kernel virtual mappings for the IOME= M > > areas of such devices. Note that on kernels without support for > > ZONE_DEVICE Xen will fallback to use ballooned pages in order to > > create foreign mappings. > >=20 > > The newly added helpers use the same parameters as the existing > > {alloc/free}_xenballooned_pages functions, which allows for in-place > > replacement of the callers. Once a memory region has been added to be > > used as scratch mapping space it will no longer be released, and page= s > > returned are kept in a linked list. This allows to have a buffer of > > pages and prevents resorting to frequent additions and removals of > > regions. > >=20 > > If enabled (because ZONE_DEVICE is supported) the usage of the new > > functionality untangles Xen balloon and RAM hotplug from the usage of > > unpopulated physical memory ranges to map foreign pages, which is the > > correct thing to do in order to avoid mappings of foreign pages depen= d > > on memory hotplug. > >=20 > > Note the driver is currently not enabled on Arm platforms because it > > would interfere with the identity mapping required on some platforms. > >=20 > > Signed-off-by: Roger Pau Monn=C3=A9 >=20 > Sorry, I just got a build error for x86 32-bit build: >=20 > WARNING: unmet direct dependencies detected for ZONE_DEVICE > Depends on [n]: MEMORY_HOTPLUG [=3Dn] && MEMORY_HOTREMOVE [=3Dn] && > SPARSEMEM_VMEMMAP [=3Dn] && ARCH_HAS_PTE_DEVMAP [=3Dn] > Selected by [y]: > - XEN_UNPOPULATED_ALLOC [=3Dy] && XEN [=3Dy] && X86 [=3Dy] > GEN Makefile > CC kernel/bounds.s > CALL /home/gross/korg/src/scripts/atomic/check-atomics.sh > UPD include/generated/bounds.h > CC arch/x86/kernel/asm-offsets.s > In file included from /home/gross/korg/src/include/linux/mmzone.h:19:0, > from /home/gross/korg/src/include/linux/gfp.h:6, > from /home/gross/korg/src/include/linux/slab.h:15, > from /home/gross/korg/src/include/linux/crypto.h:19, > from /home/gross/korg/src/arch/x86/kernel/asm-offsets.= c:9: > /home/gross/korg/src/include/linux/page-flags-layout.h:95:2: error: #er= ror > "Not enough bits in page flags" > #error "Not enough bits in page flags" > ^~~~~ > make[2]: *** [/home/gross/korg/src/scripts/Makefile.build:114: > arch/x86/kernel/asm-offsets.s] Error 1 > make[1]: *** [/home/gross/korg/src/Makefile:1175: prepare0] Error 2 > make[1]: Leaving directory '/home/gross/korg/x8632' > make: *** [Makefile:185: __sub-make] Error 2 Sorry for this. I've tested a 32bit build but I think it was before the last Kconfig changes. I'm a little unsure how to solve this, as ZONE_DEVICE doesn't select the required options for it to run, but rather depends on them to be available. You can trigger something similar on x86-64 by doing: $ make ARCH=3Dx86_64 xen.config Using .config as base Merging ./kernel/configs/xen.config Merging ./arch/x86/configs/xen.config # # merged configuration written to .config (needs make) # scripts/kconfig/conf --olddefconfig Kconfig WARNING: unmet direct dependencies detected for ZONE_DEVICE Depends on [n]: MEMORY_HOTPLUG [=3Dy] && MEMORY_HOTREMOVE [=3Dn] && SPA= RSEMEM_VMEMMAP [=3Dy] && ARCH_HAS_PTE_DEVMAP [=3Dy] Selected by [y]: - XEN_UNPOPULATED_ALLOC [=3Dy] && XEN [=3Dy] && X86_64 [=3Dy] # # configuration written to .config # I think the only solution is to have XEN_UNPOPULATED_ALLOC depend on ZONE_DEVICE rather than select it? Thanks, Roger.