From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fout-b7-smtp.messagingengine.com (fout-b7-smtp.messagingengine.com [202.12.124.150]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 841B71C549F for ; Mon, 13 Jan 2025 20:10:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.150 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736799013; cv=none; b=sq4sBPckL/i1NlL55aBIHbx3E4jCs4Ka9gV1ED4MjIC/g7tQunNWB6J9J2l7lWAkuZ2tU4GrkhMFkCsR628pJwWVszDconIP9d14+GX1CE/3dFMpA69ZA1kn1gkBfVk2pJhxNX1DAhYCtOatO5Tc44u/f/CLXsCqoaINlZik74c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736799013; c=relaxed/simple; bh=SDUSYYuGnANsT9yMEc+gP6aWFWfNwnj8FOnyXO4ySHk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=SwbiTXGYx78tUo7vzK8M9/HW1J0ItfCNQb0skbyTLiv8ps8Nf++1+mxnWS6smqBtKk0OME6F4/jH0a2aJYQzH5JcPsBPbHSiOLuBuH8E+F4jbT7Ke6od+JsF9eXxYbpRnr3ivbnNGDew3TJDzyyMlb2bRPgvKPCJ+mJnxWqHBeE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=invisiblethingslab.com; spf=pass smtp.mailfrom=invisiblethingslab.com; dkim=pass (2048-bit key) header.d=invisiblethingslab.com header.i=@invisiblethingslab.com header.b=v4XQatKD; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=fOScKq8R; arc=none smtp.client-ip=202.12.124.150 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=invisiblethingslab.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=invisiblethingslab.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=invisiblethingslab.com header.i=@invisiblethingslab.com header.b="v4XQatKD"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="fOScKq8R" Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.stl.internal (Postfix) with ESMTP id 70D091140175; Mon, 13 Jan 2025 15:10:10 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Mon, 13 Jan 2025 15:10:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= invisiblethingslab.com; h=cc:cc:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1736799010; x=1736885410; bh=MIdzOqwkk4JTEfHL34hjMhDMG+0EJfsIkRFwgLB1K4A=; b= v4XQatKDtZwrZADh28NA4aZzGjpkdBPoski7o5lL0FOzsOCY0dvnanDBOdFuZ1Fz dfu1+Ebe2+VcxDKAR8zsGLM2G1r5UhEf9iJ4nNqDxcPErLwdxzNmUzWZe8HWu598 rPLkGOx28YaKsoUCT8+l/1ZNdnXIEO6zl+O2EhhyMvL8uaDn6LoewzQroHxvZG/3 NJKb/+U0zQsGk25zziETlt4CjejvbDXUSP+EBJgKVVv36pQUXJYkWRJwuk1Eu6fM CYpLkDLRkLkOguOqN3xQEc2BzBdYjuJDX/M4UBhgyUsvFX4EfoDClh+lW1za/NSC 8TIJHtKnFezjQdbaMuFj5Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1736799010; x=1736885410; bh=MIdzOqwkk4JTEfHL34hjMhDMG+0EJfsIkRF wgLB1K4A=; b=fOScKq8RCiw0y4qPgc7uAh6icK+aX2jxoeVWtH4YxnQ2CkMrOkM 9dhKSk0Xnr+eHMGsn+y44nK26pkLdmPBtyqN5urBXeab3wiYQJrknPPm0JAIG5Vk +xeQXme6CTBkQKCORthPFZOU9KJXXJ/SahyGyeXyN48wjNKudWayiQADXznD4kP8 X83GTg0SVy2JvJSmxp1Rj6OPI6PkCeFq9vEyKgeuNq9BlsaJYP1XNQsUhN+9c4T5 d76rAx3kc/5G3M76kuML6y5mEa3+h1UfsUlQOL16JJYDggBJnYfS+P+qtl8RySSO xkmigvK2nF1BtwuaVqlIx6bkBmQBZExy7lg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudehgedgudeffecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredttdej necuhfhrohhmpeforghrvghkucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoe hmrghrmhgrrhgvkhesihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucgg tffrrghtthgvrhhnpeeileduvdekjeeukefhffetgeefiefffeejjedvieejvdfgjeehte duvdekffduieenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfu ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhgrrhhmrghrvghksehinhhvih hsihgslhgvthhhihhnghhslhgrsgdrtghomhdpnhgspghrtghpthhtohepuddvpdhmohgu vgepshhmthhpohhuthdprhgtphhtthhopegsphesrghlihgvnhekrdguvgdprhgtphhtth hopehrphhptheskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprghkphhmsehlihhnuhig qdhfohhunhgurghtihhonhdrohhrghdprhgtphhtthhopeigkeeisehkvghrnhgvlhdroh hrghdprhgtphhtthhopehjghhrohhsshesshhushgvrdgtohhmpdhrtghpthhtoheplhhi nhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepug grvhgvrdhhrghnshgvnheslhhinhhugidrihhnthgvlhdrtghomhdprhgtphhtthhopehl uhhtoheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepphgvthgvrhiisehinhhfrhgrug gvrggurdhorhhg X-ME-Proxy: Feedback-ID: i1568416f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 13 Jan 2025 15:10:05 -0500 (EST) Date: Mon, 13 Jan 2025 21:10:03 +0100 From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= To: Borislav Petkov Cc: Mike Rapoport , Andrew Morton , x86@kernel.org, Juergen Gross , linux-kernel@vger.kernel.org, Dave Hansen , Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" Subject: Re: [PATCH] x86/execmem: fix ROX cache usage in Xen PV guests Message-ID: References: <20250103065631.26459-1-jgross@suse.com> <20250103130044.GEZ3fffHPSmJ3ngPXn@fat_crate.local> <20250113175552.GGZ4VTqHVuecaEhsax@fat_crate.local> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="uK0WqnOIZTSFkhMu" Content-Disposition: inline In-Reply-To: <20250113175552.GGZ4VTqHVuecaEhsax@fat_crate.local> --uK0WqnOIZTSFkhMu Content-Type: text/plain; protected-headers=v1; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Date: Mon, 13 Jan 2025 21:10:03 +0100 From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= To: Borislav Petkov Cc: Mike Rapoport , Andrew Morton , x86@kernel.org, Juergen Gross , linux-kernel@vger.kernel.org, Dave Hansen , Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" Subject: Re: [PATCH] x86/execmem: fix ROX cache usage in Xen PV guests On Mon, Jan 13, 2025 at 06:55:52PM +0100, Borislav Petkov wrote: > On Fri, Jan 10, 2025 at 12:02:38PM +0200, Mike Rapoport wrote: > > On Fri, Jan 03, 2025 at 02:00:44PM +0100, Borislav Petkov wrote: > > > Adding the author in Fixes to Cc > >=20 > > Thanks, Boris! > > =20 > > > On Fri, Jan 03, 2025 at 07:56:31AM +0100, Juergen Gross wrote: > > > > The recently introduced ROX cache for modules is assuming large page > > > > support in 64-bit mode without testing the related feature bit. This > > > > results in breakage when running as a Xen PV guest, as in this mode > > > > large pages are not supported. > >=20 > > The ROX cache does not assume support for large pages, it just had a bug > > when dealing with base pages and the patch below should fix it. > >=20 > > Restricting ROX cache only for configurations that support large pages > > makes sense on it's own because there's no real benefit from the cache = on > > such systems, but it does not fix the issue but rather covers it up. > >=20 > > diff --git a/mm/execmem.c b/mm/execmem.c > > index be6b234c032e..0090a6f422aa 100644 > > --- a/mm/execmem.c > > +++ b/mm/execmem.c > > @@ -266,6 +266,7 @@ static int execmem_cache_populate(struct execmem_ra= nge *range, size_t size) > > unsigned long vm_flags =3D VM_ALLOW_HUGE_VMAP; > > struct execmem_area *area; > > unsigned long start, end; > > + unsigned int page_shift; > > struct vm_struct *vm; > > size_t alloc_size; > > int err =3D -ENOMEM; > > @@ -296,8 +297,9 @@ static int execmem_cache_populate(struct execmem_ra= nge *range, size_t size) > > if (err) > > goto err_free_mem; > > =20 > > + page_shift =3D get_vm_area_page_order(vm) + PAGE_SHIFT; > > err =3D vmap_pages_range_noflush(start, end, range->pgprot, vm->pages, > > - PMD_SHIFT); > > + page_shift); > > if (err) > > goto err_free_mem; > > =20 > > --=20 >=20 > So this patch is still being discussed here. >=20 > akpm has already picked up the original fix from J=C3=BCrgen: >=20 > 59f59108475e ("x86/execmem: fix ROX cache usage in Xen PV guests") >=20 > and the patch is already in Linus' tree. >=20 > How much of a fiasco is this execmem thing going to become? >=20 > Andrew, is there any chance we can synchronize on what you pick up for > arch/x86/ or? I was running some tests today with the above patch on top of -rc7 (and without J=C3=BCrgen's one). Some tests are still running, and there are still some crashes I need to take a look at (could be completely unrelated), but generally it looks _much_ better, especially I don't see the wall of crashes in HVM domU that I've seen before (https://lore.kernel.org/xen-devel/Z3cyhdKu6M1vdBe_@mail-itl/). The latter could be an effect of the above fix, or could be some other fix that happened between -rc5 and -rc7. If that would be interesting, I can also re-test with -rc5 + the above patch, or something else. Let me know. --=20 Best Regards, Marek Marczykowski-G=C3=B3recki Invisible Things Lab --uK0WqnOIZTSFkhMu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmeFcxwACgkQ24/THMrX 1yxCiAf/daMoP76khj/+AOty3Jid5i7JKBglyKHYVQY8kpZTds20rxSURpZBZ9gB aIdpcxb/kMTiyqScoJljtljXVsWIj0MawQOQ70jvu78sjoUyV4rLZm/iWGTFfAF+ kOIKAfnX4m3VvSAAbu00j6AI6rL5ZwjjstTcSJg+1tgFphpclxr5Dw0GF+vz7szy vWU3R8DOSmEsZczX49Z615lYNmWJpCT5boGr4Z+nOIEcwLwhC2dgksmQdvHtpRlM +GxAtzcaEmGatMk6dkLU5iMtASZ0tCWPkzwsyfPTTttDyVCofgNUtOqPAdBcjzWI c1FvAJu4RlK+zduj1cxPF1eBE4tX0Q== =pNQd -----END PGP SIGNATURE----- --uK0WqnOIZTSFkhMu--