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

Runstate hypercall and Linux KPTI issues


  • To: "xen-devel@xxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Thu, 10 Sep 2020 13:46:34 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.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-SenderADCheck; bh=8TaRkeL385GQKXqvkobwH9/HNA0e53bJ/nFdmByq2es=; b=jVOnNszcmAiJuVfZn/qqef3QWUDvy1Ybd4McSXR8kaPw8mziNG/5g3jBQl2ydCet4zuPkRuTVMUUAjyoJSi+J1Lnc9szY4SG+aIG2jAKpU7xHJSbnNMbq5mRThJrjGdSKQJGl9SiAPROxrmq7KKiN4fYd9zoWkgSqpUKhsuepnpyMcJ7AjnrHWfOvRVNbS+/Tnoi5cU+IDZgmYo4Xi9idYwuGnlK/q1Ulj8Zx6ajlOoU6wZ8rqpHm898GSAUWsPWEh5T/QYkWK6pZNbh0fEg63oyrt8ch58UCnK/VLkm/a8K0fGhwJ6CXbAmYlD5hG2AjRmhjEqTYSh6k9EdOKqsKg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XgK+szlkEdGC7RnX5P/PTKl/GS69CUhwD7UBVw4wqC/HnY7Abb420YuY0fbaJk+qLwFO/IF0YBqxVGxKiN2Y8FPDo+Vle0wyclPG62Pc7cZ4YmY75QHTE239L/aqMc7PHywPc0oO4+lVdsN0P4yj6NE1D7mrXrFkcGcMgcrHtb5iWJxK8OoirptmvBkSQ/oJkdR3X5khH6teOGo+jvEaUqAMCjzB+Ylyx3wasLb9E6Qr4/u/YyqzB5W4yJ3XrTUy5lVzjQxdrkEIZVCyzKk2thdvN//lk+an9T5Fd4V/fmXIQ9bVnxWuYe930UfcEt113uef2hD8tk2tvHY9eDpThQ==
  • Authentication-results-original: lists.xen.org; dkim=none (message not signed) header.d=none; lists.xen.org; dmarc=none action=none header.from=arm.com;
  • Cc: Julien Grall <julien@xxxxxxx>, Stefano Stabellini <stefanos@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxx>
  • Delivery-date: Thu, 10 Sep 2020 13:47:46 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: lists.xen.org; dkim=none (message not signed) header.d=none; lists.xen.org; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHWh3jMDykyAruLG0O1Nd1I9v/9CQ==
  • Thread-topic: Runstate hypercall and Linux KPTI issues

Hi,

Following my patch[1] to map the guest runstate in Xen during the hypercall 
directly
instead of doing the conversion from virtual to physical when updating the 
runstate
content during a context switch a global discussion started[2][3].

To resume the discussion the problem is the following: A guest registers a 
memory
area for xen to put on and maintain the runstate information. This is done 
currently
using a guest virtual address which is converted by Xen during context switches.
When KPTI is used and a context switch occurs while linux is running in user 
space
the area is not mapped and the information is not updated. This results in 
invalid
runstate information but also in some annoying warning coming up in Xen console
on arm.

After the discussion by mail and the last community call it was proposed to 
change
the way to go and instead of trying to fix the problem in the existing 
hypercall, to
introduce a new hypercall taking as parameter a guest physical address for the
runstate area instead of a virtual address in the current hypercall.

This means:
- add a new hypercall to Xen
- add support for this new hypercall in Linux and use it if Xen supports it
- keep existing hypercall with its limitation (for older guests)
- keep support for both behaviour during the context switch

Some open questions:
- should we allow to register an area using both hypercalls or should it be 
exclusive ?
- should we backport the support for this hypercall in older kernel releases ?
- other ?

Please tell me if you agree or not before I start to plan how this can be 
implemented :-)

Regards
Bertrand

[1] https://lists.xenproject.org/archives/html/xen-devel/2020-07/msg01541.html
[2] https://lists.xenproject.org/archives/html/xen-devel/2020-07/msg01461.html
[3] https://lists.xenproject.org/archives/html/xen-devel/2020-06/msg00810.html





IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.



 


Rackspace

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