Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753072AbcLSC47 (ORCPT ); Sun, 18 Dec 2016 21:56:59 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:55836 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751724AbcLSC45 (ORCPT ); Sun, 18 Dec 2016 21:56:57 -0500 DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org 5E54F613A3 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=anjiandi@codeaurora.org From: Jiandi An To: boris.ostrovsky@oracle.com, jgross@suse.com, xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Cc: julien.grall@arm.com, sstabellini@kernel.org, shankerd@codeaurora.org, shannon.zhao@linaro.org, Jiandi An Subject: [PATCH] Xen: ARM: Zero reserved fields of xatp before making hypervisor call Date: Sun, 18 Dec 2016 20:56:38 -0600 Message-Id: <1482116198-28940-1-git-send-email-anjiandi@codeaurora.org> X-Mailer: git-send-email 1.8.2.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1042 Lines: 28 Ensure all reserved fields of xatp are zero before making hypervisor call to XEN in xen_map_device_mmio(). xenmem_add_to_physmap_one() in XEN fails the mapping request if extra.res reserved field in xatp is not zero for XENMAPSPACE_dev_mmio request. Signed-off-by: Jiandi An --- drivers/xen/arm-device.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/xen/arm-device.c b/drivers/xen/arm-device.c index 778acf8..208273b 100644 --- a/drivers/xen/arm-device.c +++ b/drivers/xen/arm-device.c @@ -87,6 +87,9 @@ static int xen_map_device_mmio(const struct resource *resources, idxs[j] = XEN_PFN_DOWN(r->start) + j; } + /* Ensure reserved fields are set to zero */ + memset(&xatp, 0, sizeof(xatp)); + xatp.domid = DOMID_SELF; xatp.size = nr; xatp.space = XENMAPSPACE_dev_mmio; -- Jiandi An Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.