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

Re: [PATCH] x86/shadow: sh_type_to_size[] needs L2H entry when HVM+PV32


  • To: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 23 Jan 2023 11:47:03 +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=kneIYbav4gRiGtpPvy9/qhxfdtfbw25nmewBJplUyRs=; b=NHoDeeZrrnN3Fx06oc8QpKY6/9VZidcgvVQOVTdIRroD+nh22q+0XZOvqrtdpCSbG1IRWFk1ECpYTrK83vzQhQjqnEN9oHBtWugaBaWnMO0a7VNtozxQi+/FnQ8B3hdbYs5vVowalwmON1jnrBd+Kf4nHNngKceKekgeHSkeKOFf/hYmoYpcDkr9+kHGXPh5EZX5Q1mAno9xN7gFJi0LdcK4HgxrQ3QJKNuzjS+DqGsvbo/rUFJXUXQPNbqK4+KbCRYXNpohv+jdG63NtB57za5S098TPv71TZ2aWsCetAS9K76EIhjcB1ai44sv3iuNcAc+ju8zRLeqL4gpgbfFBw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QisHU5FnDtlaYZY2EZvZ4o9Ri0Q79ObebrAEd7TY8AXmcEse3IUyilkM3xpxCylk74Zos4LYVxf4vrDijNCswG4o/T3Ya9Xa8Yu1Qwp4D2FMhDLBATwFwn5qRln+6RlAU6qWVuT3IsHsIaxIlTq58+DrBwYnIR1PvOe9buIm0gvfEJkhGBhCWoZFcFBkTXR9+LP1pLyzcxVofAmencJG7BOQ2rBXE9KjFX0wK8fCdz68UIGZewrzaMraQOJsj61h1BjSO3EPXC5KMP/qn0X33f1zaYy17pobr9292DqwaxQi+JGq9kHQR6lVGe8HsEt2eCRJH44fvYV48ajzNmr84g==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Wei Liu <wl@xxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>, "Tim (Xen.org)" <tim@xxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 23 Jan 2023 10:47:20 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 23.01.2023 11:43, Andrew Cooper wrote:
> On 23/01/2023 8:12 am, Jan Beulich wrote:
>> While the table is used only when HVM=y, the table entry of course needs
>> to be properly populated when also PV32=y. Fully removing the table
>> entry we therefore wrong.
>>
>> Fixes: 1894049fa283 ("x86/shadow: L2H shadow type is PV32-only")
>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> 
> Erm, why?
> 
> The safety justification for the original patch was that this is HVM
> only code.  And it really is HVM only code - it's genuinely compiled out
> for !HVM builds.

Right, and we have logic taking care of the !HVM case. But that same
logic uses this "HVM-only" table when HVM=y also for all PV types. Hence
the PV32-special type needs to have a non-zero entry when, besides HVM=y,
PV32=y as well.

> So if putting this entry back in fixes the regression OSSTest
> identified, then either SH_type_l2h_64_shadow isn't PV32-only, or we
> have PV guests entering HVM-only logic.  Either way, the precondition
> for correctness of the original patch is violated, and it needs
> reverting on those grounds alone.

I disagree - the table isn't needed when !HVM, and as such can be
considered HVM-only. It merely needs to deal with all cases correctly
when HVM=y.

Jan



 


Rackspace

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