Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp94717ybk; Tue, 19 May 2020 16:28:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUx36d8wY5nINirl+cM6jjm1+VoC1xG/1B/F9o5rQQPmGiDmKFzObCq/SO5l9IZoKUFjUf X-Received: by 2002:a17:906:3b1b:: with SMTP id g27mr1357499ejf.397.1589930921062; Tue, 19 May 2020 16:28:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589930921; cv=none; d=google.com; s=arc-20160816; b=Daw7z/GH92r8vDtwu/lzN48D2sHM32wXwwQTezFRnnFCnnJ4FQvQad+9QOM2y4Q7Ij ZENxhiTmt68J5qfnPWtPZQpihULNUQSIaYT7+WvkAW28tuboEs0SKYobZbhKMqJUkLR3 3iYefNr2B6j3/O4hYueDufNv1yqKs1IjMjdXuEuj/zAQFc6X5/SQvBn/o8tF9b+x+Iq/ QNc7Abq+mUhghFL8u8Rtzy89Akbg8ttMPBlxyEExDm/95zBYWnDtN3vA06AkbyHdpJ4c 1MXmmH+uNp5wHrr10ViIb8/GNR4eyUyjlQDfodYbEpY9W3zhz/hEUPpMZfXoY1ktQ7mG jSEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:to :from:date:ironport-sdr:dkim-signature; bh=SCTjmV5xVHiNIjiUIMGTdFjC64fXGAUedyZ2c0jICro=; b=Bezkd9O0kAQbu5TiJbHJ5cYkhxkiW5Pd+lRRNtBeqdB5HheqcW0+6a6zocEuWdz25u JRLG5lwPJjegabDPr8wYnoqhzm/2j7ZzA7MUvsIIkWKd1+XsUPbjeX5jBNEQG2rLoBsZ ukUDXpyykDq4pvzP8+voZl9ZteTQS/uvdLrOPGUkF2+E4rNtdCHvSFFI6jRKQhZuNSSD hNjzJDOU0U8k6llhL6S+Ap8mfaEmIj/+SGUJPoCgaedY4FqlzF5xL0+7dZtp99xvwiYI HUUUYS90IUNsqXocK77tK0xbaLOen6lFVQbiOrcKYbFCPjqSxOqn5uvVfftdySiYT1M4 WPBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=CekwH+sb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id o5si795259ejr.637.2020.05.19.16.28.18; Tue, 19 May 2020 16:28:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=CekwH+sb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1728371AbgESX0V (ORCPT + 99 others); Tue, 19 May 2020 19:26:21 -0400 Received: from smtp-fw-9101.amazon.com ([207.171.184.25]:40085 "EHLO smtp-fw-9101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726432AbgESX0U (ORCPT ); Tue, 19 May 2020 19:26:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1589930780; x=1621466780; h=date:from:to:subject:message-id:references:mime-version: in-reply-to; bh=SCTjmV5xVHiNIjiUIMGTdFjC64fXGAUedyZ2c0jICro=; b=CekwH+sbAr2pQsEc8oiWkbBH7ofiPVvejYJBFfA/XnznZP0Liel6g0nW Mzeh2uGLO9HiCH783//og6xcgE9RFhxYJTOoaJDWhlEFRSsUfnt0Ffb+2 7KzlZJGf3ynT47xtPhx850MM2v5cW9OPQgeKidCfS6GdlOocYuuWcwjfU 4=; IronPort-SDR: Kg+TLt+LY+bqUJUwBpjU3RbEzJfqG2xPZmKQMMNfSWm/LI+Yb1NN+YBg1sA0a/PiOEnBmgV9Bu QFRUnvjW9CbQ== X-IronPort-AV: E=Sophos;i="5.73,411,1583193600"; d="scan'208";a="36215719" Received: from sea32-co-svc-lb4-vlan2.sea.corp.amazon.com (HELO email-inbound-relay-1e-17c49630.us-east-1.amazon.com) ([10.47.23.34]) by smtp-border-fw-out-9101.sea19.amazon.com with ESMTP; 19 May 2020 23:26:16 +0000 Received: from EX13MTAUWC001.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan3.iad.amazon.com [10.40.159.166]) by email-inbound-relay-1e-17c49630.us-east-1.amazon.com (Postfix) with ESMTPS id 61936A2313; Tue, 19 May 2020 23:26:09 +0000 (UTC) Received: from EX13D05UWC003.ant.amazon.com (10.43.162.226) by EX13MTAUWC001.ant.amazon.com (10.43.162.135) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 19 May 2020 23:25:48 +0000 Received: from EX13MTAUWC001.ant.amazon.com (10.43.162.135) by EX13D05UWC003.ant.amazon.com (10.43.162.226) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 19 May 2020 23:25:48 +0000 Received: from dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com (172.22.96.68) by mail-relay.amazon.com (10.43.162.232) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 19 May 2020 23:25:48 +0000 Received: by dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com (Postfix, from userid 4335130) id 91F2940712; Tue, 19 May 2020 23:25:48 +0000 (UTC) Date: Tue, 19 May 2020 23:25:48 +0000 From: Anchal Agarwal To: , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH 03/12] x86/xen: Introduce new function to map HYPERVISOR_shared_info on Resume Message-ID: <529f544a64bb93b920bf86b1d3f86d93b0a4219b.1589926004.git.anchalag@amazon.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: 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 --- 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