[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 2/3] x86/altp2m: p2m_altp2m_get_or_propagate() should honor present page order


  • To: Tamas K Lengyel <tamas@xxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 4 Jan 2022 17:14:41 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gYjKGKCN6fMcSsHIdRt7BuOqFBEsa9p/5Y3LjtP7mvI=; b=D91CW9F+BX/fF87YJXRSb0EA9WrRq+igyC/Z+5DTYp3nmP2Kn8XTi6JTEt92oXBDe06f56DmqXjKwoIjErQ291wvmyFKB2Yj7glIDuCcBU6om67iaOI1BbIlD+MG3xXydnaNMCB1Vj7FxsmARjeLJvGVu5hQlBMVWhWuh9c14vkQAFERXDMJLkKd0XJtzduT9hE/PDtVRKkfX8HmWCrOeCQfGBx2fHWaLwF+CEP5I8IIiPBgbHWlZtOnpzdNagBU0jpJY2yVSi4THnMKi99nH74E4jVLfx8tYFge6NV9oov+CgwhqfDcl1yrbx+VMHdhay6GfWdTL0a2ue7bn0BbwA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i/jhykKiY+BoIu0pjhE/1xmkgW/NHFU8cxox125o3kDAXXaIIm2hdUW4LS8fvtALnqXq9610jC3QBmmNrTfAhd+9iF92wTDtX364yBHEFB9DtJq+laf8z0SRwIe5E4rpXerx4vqRpi0s0SBaVGCBf8hNX7aO+6yA4Ovd9QkFbolusvFfLZoidERMAw0tsK8aVztEqa4t+lNMTYS7+0XMMybzaY4PtHCzNQ5Sf/YMxEPrQkFSRlnBreLD8XGOyhRDUDRFXfLzGfeUl6u2m2G/z/t8DesAjfZ8Ex/uvD5+cJPN+DGdMvAZqLp7yi3EdkF8Ldr6D4lD8Cwj2McgOJYZ4Q==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Alexandru Isaila <aisaila@xxxxxxxxxxxxxxx>, Petre Pircalabu <ppircalabu@xxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 04 Jan 2022 16:15:04 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 04.01.2022 16:00, Tamas K Lengyel wrote:
> On Tue, Jan 4, 2022 at 4:48 AM Jan Beulich <jbeulich@xxxxxxxx> wrote:
>>
>> Prior to XSA-304 the only caller merely happened to not use any further
>> the order value that it passes into the function. Already then this was
>> a latent issue: The function really should, in the "get" case, hand back
>> the order the underlying mapping actually uses (or actually the smaller
>> of the two), such that (going forward) there wouldn't be any action on
>> unrelated mappings (in particular ones which did already diverge from
>> the host P2M).
>>
>> Similarly in the "propagate" case only the smaller of the two orders
>> should actually get used for creating the new entry, again to avoid
>> altering mappings which did already diverge from the host P2M.
> 
> I don't really understand the reason why you want to return the
> page_order from the altp2m here. The only check that uses the
> page_order following is the super-page shattering check for XSA-304
> but that's done on the hostp2m. So you would want to know what the
> page_order is on the hosp2m, not the altp2m, no?

>From what I see I would say the XSA-304 action is on the altp2m,
not the host one - the p2m_set_entry() invocation passes "p2m",
which gets set immediately prior to the call to
p2m_altp2m_get_or_propagate(). This is also what gets passed into
the function. It's the host p2m only when !altp2m_active(currd).

> In either case, in all the setups we use altp2m we never use any
> superpages, the recommendation is to boot with hap_1gb=0 hap_2mb=0. I
> never trusted the complexity of superpage shattering and its
> implementation in Xen as it is very hard to follow.

Hmm, interesting. If you're aware of bugs there, would you mind
letting us know the details? There shouldn't be a need to use
command line options to make altp2m actually work. If there's an
incompatibility, and if we can't get that fixed, perhaps use of
superpages would want suppressing when altp2m gets enabled for a
guest? Right now, without this being enforced (nor spelled out
anywhere in, say, a code comment), I don't think we should make
assumptions like this. Hence the patch.

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.