From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xiao Guangrong Subject: Re: [PATCH v2 10/18] nvdimm: init the address region used by DSM method Date: Wed, 26 Aug 2015 18:41:18 +0800 Message-ID: <55DD97CE.50801@linux.intel.com> References: <1439563931-12352-1-git-send-email-guangrong.xiao@linux.intel.com> <1439563931-12352-11-git-send-email-guangrong.xiao@linux.intel.com> <20150825161135.GE8344@stefanha-thinkpad.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: pbonzini@redhat.com, imammedo@redhat.com, gleb@kernel.org, mtosatti@redhat.com, stefanha@redhat.com, mst@redhat.com, rth@twiddle.net, ehabkost@redhat.com, kvm@vger.kernel.org, qemu-devel@nongnu.org To: Stefan Hajnoczi Return-path: Received: from mga14.intel.com ([192.55.52.115]:5998 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755582AbbHZKrH (ORCPT ); Wed, 26 Aug 2015 06:47:07 -0400 In-Reply-To: <20150825161135.GE8344@stefanha-thinkpad.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 08/26/2015 12:11 AM, Stefan Hajnoczi wrote: > On Fri, Aug 14, 2015 at 10:52:03PM +0800, Xiao Guangrong wrote: >> @@ -257,14 +258,91 @@ static void build_nfit_table(GSList *device_list, char *buf) >> } >> } >> >> +struct dsm_buffer { >> + /* RAM page. */ >> + uint32_t handle; >> + uint8_t arg0[16]; >> + uint32_t arg1; >> + uint32_t arg2; >> + union { >> + char arg3[PAGE_SIZE - 3 * sizeof(uint32_t) - 16 * sizeof(uint8_t)]; >> + }; >> + >> + /* MMIO page. */ >> + union { >> + uint32_t notify; >> + char pedding[PAGE_SIZE]; > > s/pedding/padding/ Will fix. > >> + }; >> +}; >> + >> +static ram_addr_t dsm_addr; >> +static size_t dsm_size; >> + >> +static uint64_t dsm_read(void *opaque, hwaddr addr, >> + unsigned size) >> +{ >> + return 0; >> +} >> + >> +static void dsm_write(void *opaque, hwaddr addr, >> + uint64_t val, unsigned size) >> +{ >> +} >> + >> +static const MemoryRegionOps dsm_ops = { >> + .read = dsm_read, >> + .write = dsm_write, >> + .endianness = DEVICE_LITTLE_ENDIAN, >> +}; >> + >> +static int build_dsm_buffer(void) >> +{ >> + MemoryRegion *dsm_ram_mr, *dsm_mmio_mr; >> + ram_addr_t addr;; > > s/;;/;/ Will fix.