Skip to contentSkip to conversation

s390x: Initialize the physical allocator on mem init

PATCH Janosch Frank 1 participant 1 message Jan 10, 2019 1 message not in the archive s390

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --9E2b638198oW6pE5cesTJaZ9avOFVKzic
Content-Type: multipart/mixed; boundary="vSo1VGj4JiBefk7qs9sT7b1BXEUmEYHtw";
protected-headers="v1"
From: Janosch Frank <[email protected]>
To: David Hildenbrand <[email protected]>, [email protected]
Cc: [email protected], [email protected]
Message-ID: <[email protected]>
Subject: Re: [kvm-unit-tests PATCH] s390x: Initialize the physical allocator
on mem init
References: <[email protected]>
<[email protected]>
In-Reply-To: <[email protected]>

--vSo1VGj4JiBefk7qs9sT7b1BXEUmEYHtw
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable

Quoted 20 lines · David Hildenbrand
Quoted 19 lines · Janosch Frank

The physical and virtual allocators can coexist, so we can initialize the former and allocate pages without breaking VM alloc.

---
 lib/s390x/sclp.c | 9 +++++++++
 1 file changed, 9 insertions(+)
lib/s390x/sclp.c +1 -0
index e14f25d..52be655 100644
@@ -18,6 +18,7 @@
 #include <asm/spinlock.h>
 #include "sclp.h"
 #include <alloc_phys.h>
+#include <alloc_page.h>

=20
extern unsigned long stacktop;

Quoted 8 lines

lib/s390x/sclp.c

Quoted 6 lines

=20

lib/s390x/sclp.c +0 -0
@@ -31,9 +32,17 @@ static struct spinlock sclp_lock;

=20
static void mem_init(phys_addr_t mem_end)
{

lib/s390x/sclp.c +1 -0
+	phys_addr_t base, top;

=20
nit: move this one line down

Will do

Quoted 18 lines

=20

Quoted 11 lines

phys_addr_t freemem_start =3D (phys_addr_t)&stacktop;
=20

lib/s390x/sclp.c +7 -0
 	phys_alloc_init(freemem_start, mem_end - freemem_start);
+	phys_alloc_get_unused(&base, &top);
+	base =3D (base + PAGE_SIZE - 1) & -PAGE_SIZE;
+	top =3D top & -PAGE_SIZE;
+
+	/* Make the pages available to the physical allocator */
+	free_pages((void *)(unsigned long)base, top - base);
+	page_alloc_ops_enable();
 }
Quoted 3 lines

=20
static void sclp_setup_int(void)

=20
This does not apply upstream. (sclp_setup_int) I guess this is based on=

Quoted 1 line

your other series.

Yup
I'll add it to the series.

Quoted 4 lines

=20
Tests still run fine
=20

Thanks

Quoted 1 line

=20

--vSo1VGj4JiBefk7qs9sT7b1BXEUmEYHtw--

--9E2b638198oW6pE5cesTJaZ9avOFVKzic
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJcNzhqAAoJEONU5rjiOLn4JQIP/A+MF0wIV1tNCZpHvW4LfbZp iVO25c/AZ6pOLSPAtKSXDdpTF8B6NXq0KH7zI+TBjsC4z0C3Nwh3PE3nZy11eIxL vC8Un0wTjDFXKry/O2d+n00gfcxXdsYdsTNenEpSsM2FhRMRo66xdwx3giIKCWsF GlPaYGZ17UEBbz73gP6ElFfxC3nhl0qqRFqHZTtvCd4MK45HThY/VD/9KFrM0lVM lT2c1yFeL4tpdvrMvk4HvBs1j3lB1tGNYbvblZdDJXRNsLu/kFIkw9E1AJxJjdN0 vHszP0Gb9gS4eUwtYe8sMLTQyqvhUAVDWKr8JbtVjZZDbLbV/zId6KTwzY/9lduS lZgIEdBecJ5DvvPVXnTvLxXD2OxY27OKDJCXSjfyjkLHr6gVfIyAdsnDY/Hx986v MGLdBMnveeuVeoULw9k7bzkPexRGkKnI2RwumJLJxJDNCwDFvGFDzTtd6jQjuyYn dwKI3KhGHlk121HavykOlynlvY4Rtdwemi0ty5FhJsQ6XkkMEkhFLYAWLVsfzIPu ITZJVHYXsKhaqbn8mmOP7LdZvImDm2ZwGdI2GUP1Ei4NdI/rg8oKOU79CVPaGnsK 2VkhEkSAwXozswVmkSwJ6l1kSIgbCbawCaOxN004fPnht6O7nB1ISCirtDp8Pv3/ S/9gi6u9uXKMzrNBFzfD
=omk0
-----END PGP SIGNATURE-----

--9E2b638198oW6pE5cesTJaZ9avOFVKzic--