[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [PATCH v2 18/20] xen/mem_access: Use __get_gfn_type_access in set_mem_access
- To: Tamas K Lengyel <tamas.lengyel@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Alexandru Stefan ISAILA <aisaila@xxxxxxxxxxxxxxx>
- Date: Thu, 19 Dec 2019 07:59:45 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=bitdefender.com; dmarc=pass action=none header.from=bitdefender.com; dkim=pass header.d=bitdefender.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=fYN6wMNUxAQAxDNHFgn4EHf+APlyHe+WzBAfRxLPTtw=; b=HLWib66IrFPpCc4p5BPPyMJkpNqee981KRoJ3e0fw8hl7uc+AVlPLiDpesph+aAALo/1iB2AtpZvilhu/1LXL50Wlw0UiDzGAfezEZEoV3m9do2003SfFgDzDJ1dV+sNLa6lTUlKi4eRGSw4lxCPuFvIDVTPmZNv76AnQEgFJHQDUANaBAsiS2cRNBgFyVTeAuJe+va9W6M5DszcBDrIOigxevBHITDKik6cp3lY6LC7LLgANqsFaY5FsN2OnzvksI+ClM+4Iqkxoa7uQ4biEMMB8mFCWGOLHIpv02SSepxmu2HM08SJxqgnYpuUPVrj80qZvFv4iNFMYvZBEmxCEg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HB4EeOMTlj9xBnFhixoQl8GAoBL65FpxrfsZ9+2lKb0IvfWF7ggWvf+LY+0qBzpx03sQeqaho4LebYUOXwLIsKqO65T6WjdrWiNNRvNgzJoBPiKtOBRxVdo6AmwvHcaN9k1K7f7ZqC5ZrDxRcPIPr97XFWryf8KpQRfSjXO6ylljdyWIrX5a/Bd+zgCV48zRs278MoaKAOV3fhkEFuAwK0bFpNvOfIIrW2mPcn+9Z/WlHQAZ1eq2HPG3SWcE0nCl9JsZhddkz0jPS2wAK7TZJ8sMFGqqrSuBooUZbRsiFkASGZ7hTLjLDX9eVZmsfazmmNncEWxCQ8hI0+qV7D+ekg==
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=aisaila@xxxxxxxxxxxxxxx;
- Cc: Petre Ovidiu PIRCALABU <ppircalabu@xxxxxxxxxxxxxxx>, Tamas K Lengyel <tamas@xxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Delivery-date: Thu, 19 Dec 2019 07:59:50 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHVtds8AUH7W2YIvUirR5NHN4gmNafBGNSA
- Thread-topic: [PATCH v2 18/20] xen/mem_access: Use __get_gfn_type_access in set_mem_access
On 18.12.2019 21:40, Tamas K Lengyel wrote:
> Use __get_gfn_type_access instead of p2m->get_entry to trigger page-forking
> when the mem_access permission is being set on a page that has not yet been
> copied over from the parent.
>
> Signed-off-by: Tamas K Lengyel <tamas.lengyel@intel.comReviewed-by: Alexandru
> Isaila <aisaila@xxxxxxxxxxxxxxx>
> ---
> xen/arch/x86/mm/mem_access.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/xen/arch/x86/mm/mem_access.c b/xen/arch/x86/mm/mem_access.c
> index 320b9fe621..9caf08a5b2 100644
> --- a/xen/arch/x86/mm/mem_access.c
> +++ b/xen/arch/x86/mm/mem_access.c
> @@ -303,11 +303,10 @@ static int set_mem_access(struct domain *d, struct
> p2m_domain *p2m,
> ASSERT(!ap2m);
> #endif
> {
> - mfn_t mfn;
> p2m_access_t _a;
> p2m_type_t t;
> -
> - mfn = p2m->get_entry(p2m, gfn, &t, &_a, 0, NULL, NULL);
> + mfn_t mfn = __get_gfn_type_access(p2m, gfn_x(gfn), &t, &_a,
> + P2M_ALLOC, NULL, false);
Don't you want p2m_query_t to be 0 as it was in the p2m->get_entry() call ?
> rc = p2m->set_entry(p2m, gfn, mfn, PAGE_ORDER_4K, t, a, -1);
> }
>
>
Alex
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|