[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 13:49:04 +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=zz/xQac6VCNHR4A8oHGYM40baouxvQANK/LS3SvfatQ=; b=hijDVFyEndQOS4fqwGL8IYk2ShPq2GMlU2FGhstP/u1gCLDljTar97dLt3q9C6uKKKbIpEvem05rnsjx+/YJCOzpPr0LEXBt8MMbP3CPVaHQzRVvg61BRYi6Ca9hKpBdlK870/gLEqZ+2wt7khJ+7tM32eAhuADYa7cmUEsFPaI2hGK/BMJD2tyb5lB88wyXwi3MDSN3yQXyG2+/1ySNepGTKP3sk+yQmdW8aCC/LVQOM7+p+WyoPxCnwKBz4FFM9tRPUBeEr6phtS4CGEMuiEy6p6BNm0yulDZPyPbRM8WaRssckTH45T+e4ghK1xs8rq5S8F+WRT2H7TwSbIaz2w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n2K4+7lzsKKG7out+uDb0cWMV0BwBMtCo2bozkcYEcv2xSN0ylzQfd1URC27WwlLNavO/1LZH+i1X+gRTB6G5O6z5GENAW7dhuZarU3X2jXJndLPnTppuKSqyxsI7gIlicQyAqXW44NzjXOZ2GaneK86aidoh04wijxs8LjuUJia8iPpnpgh0jO9wUf+W2N/cOKIOJeDh4oxUhurcijxijG3Su0ST5VV8L3oDwZxFLndyUQl37y/Z1SycZOoehGSZM9uoWz6bhNz3AUKMa4rq2TqswEz9qk26dPEmkL50PIfy2HcTDGxZg7xYUUQO0DPC2+fy7PdB3VQqKWlvGVBYg==
  • 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 12:49:20 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 23.01.2023 13:30, Andrew Cooper wrote:
> On 23/01/2023 10:47 am, Jan Beulich wrote:
>> 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.
> 
> Ok - this is what needs fixing then.
> 
> This is a layering violation which has successfully tricked you into
> making a buggy patch.
> 
> I'm unwilling to bet this will be the final time either...  "this file
> is HVM-only, therefore no PV paths enter it" is a reasonable
> expectation, and should be true.

Nice abstract consideration, but would mind pointing out how you envision
shadow_size() to look like meeting your constraints _and_ meeting my
demand of no excess #ifdef-ary? The way I'm reading your reply is that
you ask to special case L2H _right in_ shadow_size(). Then again see also
my remark in the original (now known faulty) patch regarding such special
casing. I could of course follow that route, regardless of HVM (i.e.
unlike said there not just for the #else part) ...

Jan



 


Rackspace

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