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

Re: [RFC PATCH 1/1] xen: Use a global mapping for runstate


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Fri, 29 May 2020 08:32:51 +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=I5BzPPSFQvc9wW4UV/9/2D3DsN+5dgsKOAgzDAHFIdA=; b=IE+4P1akeTTPtOjlRmWiDPPEcNQhniWYLW4Av8h+DCUAwqUrTpv88jyety5HD1MTWiloLZpcU6uZbnGbkTe+2GS0EeWiJ+MJ56bMqZTrYIZZElvMbD//Vv6MD1RXzI1DfbPZVaIgX5PSzcxyM2k0TmQBzjwuKNZKU/uGoXllqa/gFvE5rYovet+XSFBeRSFofCUVfvYb7EtP4W9Www4znaDCMfs6usuKnZHqbdYKxLtdPj30EHWZJf3JwB7VbHoRr8rdfVS6J5NTTOiy8fXSdHrfBXud29yOdFgTYNr5R5Hfcb2F9FBq41XuKjW/F1S5E1YSL5eIWwvX6dJO+ac8gA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=guxG7GS7TkFTAWC5cq4tOx3PNhRbUOPs2Z/USwmY9flzS+Y6dpHtJywWLokeH7RSEsCY67SBwLvWSbQqeJ9iIoI4EMIQlCQD8N9J4o5GylM6O3325jjDIhIt4ZpI/SbwWDeO0yy6j0jlLA519TkkVej52LMZ87BxScuANSFNnSRjN88MPduLQgpDztlAb7wHGYuGw50OU5WvS+p2zaUFo9khxgxMdgk3B/+utFny2UDc9rKQ1FsTVbEk8xi5KjAKvvkX01kCFNH+1NfOVowja75B6pOdLXUNV2PJqegWLxjXCkRekKh2s02rx1Nk+VKYD+7NzG9m+FbH8YuTgVY7WQ==
  • Authentication-results-original: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=arm.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Wei Liu <wl@xxxxxxx>, "paul@xxxxxxx" <paul@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Ian Jackson <ian.jackson@xxxxxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, "Xia, Hongyan" <hongyxia@xxxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, nd <nd@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Fri, 29 May 2020 08:33:02 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHWNP6nIxIB/r3XC025DLnqIbmaJai92N6AgADUiwCAABAUgA==
  • Thread-topic: [RFC PATCH 1/1] xen: Use a global mapping for runstate

Hi Jan

> On 29 May 2020, at 08:35, Jan Beulich <jbeulich@xxxxxxxx> wrote:
> 
> On 28.05.2020 20:54, Julien Grall wrote:
>> On 28/05/2020 16:25, Bertrand Marquis wrote:
>>> At the moment on Arm, a Linux guest running with KTPI enabled will
>>> cause the following error when a context switch happens in user mode:
>>> (XEN) p2m.c:1890: d1v0: Failed to walk page-table va 0xffffff837ebe0cd0
>>> 
>>> This patch is modifying runstate handling to map the area given by the
>>> guest inside Xen during the hypercall.
>>> This is removing the guest virtual to physical conversion during context
>>> switches which removes the bug
>> 
>> It would be good to spell out that a virtual address is not stable. So 
>> relying on it is wrong.
> 
> Guests at present are permitted to change the mapping underneath the
> virtual address provided (this may not be the best idea, but the
> interface is like it is). Therefore I don't think the present
> interface can be changed like this. Instead a new interface will need
> adding which takes a guest physical address instead. (Which, in the
> end, will merely be one tiny step towards making the hypercall
> interfaces use guest physical addresses. And it would be nice if an
> overall concept was hashed out first how that conversion should
> occur, such that the change here could at least be made fit that
> planned model. For example, an option might be to retain all present
> hypercall numbering and simply dedicate a bit in the top level
> hypercall numbers indicating whether _all_ involved addresses for
> that operation are physical vs virtual ones.)

I definitely fully agree that moving to interfaces using physical addresses
would definitely be better but would need new hypercall numbers (or the
bit system you suggest) to keep backward compatibility.

Regarding the change of virtual address, even though this is theoretically
possible with the current interface I do not really see how this could be
handled cleanly with KPTI or even without it as this would not be an atomic
change on the guest side so the only way to cleanly do this would be to
do an hypercall to remove the address in xen and then recall the hypercall
to register the new address.

So the only way to solve the KPTI issue would actually be to create a new
hypercall and keep the current bug/problem ?

Bertrand




 


Rackspace

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