Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5822975imm; Tue, 12 Jun 2018 14:02:43 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL9Yf4HmhdCsSlNzwVHjbbAIvDGT3DLWccVwJtiWZNEcr0zHl1vMG+1S4q+QXZVQmtH4DwJ X-Received: by 2002:a62:484d:: with SMTP id v74-v6mr2020926pfa.256.1528837363126; Tue, 12 Jun 2018 14:02:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528837363; cv=none; d=google.com; s=arc-20160816; b=hJoUrgwvyLQm/XoNaOE2vCNhy5JebAf31wCvfCUIzyavHtYNWi87N6IARhzNrIlY6P hL2zalGdcU66Tukq8UmyC9ncv5Bx29JcomPC9vcLHMX+hX6MDOIgOgqXcWB9VaPwB/3X ykIpceCJBv/7KNR+uj2b4df0cuDOXBlMkIjCUrUI5AeZ8C2owPCPiwvJZVCfZpQ+HLVg hWgoaLVxNp8a+56L3QXWaxfFDGSKx0rrH+rmCHMze/WkgcWo0sw6h/FmRVVrRkqP3Wrt NeSYkFjrRKDRKLZW6blcbhD3Y7+U4Wan+0CC69Ykqdq93Z8+X40/waHQWusn0YjeFgwS NInw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=wAt5tCtl8i934+pWMAzHn7TQ1fBj1MjwfTCjDanT1zU=; b=IP0g8I2FRggPmuXCIcTPRsXQRV9eiLpD3E+RxUWaHWMKckIrZwLyXXnrNnu4teWAwG GFnS4az4jqvDi4BfCCFKOJ2g2JN5JtyHwcZMqzEc263aMMC1dVWcqMG36sp8fsBuwqhL D6tB84ZluG/sEWwoBThSj1fJUVOHnkPwU4TLtHIODuI4biBfdBXpyYkM0bWg7fbp2Ujw ghSzUZHXmawe8NcX2Uad2MysZIFCQDipwJ1munRHtGYEWIqzq9g/sEwL14G8FRoYmZYR 0wZH8AgeLNhb8gXXP+ow9ye2Fgd+POfD5+dy35UckslFSZnMa77XNzNf19Axk+MrqyJ4 3g2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=mEQuXVDa; 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 t25-v6si916430pfh.101.2018.06.12.14.02.18; Tue, 12 Jun 2018 14:02:43 -0700 (PDT) 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=mEQuXVDa; 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 S934747AbeFLVAW (ORCPT + 99 others); Tue, 12 Jun 2018 17:00:22 -0400 Received: from smtp-fw-6002.amazon.com ([52.95.49.90]:3344 "EHLO smtp-fw-6002.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934091AbeFLU4h (ORCPT ); Tue, 12 Jun 2018 16:56:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1528836997; x=1560372997; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=wAt5tCtl8i934+pWMAzHn7TQ1fBj1MjwfTCjDanT1zU=; b=mEQuXVDav/ZQoovD3cJMr9HPly0mYofxJT0iN6hdFgNon0a9QVRfSr8i JTc0Do8NsbkpaWWjgTKJ44jHqwY5m1uXJWyiBwZLUd1UILFm9fgLcDtmL jhxeGU8RcYP4aPhFCnmn80uwPsvI6y3U/mEyCgpoAchFrba+aCVj7mxEk w=; X-IronPort-AV: E=Sophos;i="5.51,216,1526342400"; d="scan'208";a="347699295" Received: from iad6-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-2c-4e7c8266.us-west-2.amazon.com) ([10.124.125.6]) by smtp-border-fw-out-6002.iad6.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 12 Jun 2018 20:56:33 +0000 Received: from EX13MTAUWC001.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan3.pdx.amazon.com [10.236.137.198]) by email-inbound-relay-2c-4e7c8266.us-west-2.amazon.com (8.14.7/8.14.7) with ESMTP id w5CKuVEL129961 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Tue, 12 Jun 2018 20:56:31 GMT Received: from EX13D02UWC003.ant.amazon.com (10.43.162.199) by EX13MTAUWC001.ant.amazon.com (10.43.162.135) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 12 Jun 2018 20:56:31 +0000 Received: from EX13MTAUEB001.ant.amazon.com (10.43.60.96) by EX13D02UWC003.ant.amazon.com (10.43.162.199) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 12 Jun 2018 20:56:31 +0000 Received: from localhost (10.25.15.63) by mail-relay.amazon.com (10.43.60.129) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Tue, 12 Jun 2018 20:56:30 +0000 From: Anchal Agarwal To: , , , CC: , , , , , , , , , , , , , , , , , Subject: [RFC PATCH 04/12] x86/xen: Introduce new function to map HYPERVISOR_shared_info on Resume Date: Tue, 12 Jun 2018 20:56:11 +0000 Message-ID: <20180612205619.28156-5-anchalag@amazon.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180612205619.28156-1-anchalag@amazon.com> References: <20180612205619.28156-1-anchalag@amazon.com> MIME-Version: 1.0 Content-Type: text/plain 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 Reviewed-by: Sebastian Biemueller Reviewed-by: Munehisa Kamata Reviewed-by: Eduardo Valentin CR: https://cr.amazon.com/r/8273203/ --- 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 754d5391d9fa..2c4bcf92a90a 100644 --- a/arch/x86/xen/enlighten_hvm.c +++ b/arch/x86/xen/enlighten_hvm.c @@ -24,6 +24,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 f377e1820c6c..94c8a009ab35 100644 --- a/arch/x86/xen/xen-ops.h +++ b/arch/x86/xen/xen-ops.h @@ -58,6 +58,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.14.3