qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: Ben Widawsky <ben@bwidawsk.net>
Cc: Markus Armbruster <armbru@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	qemu-devel@nongnu.org,
	Xiao Guangrong <xiaoguangrong.eric@gmail.com>
Subject: Re: Handling multiple inheritance [for CXL]
Date: Wed, 27 Jan 2021 22:33:37 +0100	[thread overview]
Message-ID: <20210127223337.24bc5dfa@redhat.com> (raw)
In-Reply-To: <20210127202544.htdvme3yij2asybm@mail.bwidawsk.net>

On Wed, 27 Jan 2021 12:25:44 -0800
Ben Widawsky <ben@bwidawsk.net> wrote:

> On 21-01-27 21:18:24, Igor Mammedov wrote:
> > On Tue, 26 Jan 2021 13:33:52 -0800
> > Ben Widawsky <ben@bwidawsk.net> wrote:
> >   
> > > I'm working on CXL 2.0 type 3 memory devices [1]. In short, these are PCIe devices
> > > that have persistent memory on them. As such, it would be nice to inherit from
> > > both a PCI_DEVICE class as well as an NVDIMM device class.
> > > 
> > > Truth be told, using TYPE_MEMORY_DEVICE as the interface does provide most of
> > > what I need.  
> > could you be more specific on what you need from it?
> >   
> 
> I'm trying to register my persistent memory as normal system memory. I assume
> it's required that I implement the memory interface to do that. If it's not,
> that's fine too.
> 
> For reference:
> https://gitlab.com/bwidawsk/qemu/-/blob/cxl-2.0v3/hw/mem/cxl_type3.c

if you use TYPE_MEMORY_DEVICE machinery, then address/(max)size a device takes in
hotplug ram window, is fixed at device creation time.
If you use PCI BAR to map memory, it should be possible to reprogram BAR
anywhere in PCI address space at runtime.

> > >I'm wondering what the best way to handle this is. Currently, the
> > > only thing NVDIMM class provides is write/read_label_data, this is driven by
> > > _DSM. For CXL, the mechanism to read/write the equivalent area is not done via
> > > _DSM, but done directly via a mailbox interface. However, the intent is the
> > > same, and so utilizing similar code seems ideal.
> > > 
> > > If there's a desire to unify these code paths, I'd need something like multiple
> > > inheritance. I'm looking for some feedback here on how to do it.
> > > 
> > > Thanks.
> > > Ben
> > > 
> > > [1]: https://lore.kernel.org/qemu-devel/20210105165323.783725-1-ben.widawsky@intel.com/
> > >   
> >   
> 



  reply	other threads:[~2021-01-27 21:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-26 21:33 Handling multiple inheritance [for CXL] Ben Widawsky
2021-01-27 10:06 ` Daniel P. Berrangé
2021-01-27 17:16   ` Ben Widawsky
2021-01-27 20:18 ` Igor Mammedov
2021-01-27 20:25   ` Ben Widawsky
2021-01-27 21:33     ` Igor Mammedov [this message]
2021-01-27 21:39       ` Ben Widawsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210127223337.24bc5dfa@redhat.com \
    --to=imammedo@redhat.com \
    --cc=armbru@redhat.com \
    --cc=ben@bwidawsk.net \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=xiaoguangrong.eric@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).