Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2281886ybv; Fri, 14 Feb 2020 15:25:28 -0800 (PST) X-Google-Smtp-Source: APXvYqxJjCnwbyjphinWoLDXC3D5aHHeom+TCA1mlbT85YNdViihay8qcz0mIhaqJzfOrqmMA6VC X-Received: by 2002:a9d:f45:: with SMTP id 63mr4359196ott.0.1581722728573; Fri, 14 Feb 2020 15:25:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581722728; cv=none; d=google.com; s=arc-20160816; b=vl2EUbibd3XRPEinFB0PaHbla0qTjP1XQ7ZTToZueGzXHw2Li+2xxjpy4RAPZxeJQ1 zA1atLKCQSU9Yny0AvG9Pa4IbVgDSA3Wvrq6fWFDNVMtGZQoNVnnbmOKEWIi9LjuHtam p30oSrZplE3UtTCfCmVy4WUHmmX8mLIOQt+PjO3rpEm7brCb62WqJV2SFLuKeYUoQOi4 Z5qjCn2sfx92l0MK9ZSZnWquqqSm6hxjiOTxZzjTvJqRIeZH+C+Jo31uU6mtRt8u5oUL x4PEOdjbOlkXqMuVgxtxlmC/VaEfPgl4NTyjGeWe4z6BrFyAVA/UZAmsRR3mB0Hb7BNu u4QQ== 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=O/tzu1bgIDTe2SITmr0k1eyDHUZ3pNbGM463tV2v0AeImbSxAED/m7ojIzz0m/L3SC NZgh/hokimyjQXJXnKeUVnaASHi2u55YyFFKMHAEEquYaKF1hBQEFxRF4SxLVi1W06RE q/yzXHtAv4eHAMuyVqpdjKUOsduFV/E5IirrGMzVfhoUrzCIuxaB8FLy2syDaF0ovTzi txXPSNOChQXiuPDvnIdVhEtuv30ox+4KstfAXIpwpwX1K/RrPCv7uB9knTmYUlKlzzpL ncvap+ixnS1j/3zkIFPmNeA4sopxwPyegRmJK6x+QM4d37BABxbkwjaNcPzLTypv+7Fo DeNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b="rgntgG/b"; 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 u21si3141786oiv.267.2020.02.14.15.25.16; Fri, 14 Feb 2020 15:25:28 -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="rgntgG/b"; 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 S1728033AbgBNXYG (ORCPT + 99 others); Fri, 14 Feb 2020 18:24:06 -0500 Received: from smtp-fw-33001.amazon.com ([207.171.190.10]:19542 "EHLO smtp-fw-33001.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727649AbgBNXYG (ORCPT ); Fri, 14 Feb 2020 18:24:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1581722645; x=1613258645; h=date:from:to:subject:message-id:references:mime-version: in-reply-to; bh=SCTjmV5xVHiNIjiUIMGTdFjC64fXGAUedyZ2c0jICro=; b=rgntgG/bIt6BBjNKa5bubFAwhjFO3LkBP7GDelDBFYKWIDM3/WyvgTeV zEa2sLHvrAYG5Wd23CIYhihn60/skESZbMFT8yeu8APS6h50oFwAqzvUE EtHfQsqe6dIxpf1saXC5rEAPIbAZkuApIy4BAExVkyjeGaZWn4a8YMMt9 c=; IronPort-SDR: JzAKEQFmt4fMrLQTT6W4ifLu5G8na8fKhxKHe4zKqllP8KgJavXvCmP8vOJYIvv5GSVTDYHFGt Y6m0eh0Ld8ug== X-IronPort-AV: E=Sophos;i="5.70,442,1574121600"; d="scan'208";a="26558553" Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-1a-16acd5e0.us-east-1.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-33001.sea14.amazon.com with ESMTP; 14 Feb 2020 23:24:02 +0000 Received: from EX13MTAUEB002.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan2.iad.amazon.com [10.40.159.162]) by email-inbound-relay-1a-16acd5e0.us-east-1.amazon.com (Postfix) with ESMTPS id 60F9AA2998; Fri, 14 Feb 2020 23:23:55 +0000 (UTC) Received: from EX13D08UEB002.ant.amazon.com (10.43.60.107) by EX13MTAUEB002.ant.amazon.com (10.43.60.12) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Fri, 14 Feb 2020 23:23:43 +0000 Received: from EX13MTAUEB002.ant.amazon.com (10.43.60.12) by EX13D08UEB002.ant.amazon.com (10.43.60.107) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Fri, 14 Feb 2020 23:23:43 +0000 Received: from dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com (172.22.96.68) by mail-relay.amazon.com (10.43.60.234) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Fri, 14 Feb 2020 23:23:42 +0000 Received: by dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com (Postfix, from userid 4335130) id 833344028E; Fri, 14 Feb 2020 23:23:42 +0000 (UTC) Date: Fri, 14 Feb 2020 23:23:42 +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: <8f87ac8101596b27b210697a507b47e3569a96d5.1581721799.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