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 AF32AC2BC84 for ; Fri, 4 Sep 2020 08:42:46 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3B1E7206B7 for ; Fri, 4 Sep 2020 08:42:45 +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="bRJM5iiP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3B1E7206B7 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 5E5F28E0001; Fri, 4 Sep 2020 04:42:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 596456B006E; Fri, 4 Sep 2020 04:42:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 45FAC8E0001; Fri, 4 Sep 2020 04:42:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0229.hostedemail.com [216.40.44.229]) by kanga.kvack.org (Postfix) with ESMTP id 2F3D36B0002 for ; Fri, 4 Sep 2020 04:42:45 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id E7AFF8245571 for ; Fri, 4 Sep 2020 08:42:44 +0000 (UTC) X-FDA: 77224738248.19.drop21_580ba9c270b0 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin19.hostedemail.com (Postfix) with ESMTP id B9F271AD1BA for ; Fri, 4 Sep 2020 08:42:44 +0000 (UTC) X-HE-Tag: drop21_580ba9c270b0 X-Filterd-Recvd-Size: 7126 Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com [216.71.145.153]) by imf29.hostedemail.com (Postfix) with ESMTP for ; Fri, 4 Sep 2020 08:42:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1599208964; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=xLTKJpKu0Qb9zvtBCrFuNtN0uryK+Cr91K+kobkwuTU=; b=bRJM5iiPIKl+tE2VIHsJnJCoF3CLsHcWlkd8qDNgtFzxxHq36BTnmssE g+ZmurFaC6LK1S6Jn/ZftPPuohgKe8TkPfIpOYgzWCS8Y5EvYSGwxQizo 7Cyn+CrNeBnGLw4KFFC0drlB7nc0EVVCSNbmRZsW8XDeuB3VfajDnIics 0=; Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: h5tULVCP7TU027wl9AXL6ZQ6VRDTloWxNR1nakHosYYzU8awVMN14syMLQayv9uBc8sCFQrpo9 MPsKynxlrUeIV2fLzkBXNB2LUVlnfaK5CMhGyHMRLQdBCX/4b+icfvHWVHnKE5oWjtKeDrh1Vt bxXRH4/LS58XLNlEMXW3QOoEhr480K9hH8A115xIrprTnfo3A9FB8sMcgG1DSn17YgpLbZzhqS 8hNixQHRV8a/451xr8mSb/Ts/liLTz0NYAxGPT2Wdtw9MukJ2GIKcdJVYScDS0jHAxjENA9Gp1 +EE= X-SBRS: 2.7 X-MesageID: 26001821 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.76,389,1592884800"; d="scan'208";a="26001821" Date: Fri, 4 Sep 2020 10:42:29 +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: <20200904084229.GN753@Air-de-Roger> References: <20200901083326.21264-1-roger.pau@citrix.com> <20200901083326.21264-4-roger.pau@citrix.com> <20200903163837.GM753@Air-de-Roger> <6fd73d30-5525-7f00-1e9c-d7bb96ea34a6@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: <6fd73d30-5525-7f00-1e9c-d7bb96ea34a6@suse.com> X-ClientProxiedBy: AMSPEX02CAS01.citrite.net (10.69.22.112) To FTLPEX02CL06.citrite.net (10.13.108.179) X-Rspamd-Queue-Id: B9F271AD1BA X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 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 Fri, Sep 04, 2020 at 09:00:18AM +0200, J=C3=BCrgen Gro=C3=9F wrote: > On 03.09.20 18:38, Roger Pau Monn=C3=A9 wrote: > > 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 i= n > > > > order to create struct pages and kernel virtual mappings for the = IOMEM > > > > 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-pl= ace > > > > replacement of the callers. Once a memory region has been added t= o be > > > > used as scratch mapping space it will no longer be released, and = pages > > > > returned are kept in a linked list. This allows to have a buffer = of > > > > pages and prevents resorting to frequent additions and removals o= f > > > > regions. > > > >=20 > > > > If enabled (because ZONE_DEVICE is supported) the usage of the ne= w > > > > functionality untangles Xen balloon and RAM hotplug from the usag= e of > > > > unpopulated physical memory ranges to map foreign pages, which is= the > > > > correct thing to do in order to avoid mappings of foreign pages d= epend > > > > 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 platfo= rms. > > > >=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:1= 9: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-off= sets.c:9: > > > /home/gross/korg/src/include/linux/page-flags-layout.h:95:2: error:= #error > > > "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 > >=20 > > 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. > >=20 > > You can trigger something similar on x86-64 by doing: > >=20 > > $ 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 > >=20 > > WARNING: unmet direct dependencies detected for ZONE_DEVICE > > Depends on [n]: MEMORY_HOTPLUG [=3Dy] && MEMORY_HOTREMOVE [=3Dn] &= & SPARSEMEM_VMEMMAP [=3Dy] && ARCH_HAS_PTE_DEVMAP [=3Dy] > > Selected by [y]: > > - XEN_UNPOPULATED_ALLOC [=3Dy] && XEN [=3Dy] && X86_64 [=3Dy] > > # > > # configuration written to .config > > # > >=20 > > I think the only solution is to have XEN_UNPOPULATED_ALLOC depend on > > ZONE_DEVICE rather than select it? >=20 > Yes, I think so. >=20 > I've folded that in and now build is fine. Thanks, I assume no further action is needed on my side. Roger.