Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp6544930ybv; Wed, 12 Feb 2020 14:32:33 -0800 (PST) X-Google-Smtp-Source: APXvYqxQMV+EIrnpI3FASrIHs9QquV4xIgxW/AIqNtz8iY1VsszZF2Gi/n/0sJ6mNBEKWyiGe1i/ X-Received: by 2002:a05:6830:1f1c:: with SMTP id u28mr11457907otg.143.1581546753551; Wed, 12 Feb 2020 14:32:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581546753; cv=none; d=google.com; s=arc-20160816; b=ojkk5F+UHtXXifYeNXZWh5uM0I2sTgqS2QjJez3EtJxuyo1LQlZesnJC6EnudjhURH +UEC2ttZY4/K4uR5w+TgkuVYVl6Ue/64j85mVx3S6ArXp5hVvJuFTUf5ZVLOhWtKZyfE jrGbO75R5a25vMZu7G/ltaBFTIhudEK4YANwKXirBLipum9sHTV1+ws/6owf0AWVIg55 HjS9sy6R90mocylMHeSpAKLj7/qfQeI1EvESpOEKKZ1wHGRlkDFMLSbxvWrONUY1rFrT lnx+gNaY0mcUxyR3sx21n4s28AgaXTh8XVz5ZuhcYtHxFjqzj1N37bp3R8zc2SDvxzPi WzuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:to:from:date:ironport-sdr :dkim-signature; bh=ripc5+9/gE+qNPNBav/IIcm5ONNdq1mgToxmDX/jFW0=; b=QT6Oxam/Ez/alAnAa3ifUIzjwy+g4tSvNa40HwikafuvmXMQFro+nAzR2hfxVZcvJR bKgSKU58vlaHtSVtAH81p7TEjuw5d+F/PSZbAbSoxXlv4yUqAW+8ridAJxyAdQ4b7EgE chfo8ev/rCu14EY8cDtJViBilIQuwjsl4uTLgobl+7KmuNoweUHgv50w5CUTEHxB6iy3 9VzvF5IMUxkA5osIVIp3eAwbLZdHVKqQMtfEwPyiKQR5Pgw/G1M6eTTL77Y/OiYvjxl2 vFl14bTxrvPf6ElrZiYoznHupwukrPlX8GYuVNP6DCffJd2a0CuuBZA5OrlTPAXT8GIv 0G1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b="BD/VBWFg"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p25si89759oto.191.2020.02.12.14.32.21; Wed, 12 Feb 2020 14:32:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b="BD/VBWFg"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729191AbgBLWcN (ORCPT + 99 others); Wed, 12 Feb 2020 17:32:13 -0500 Received: from smtp-fw-6001.amazon.com ([52.95.48.154]:27956 "EHLO smtp-fw-6001.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727692AbgBLWcN (ORCPT ); Wed, 12 Feb 2020 17:32:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1581546732; x=1613082732; h=date:from:to:subject:message-id:mime-version; bh=ripc5+9/gE+qNPNBav/IIcm5ONNdq1mgToxmDX/jFW0=; b=BD/VBWFgh88GB7S74RQOCBRf77hdGKWMkusuYt9uZveDwI62KNBY0CYb ev9SonLhNh1xN8+DDV6iNaegEihEgyzsFRnSFESM3QFLyDbAu+Xd2vUF8 6XwQ/1x1DjIW1pHzYud8lI7U2aEGNDb6hfLjzCyl81RMJl5/nlLmL0u7e A=; IronPort-SDR: gWdTJ5PKnY7douCc4vbbNcXx94KDrgyfXSO+Z9w6LtPWXGYkzF7Gj3MVWjoq7H58a0vZhfHqJE 3M+L5XR+QY3g== X-IronPort-AV: E=Sophos;i="5.70,434,1574121600"; d="scan'208";a="17479331" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-2c-2225282c.us-west-2.amazon.com) ([10.43.8.6]) by smtp-border-fw-out-6001.iad6.amazon.com with ESMTP; 12 Feb 2020 22:31:57 +0000 Received: from EX13MTAUEE002.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan3.pdx.amazon.com [10.170.41.166]) by email-inbound-relay-2c-2225282c.us-west-2.amazon.com (Postfix) with ESMTPS id 09736A2725; Wed, 12 Feb 2020 22:31:55 +0000 (UTC) Received: from EX13D08UEE003.ant.amazon.com (10.43.62.118) by EX13MTAUEE002.ant.amazon.com (10.43.62.24) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 12 Feb 2020 22:31:35 +0000 Received: from EX13MTAUEA002.ant.amazon.com (10.43.61.77) by EX13D08UEE003.ant.amazon.com (10.43.62.118) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 12 Feb 2020 22:31:35 +0000 Received: from dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com (172.22.96.68) by mail-relay.amazon.com (10.43.61.169) with Microsoft SMTP Server id 15.0.1236.3 via Frontend Transport; Wed, 12 Feb 2020 22:31:35 +0000 Received: by dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com (Postfix, from userid 4335130) id DBCC2400D1; Wed, 12 Feb 2020 22:31:34 +0000 (UTC) Date: Wed, 12 Feb 2020 22:31:34 +0000 From: Anchal Agarwal To: , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC PATCH v3 03/12] x86/xen: Introduce new function to map HYPERVISOR_shared_info on Resume Message-ID: <20200212223134.GA3625@dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Introduce a small function which re-uses shared page's PA allocated during guest initialization time in reserve_shared_info() and not allocate new page during resume flow. It also does the mapping of shared_info_page by calling xen_hvm_init_shared_info() to use the function. Signed-off-by: Anchal Agarwal --- Changes since V2: None --- arch/x86/xen/enlighten_hvm.c | 7 +++++++ arch/x86/xen/xen-ops.h | 1 + 2 files changed, 8 insertions(+) diff --git a/arch/x86/xen/enlighten_hvm.c b/arch/x86/xen/enlighten_hvm.c index e138f7de52d2..75b1ec7a0fcd 100644 --- a/arch/x86/xen/enlighten_hvm.c +++ b/arch/x86/xen/enlighten_hvm.c @@ -27,6 +27,13 @@ static unsigned long shared_info_pfn; +void xen_hvm_map_shared_info(void) +{ + xen_hvm_init_shared_info(); + if (shared_info_pfn) + HYPERVISOR_shared_info = __va(PFN_PHYS(shared_info_pfn)); +} + void xen_hvm_init_shared_info(void) { struct xen_add_to_physmap xatp; diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h index 45a441c33d6d..d84c357994bd 100644 --- a/arch/x86/xen/xen-ops.h +++ b/arch/x86/xen/xen-ops.h @@ -56,6 +56,7 @@ void xen_enable_syscall(void); void xen_vcpu_restore(void); void xen_callback_vector(void); +void xen_hvm_map_shared_info(void); void xen_hvm_init_shared_info(void); void xen_unplug_emulated_devices(void); -- 2.24.1.AMZN