Received: by 10.192.165.148 with SMTP id m20csp569352imm; Wed, 25 Apr 2018 04:26:06 -0700 (PDT) X-Google-Smtp-Source: AIpwx48zjtuTlmivovBMGP/5VDNibgCxKfI/dUQe+a2Awss4Bavsk86HedpPn6GaXkFeeaJlx0r3 X-Received: by 10.98.108.69 with SMTP id h66mr27584442pfc.43.1524655566655; Wed, 25 Apr 2018 04:26:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524655566; cv=none; d=google.com; s=arc-20160816; b=Cj5ZS+wVDnAEUXJ8zkRKyEFhCA5pY+ta9nP7hVlaaFjWEq3FfuMYkMCNI3CBrnAea+ g2O+dQgD2U64Fh7DWkAWN5PuQ7E/7vj2Uvuh9QKXG5PYOj2kKdffDTHaRmh421yc3UOi B6Gi8wZHKaOKS4oTATLA8hsE2BkHCtUrCMlW0ab2hCkEBIO/V+Z4EVuMVaxoCviSdki4 Rl2ZLzRgqbsgclL+Ko9RlXMjG2jpMIj2XI+PuNaLs0G5MGX/TRvRVE7co7xn2VQBMQbW /IzzRucd064dJxC8AsLw/vlSz4mNXnXxW3AomGzP+h1d/ZNmaY4583A3Fb4VhxdBWD0P FyQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=5KTPecPBZgL1486moNs3+fjdSvAomWSjh4kfkqB+uis=; b=i2fuhwT9HMyUnANlaAcxHLU1Z/58cN0ua1ewzhW/X6gr+3DlV3Dp3BmBRAeNrmRiTw p9EJZaznDati123RJgPBJyRWjhJDPPBieH3LgKy9dO5bt8gK48POBlGX1JvARUqv9z8W bGpKzIg7pfPJK4hTL8ErPclZIoKDsYg7ECNk4KY0lClL9feJ1FF7T7pZjvdyeNqTQzsL FYetyP7b4ccVMCmIssy68JUSwb0QAKRW+1ORD543aZaTLBH64gwqPaq+xZzmGPUaGEYW 01H+Xxpwt9lb59NnFKeNeW0D/zN+uYMn0P9fC/bOzqRQAT2HeYERmdGr/hHUXUXnyTjm KtuQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y101-v6si15993661plh.188.2018.04.25.04.25.52; Wed, 25 Apr 2018 04:26:06 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753816AbeDYLYu (ORCPT + 99 others); Wed, 25 Apr 2018 07:24:50 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:33890 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751528AbeDYLYl (ORCPT ); Wed, 25 Apr 2018 07:24:41 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 849ED406C757; Wed, 25 Apr 2018 11:24:40 +0000 (UTC) Received: from dhcp201-121.englab.pnq.redhat.com (dhcp193-127.pnq.redhat.com [10.65.193.127]) by smtp.corp.redhat.com (Postfix) with ESMTP id AC3FE2023239; Wed, 25 Apr 2018 11:24:34 +0000 (UTC) From: Pankaj Gupta To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, qemu-devel@nongnu.org, linux-nvdimm@ml01.01.org, linux-mm@kvack.org Cc: jack@suse.cz, stefanha@redhat.com, dan.j.williams@intel.com, riel@surriel.com, haozhong.zhang@intel.com, nilal@redhat.com, kwolf@redhat.com, pbonzini@redhat.com, ross.zwisler@intel.com, david@redhat.com, xiaoguangrong.eric@gmail.com, hch@infradead.org, marcel@redhat.com, mst@redhat.com, niteshnarayanlal@hotmail.com, imammedo@redhat.com, pagupta@redhat.com, lcapitulino@redhat.com Subject: [RFC v2 2/2] pmem: device flush over VIRTIO Date: Wed, 25 Apr 2018 16:54:14 +0530 Message-Id: <20180425112415.12327-3-pagupta@redhat.com> In-Reply-To: <20180425112415.12327-1-pagupta@redhat.com> References: <20180425112415.12327-1-pagupta@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 25 Apr 2018 11:24:40 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 25 Apr 2018 11:24:40 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'pagupta@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch adds functionality to perform flush from guest to hosy over VIRTIO when 'ND_REGION_VIRTIO'flag is set on nd_negion. Flag is set by 'virtio-pmem' driver. Signed-off-by: Pankaj Gupta --- drivers/nvdimm/region_devs.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/nvdimm/region_devs.c b/drivers/nvdimm/region_devs.c index a612be6..6c6454e 100644 --- a/drivers/nvdimm/region_devs.c +++ b/drivers/nvdimm/region_devs.c @@ -20,6 +20,7 @@ #include #include "nd-core.h" #include "nd.h" +#include /* * For readq() and writeq() on 32-bit builds, the hi-lo, lo-hi order is @@ -1074,6 +1075,12 @@ void nvdimm_flush(struct nd_region *nd_region) struct nd_region_data *ndrd = dev_get_drvdata(&nd_region->dev); int i, idx; + /* call PV device flush */ + if (test_bit(ND_REGION_VIRTIO, &nd_region->flags)) { + virtio_pmem_flush(&nd_region->dev); + return; + } + /* * Try to encourage some diversity in flush hint addresses * across cpus assuming a limited number of flush hints. -- 2.9.3