From patchwork Mon Mar 20 00:12:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haozhong Zhang X-Patchwork-Id: 9632887 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id ECEB86020B for ; Mon, 20 Mar 2017 00:15:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E14BA27F8C for ; Mon, 20 Mar 2017 00:15:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D61F22807E; Mon, 20 Mar 2017 00:15:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6BE4F27F8C for ; Mon, 20 Mar 2017 00:15:55 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cpkwb-0006Pp-BE; Mon, 20 Mar 2017 00:13:05 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cpkwZ-0006PW-V6 for xen-devel@lists.xen.org; Mon, 20 Mar 2017 00:13:04 +0000 Received: from [85.158.143.35] by server-5.bemta-6.messagelabs.com id 6C/71-27545-F8E1FC85; Mon, 20 Mar 2017 00:13:03 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrNLMWRWlGSWpSXmKPExsVywNykWLdP7ny EQdsZA4slHxezODB6HN39mymAMYo1My8pvyKBNePyj6dMBZ84Khp+rmZqYNzL3sXIxcEicItJ om3LQjBHSGA6o8Tcuy/Yuhg5OSQEeCWOLJvBCmH7SVxdtpcJoqiXUaJ92XZGkASbgL7EiscHg Yo4OEQEjCXabjqD1DALNDNJHJzayg5SIyzgLfHjzFKwoSwCqhJvlvSBxXkFbCVeL53NDLFAXu LC1VMsIHM4BewkOma7gYSFgEp+rJrMMoGRbwEjwypGjeLUorLUIl0jI72kosz0jJLcxMwcXUM DM73c1OLixPTUnMSkYr3k/NxNjMBAYQCCHYxr5gceYpTkYFIS5f2nfi5CiC8pP6UyI7E4I76o NCe1+BCjDAeHkgSvn8T5CCHBotT01Iq0zBxgyMKkJTh4lER4J0kBpXmLCxJzizPTIVKnGBWlx HmjJYESAiCJjNI8uDZYnFxilJUS5mUEOkSIpyC1KDezBFX+FaM4B6OSMC+vKNAUnsy8Erjpr4 AWMwEtXnbjDMjikkSElFQDY1DBhy3pjiKPVGXbwqKvb4vyjltW+56pZO2V2sPXb3K/rDkop11 r+WPiozWxjRE+Ftln3r2aFbdfYUqN2KJTXL/LZWq+Coi0qazddtCiKOTiA4/7HFub5t2NmG+1 8iBH8X22X08veQoeDe76/u7kI4kddyfM3X19RryZ61SVpFWqnkaGx5gk8pVYijMSDbWYi4oTA SM24rKOAgAA X-Env-Sender: haozhong.zhang@intel.com X-Msg-Ref: server-12.tower-21.messagelabs.com!1489968779!61372038!2 X-Originating-IP: [192.55.52.115] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.2.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 29368 invoked from network); 20 Mar 2017 00:13:02 -0000 Received: from mga14.intel.com (HELO mga14.intel.com) (192.55.52.115) by server-12.tower-21.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 20 Mar 2017 00:13:02 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1489968782; x=1521504782; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=69cbX8lJFRJB4SPiiPiTLKWbIG46rS+hRTXIg1yRfys=; b=vITrTc5RQoNNGN2757KUZ0XtVjx7Zc9HOIcGP6fTG5q0RCIq/LMhq7/F /kmog+xYr6v+Oo9qPv3TeTWA9FJakw==; Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Mar 2017 17:13:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,191,1486454400"; d="scan'208";a="78799108" Received: from hz-desktop.sh.intel.com (HELO localhost) ([10.239.159.153]) by fmsmga006.fm.intel.com with ESMTP; 19 Mar 2017 17:12:59 -0700 From: Haozhong Zhang To: qemu-devel@nongnu.org, xen-devel@lists.xen.org Date: Mon, 20 Mar 2017 08:12:40 +0800 Message-Id: <20170320001249.25521-2-haozhong.zhang@intel.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20170320001249.25521-1-haozhong.zhang@intel.com> References: <20170320001249.25521-1-haozhong.zhang@intel.com> Cc: Haozhong Zhang , Xiao Guangrong , "Michael S. Tsirkin" , Igor Mammedov , Konrad Rzeszutek Wilk , Dan Williams Subject: [Xen-devel] [RFC QEMU PATCH v2 01/10] nvdimm xen: disable label support on Xen X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP If xen_enabled(), memory_region_get_ram_ptr() always returns NULL and nvdimm_realize() cannot get the correct pointer to the label area. This commit disables the label support for Xen accelerator to workaround this issue. Signed-off-by: Haozhong Zhang --- Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: Xiao Guangrong --- hw/mem/nvdimm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c index db896b0bb6..0d3e17e94c 100644 --- a/hw/mem/nvdimm.c +++ b/hw/mem/nvdimm.c @@ -87,7 +87,11 @@ static void nvdimm_realize(PCDIMMDevice *dimm, Error **errp) align = memory_region_get_alignment(mr); pmem_size = size - nvdimm->label_size; - nvdimm->label_data = memory_region_get_ram_ptr(mr) + pmem_size; + /* + * TODO: explain the reason + */ + if (nvdimm->label_size) + nvdimm->label_data = memory_region_get_ram_ptr(mr) + pmem_size; pmem_size = QEMU_ALIGN_DOWN(pmem_size, align); if (size <= nvdimm->label_size || !pmem_size) {