From patchwork Tue Dec 17 15:12:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alexandru Stefan ISAILA X-Patchwork-Id: 11297891 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1F6AC1593 for ; Tue, 17 Dec 2019 15:13:50 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EF2C02146E for ; Tue, 17 Dec 2019 15:13:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=bitdefender.onmicrosoft.com header.i=@bitdefender.onmicrosoft.com header.b="Y7dOKjYJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EF2C02146E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bitdefender.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ihEWq-0008El-OA; Tue, 17 Dec 2019 15:12:52 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ihEWp-0008EM-Al for xen-devel@lists.xenproject.org; Tue, 17 Dec 2019 15:12:51 +0000 X-Inumbo-ID: ac1f9af8-20df-11ea-b6f1-bc764e2007e4 Received: from EUR03-VE1-obe.outbound.protection.outlook.com (unknown [40.107.5.102]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id ac1f9af8-20df-11ea-b6f1-bc764e2007e4; Tue, 17 Dec 2019 15:12:42 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UsqQ+JVzdelMk0G3Moh1xKAmfnKsezG16wWxRv/mqjT3V6s2GNwUqgNT+lpp4SZpq2doC/OIMysd4ppbyqYrx/VfZhprsIiHvlJGlOaRrL4lBtr6j4KY9+IosqGWAV1EuDzu70MfKSQ48uqiMHy41joCZpN7LjbP9JDokV1bQdeMKVZ8m+Y2M2KSKnc8fLYohKy9CD8n+/Y12lpTK1GC8jsV2WCVD6BJSCZ54lVS7H5gO4IsVWB3BtKDpBQX9I6i44cBm9lsYNgyy4d4dgRzz3ynS2JdAtjOqaP3w1sLmklcYS6yB5wPU9pCVl6Ne5hcEC1fYVxDLDbHAmjACglAJA== 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=oQQcj/kCLuqhEOjPzK84oKJ2erIYwHMpYTAxWNLBGWk=; b=E6pimmRW2Xk6NXhv8fQkEsbdZfI93flSsEdqhhdYiXQY/6ZMPzK/sr6f9ITblpDFrhlmP4BtZkAYFo1xzzSd2s6ziav2lgYS75uEl/iiUJkFtOT5ORsA5JiwaSsp90ftLrchYoJk3idKNdGJaWNlXbPv9AGh5vwxLWfVmByCV5a0DN77OffXEedL/Y87K+kKtd2nj53EoxCIZqEK9xqRHDtDOLM5vHFKlTMuPyoe8FNdAVlNRovc6UwQu4mOkEnCy6v5Cw1oSE8LagCEQ/UZ9rE0aeAQf1HQmwveWAMA8GCkRSufPY38641qL0AUr2kA8br2R3Tvctz0uBZrGZ6z4A== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bitdefender.onmicrosoft.com; s=selector2-bitdefender-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oQQcj/kCLuqhEOjPzK84oKJ2erIYwHMpYTAxWNLBGWk=; b=Y7dOKjYJJF5FwSMiO13NJpsd8Yri4gT2C2k6jXt/RpFvg6bycBzZ/DStHEhyHYFo99o1z9zLibHaS78rNwLPwbovGtADgKEVA6MKtQEqok3C7h8WVvBia3fq6VJBcjdPAY4TtP7DNMN2MD9GndKt7zAS4Ww4IpnMQI0pmA+fHWE= Received: from AM0PR02MB5553.eurprd02.prod.outlook.com (10.255.30.78) by AM0PR02MB4386.eurprd02.prod.outlook.com (20.178.17.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.20; Tue, 17 Dec 2019 15:12:35 +0000 Received: from AM0PR02MB5553.eurprd02.prod.outlook.com ([fe80::8cec:7638:734c:89d]) by AM0PR02MB5553.eurprd02.prod.outlook.com ([fe80::8cec:7638:734c:89d%4]) with mapi id 15.20.2538.019; Tue, 17 Dec 2019 15:12:35 +0000 From: Alexandru Stefan ISAILA To: "xen-devel@lists.xenproject.org" Thread-Topic: [PATCH V4 3/4] x86/mm: Pull out the p2m specifics from p2m_init_altp2m_ept Thread-Index: AQHVtOxpSoGNE4L+skG6HNN4NefFyg== Date: Tue, 17 Dec 2019 15:12:34 +0000 Message-ID: <20191217151144.9781-3-aisaila@bitdefender.com> References: <20191217151144.9781-1-aisaila@bitdefender.com> In-Reply-To: <20191217151144.9781-1-aisaila@bitdefender.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR01CA0067.eurprd01.prod.exchangelabs.com (2603:10a6:208:e6::44) To AM0PR02MB5553.eurprd02.prod.outlook.com (2603:10a6:208:160::14) authentication-results: spf=none (sender IP is ) smtp.mailfrom=aisaila@bitdefender.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [91.199.104.6] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c1a01afe-51c6-4cc6-89c2-08d783038bb2 x-ms-traffictypediagnostic: AM0PR02MB4386:|AM0PR02MB4386:|AM0PR02MB4386: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:243; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(366004)(136003)(396003)(39860400002)(346002)(376002)(189003)(199004)(6512007)(52116002)(64756008)(86362001)(186003)(8936002)(6486002)(4326008)(2906002)(54906003)(66476007)(71200400001)(66556008)(66946007)(36756003)(26005)(81156014)(81166006)(5660300002)(8676002)(6506007)(478600001)(66446008)(1076003)(2616005)(316002)(6916009); DIR:OUT; SFP:1102; SCL:1; SRVR:AM0PR02MB4386; H:AM0PR02MB5553.eurprd02.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: bitdefender.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: e4pRuDFPAcL6s+eDgRdWK3fVdAhp9PxWUVaUrBJ8R5xNELg4IptDimz7SKD228T4Mpu6Womhg+nTd26dw3AwKmKNSXgG73rYgL4fZQXMe3Ncf7gxEARtqag0B9o6wgkEtiQI0iEKr6169waPvlC/h48IFkK/rSvQq99igiuHkuqsAaoTPgkcNt0hV4ufdfedgvdTCut3dH8xZEiKaNyYAVcHuFIgDZHatGAcTxt1gxbD6/BMAPepgbakhrLvuuZQNawEBVh/CAKMJmTbvyHiDYPtvsi41b2HIFmIZCZ5TNafvWgOMb0HEk8psx2STVw6EmY2cxld+RSTsx+Ywh9OIC4vTHpjh1pgoBVbmopuZh+KRepkpyfc5Fyw4bN51UGiji+AnyNUCfrunjJ07uwzGbd97E1nDKfjVP8HKcPFwe7rEI/wPtjMN184qVNLhgbB Content-ID: <6723024B440EC240AB191EC15FBD9BD3@eurprd02.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: bitdefender.com X-MS-Exchange-CrossTenant-Network-Message-Id: c1a01afe-51c6-4cc6-89c2-08d783038bb2 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 15:12:34.9937 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 487baf29-f1da-469a-9221-243f830c36f3 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: AIk4KbwPHZV1QNglVJtBdgpq7WvRljvY6i1yFB0WJcRsn/GofL6SYt8pNdcGp0kqrHAE8UHto4fQoDcD/9yAsno8UxJeFIXN5kZFObrfYm0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR02MB4386 Subject: [Xen-devel] [PATCH V4 3/4] x86/mm: Pull out the p2m specifics from p2m_init_altp2m_ept X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Kevin Tian , Jun Nakajima , Wei Liu , George Dunlap , Andrew Cooper , Jan Beulich , Alexandru Stefan ISAILA , =?utf-8?q?Roger_Pau_Monn?= =?utf-8?q?=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Signed-off-by: Alexandru Isaila Reviewed-by: Jan Beulich --- CC: Jun Nakajima CC: Kevin Tian CC: George Dunlap CC: Jan Beulich CC: Andrew Cooper CC: Wei Liu CC: "Roger Pau Monné" --- xen/arch/x86/mm/p2m-ept.c | 6 ------ xen/arch/x86/mm/p2m.c | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c index e088a63f56..362f7079ab 100644 --- a/xen/arch/x86/mm/p2m-ept.c +++ b/xen/arch/x86/mm/p2m-ept.c @@ -1358,13 +1358,7 @@ void p2m_init_altp2m_ept(struct domain *d, unsigned int i) struct p2m_domain *hostp2m = p2m_get_hostp2m(d); struct ept_data *ept; - p2m->default_access = hostp2m->default_access; - p2m->domain = hostp2m->domain; - - p2m->global_logdirty = hostp2m->global_logdirty; p2m->ept.ad = hostp2m->ept.ad; - p2m->min_remapped_gfn = gfn_x(INVALID_GFN); - p2m->max_mapped_pfn = p2m->max_remapped_gfn = 0; ept = &p2m->ept; ept->mfn = pagetable_get_pfn(p2m_get_pagetable(p2m)); d->arch.altp2m_eptp[array_index_nospec(i, MAX_EPTP)] = ept->eptp; diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c index 253cab3458..d381f6877f 100644 --- a/xen/arch/x86/mm/p2m.c +++ b/xen/arch/x86/mm/p2m.c @@ -2559,6 +2559,12 @@ static int p2m_activate_altp2m(struct domain *d, unsigned int idx) goto out; } + p2m->default_access = hostp2m->default_access; + p2m->domain = hostp2m->domain; + p2m->global_logdirty = hostp2m->global_logdirty; + p2m->min_remapped_gfn = gfn_x(INVALID_GFN); + p2m->max_mapped_pfn = p2m->max_remapped_gfn = 0; + p2m_init_altp2m_ept(d, idx); out: