From patchwork Fri Dec 6 15:53:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xia, Hongyan" X-Patchwork-Id: 11276711 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 2455914BD for ; Fri, 6 Dec 2019 15:54:48 +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 010E12173E for ; Fri, 6 Dec 2019 15:54:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="rYerGaTu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 010E12173E Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amazon.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 1idFvF-0007dm-T4; Fri, 06 Dec 2019 15:53:37 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1idFvE-0007dh-GG for xen-devel@lists.xenproject.org; Fri, 06 Dec 2019 15:53:36 +0000 X-Inumbo-ID: 8ee10583-1840-11ea-8369-12813bfff9fa Received: from smtp-fw-6001.amazon.com (unknown [52.95.48.154]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 8ee10583-1840-11ea-8369-12813bfff9fa; Fri, 06 Dec 2019 15:53:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1575647616; x=1607183616; h=from:to:cc:subject:date:message-id:mime-version; bh=uoulwX/qy9TB+gF3/b4JKgBI2tqpryV6wBHdBCcxNL8=; b=rYerGaTuOUzx3vWu3SwbyT8pxGZVBFrW7oSg8Czfti73AJgufs37LX+i tyJyQVXzE5j3ZO2j4y3Lzp3my4W50o04G3FHyJrBxHv1JmuCagOdQzjb5 fVxhBq+5ysTx6ENvi+AUzT/7MUi9IhE+BfUha2sbCufGDxW7upjEOm9zB 4=; IronPort-SDR: 7rtxxe83mYf6tA8UDnklc+QB/1gINYYqKnf54UUkR0YIpln2+qRQ0/Kx0rJ3X9MFiQFT4jljBd 6YW521XWrzzA== X-IronPort-AV: E=Sophos;i="5.69,285,1571702400"; d="scan'208";a="7965721" Received: from iad6-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-1e-303d0b0e.us-east-1.amazon.com) ([10.124.125.6]) by smtp-border-fw-out-6001.iad6.amazon.com with ESMTP; 06 Dec 2019 15:53:35 +0000 Received: from EX13MTAUEA001.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan3.iad.amazon.com [10.40.159.166]) by email-inbound-relay-1e-303d0b0e.us-east-1.amazon.com (Postfix) with ESMTPS id 65C18A25B6; Fri, 6 Dec 2019 15:53:33 +0000 (UTC) Received: from EX13D37EUB001.ant.amazon.com (10.43.166.31) by EX13MTAUEA001.ant.amazon.com (10.43.61.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Fri, 6 Dec 2019 15:53:32 +0000 Received: from EX13MTAUEE001.ant.amazon.com (10.43.62.200) by EX13D37EUB001.ant.amazon.com (10.43.166.31) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Fri, 6 Dec 2019 15:53:31 +0000 Received: from u60d575063b1f53.ant.amazon.com (10.125.106.64) by mail-relay.amazon.com (10.43.62.226) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Fri, 6 Dec 2019 15:53:30 +0000 From: Hongyan Xia To: Date: Fri, 6 Dec 2019 15:53:28 +0000 Message-ID: X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Precedence: Bulk Subject: [Xen-devel] [PATCH 0/2] Refactor super page shattering X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Andrew Cooper , jgrall@amazon.com, Wei Liu , Jan Beulich , =?utf-8?q?Roger_Pau_?= =?utf-8?q?Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" map_pages_to_xen and modify_xen_mappings use almost exactly the same page shattering logic, and the code is mingled with other PTE manipulations so it is less obvious that the intention is page shattering. Factor out the functions to make them reusable and to make the intention more obvious. Of course, there is not much difference between the shattering logic of each level, so we could further turn the per-level functions into a single macro, although this is not that simple since we have per-level functions and macros all over the place and there are slight differences between levels. Keep it per-level for now. Hongyan Xia (2): x86/mm: factor out the code for shattering an l3 PTE x86/mm: factor out the code for shattering an l2 PTE xen/arch/x86/mm.c | 166 ++++++++++++++++++++++------------------------ 1 file changed, 78 insertions(+), 88 deletions(-)