[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 4/8] x86: rename {get,put}_user() to {get,put}_guest()
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Mon, 22 Feb 2021 16:22:14 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=rZ2mo0putVkxA0MxiPFuXaEymxeMLUUbkm7kAvDUQCI=; b=LrxqfNxQhiAX3DwbBZ/vSMhbjKqiR1VYix+MU3hYhksVTOZVVVjP31TIArWprUd2IhjG5HY1FROaPE21MmnnJFvjeuIbtcdQK7bmLC1Hcx+NTX0hN6DR74J8UPs/dAucJxgE/ychvqkEqU7Pz3hC8PYUP0pR/KAwxejikbLPyeg80wngqyLAAL2mnvnYY5yJHj+0Id4SWqG4t1jaQ+K0jxauMlE76m+1QYuWye6OMk855bvrtmLuJNobr/nNwq6vPll/WhxuPDqJ4R/KnrECzS+oobf7uITFWm6S31BGyF2VkRyhHnSGsawHaof1JAsAtTITXZh4HcbE9anJlg1o6w==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n0bGO1cUl3FvqeVyp44Uyj6UEJb5IrAl1GToCUMRwiyqYZQrnm2yETttehI+xafeEhhfW6QUfxf7pJ0HgqegwdVU3vAhYpOYOeIuMYiFPgCoH3NkjCAEY5imTxrVT211C8YC53fIjZrKSWDRMRhrwoVqATO398wXByaqSHYybKGndLQobe+29httyMQZ9Dm9GMSkHj+AbtBvw1OrOcPbJO+K04wZvMFtl/jlfKFgKrPpQMG+jEcWv4A+J3jVvBNE9Keo3JfM87ysOv6dVhAyMgzEwmmsYswMf+r7wCWVp4knNGqR+ix7ihgD7eCoS7VDmajquINg3EH9o9l+WVlE2g==
- Authentication-results: esa4.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>
- Delivery-date: Mon, 22 Feb 2021 15:22:49 +0000
- Ironport-sdr: t6YlYs5JoAZcO1ro8uMyUdM0EMee4fGViNRX/+U5BHuBfFXGUFxXClIf7hJ/9uj8etPE6aexhY 99A/KKS8ESkAzRJYXM+D0Xl+wUsriXaqbfgbTwEbNSA2I3vsk+krPETioLWj+VsfavNEZ/WWgn VDORDpuQIWkDH9x7IqLfjDNUBhhmicj/yGlZubq7WCOL6oyvQ2gwh5i+Df1JPjIxjjmjjDdkum UGUvZVNg5Ksa0KWSe8FmOFu5ySeIuVVK6Q6U9O/cPI5URHAld2DdzhebRDMAsP68xPoTlXN7/M 5TM=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Wed, Feb 17, 2021 at 09:21:05AM +0100, Jan Beulich wrote:
> Bring them (back) in line with __{get,put}_guest().
>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Acked-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
>
> --- a/xen/arch/x86/domain.c
> +++ b/xen/arch/x86/domain.c
> @@ -1649,19 +1649,19 @@ static void load_segments(struct vcpu *n
>
> if ( !ring_1(regs) )
> {
> - ret = put_user(regs->ss, esp-1);
> - ret |= put_user(regs->esp, esp-2);
> + ret = put_guest(regs->ss, esp - 1);
> + ret |= put_guest(regs->esp, esp - 2);
> esp -= 2;
> }
>
> if ( ret |
> - put_user(rflags, esp-1) |
> - put_user(cs_and_mask, esp-2) |
> - put_user(regs->eip, esp-3) |
> - put_user(uregs->gs, esp-4) |
> - put_user(uregs->fs, esp-5) |
> - put_user(uregs->es, esp-6) |
> - put_user(uregs->ds, esp-7) )
> + put_guest(rflags, esp - 1) |
> + put_guest(cs_and_mask, esp - 2) |
> + put_guest(regs->eip, esp - 3) |
> + put_guest(uregs->gs, esp - 4) |
> + put_guest(uregs->fs, esp - 5) |
> + put_guest(uregs->es, esp - 6) |
> + put_guest(uregs->ds, esp - 7) )
I wonder whether we could use put_unsafe here, but I assume there's
some kind of speculation attack also against stores?
Thanks, Roger.
|