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

Re: [PATCH 3/8] x86/paging: move update_paging_modes() hook


  • To: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 22 Dec 2022 09:00:54 +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=X1i7SGGYZ564QuV3+nObXpaN8KfW1hu3y+spkbArGEc=; b=LOK1ywUVuKoAxAu+hGXZAg+U+4m9x6xwYf1qaZQ+dUS0+WpywCM2cxyNUATjY1HqcDGsKf0Yoa2yzDSfh58vfdvQT2Fb1EBlvv/2gueLwKmMYstb2zFpJ0EVdi9SQEWej+T+cefTOJR+9O1t2A7jwPgafcyToKC9c1yHl4OATu+C0y8j2JJ4i2WZihAjWnmarE81Sx/ncHJpEXCqlEnFWzsWrYhW5A8druFqm01SOZZLHDgkdZm4lavEJ4+LaDOPeyxhLeiDi7yjOsKoDRil4m3vYIF6tjKRvcrli4GIWUrDDSybAVKot/OKMAN2/Zi3AoingOGlbtRRxUrpkwx1cQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=im0bveffg29x4aaS/kPA8TVe+j4NcBH6wHVFZNbQT3D1EesPan0/Xs+hQPr9V3HM9yLpDgI1SA/klbwIW1BRRLhrGU2bbsHtrnIEJhL8JXrp8UVuhZn3OBJyirkOrp68Y31smoTzlQlBpPLpeg/25zPMWTA/ZyEbg3KTAUiiihrTXIJk5a/ljH6xAK4r2Fg0EIIwDDGEE2xE5BbYFpJMdbIRPhpszV+AfJ+3dz46gEv+uE+/SeZF/gszNC6jFS24yTgH++e5XVSC2rG/iEOov41763urlEHEvZj3XhaTp9K3eIr0coMdeogmQu28Tb8VxTYagPnSmDjY+nJgwjkzoQ==
  • 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>, George Dunlap <George.Dunlap@xxxxxxxxxx>, "Tim (Xen.org)" <tim@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 22 Dec 2022 08:01:04 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 21.12.2022 18:43, Andrew Cooper wrote:
> On 21/12/2022 1:25 pm, Jan Beulich wrote:
>> The hook isn't mode dependent, hence it's misplaced in struct
>> paging_mode. (Or alternatively I see no reason why the alloc_page() and
>> free_page() hooks don't also live there.) Move it to struct
>> paging_domain.
>>
>> While there rename the hook and HAP's as well as shadow's hook functions
>> to use singular; I never understood why plural was used. (Renaming in
>> particular the wrapper would be touching quite a lot of other code.)
> 
> There are always two modes; Xen's, and the guest's.
> 
> This was probably more visible back in the 32-bit days, but remnants of
> it are still around with the fact that struct vcpu needs to be below the
> 4G boundary for the PDPTRs for when the guest isn't in Long Mode.
> 
> HAP also hides it fairly well given the uniformity of EPT/NPT (and
> always 4 levels in a 64-bit Xen), but I suspect it will become more
> visible again when we start supporting LA57.

So does this boil down to a request to undo the rename? Or undo it just
for shadow code (as the HAP function really does only one thing)? As to
LA57, I'm not convinced it'll become more visible again then, but of
course without actually doing that work it's all hand-waving anyway.

>> --- a/xen/arch/x86/mm/shadow/none.c
>> +++ b/xen/arch/x86/mm/shadow/none.c
>> @@ -27,6 +32,9 @@ int shadow_domain_init(struct domain *d)
>>      };
>>  
>>      paging_log_dirty_init(d, &sh_none_ops);
>> +
>> +    d->arch.paging.update_paging_mode = _update_paging_mode;
>> +
>>      return is_hvm_domain(d) ? -EOPNOTSUPP : 0;
> 
> I know you haven't changed the logic here, but this hook looks broken. 
> Why do we fail it right at the end for HVM domains?

It's been a long time, but I guess my thinking back then was that it's
better to put in place pointers which other code may rely on being non-
NULL.

Jan



 


Rackspace

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