All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: Thomas Huth <THUTH@de.ibm.com>
Cc: kvm@vger.kernel.org,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Cornelia Huck <cornelia.huck@de.ibm.com>,
	Alexander Graf <agraf@suse.de>,
	Jens Freimann <jfrei@linux.vnet.ibm.com>
Subject: Re: [PATCH/RFC 4/9] KVM: s390: Add MEMOP ioctls for reading/writing guest memory
Date: Thu, 19 Mar 2015 20:24:26 -0300	[thread overview]
Message-ID: <20150319232426.GA11359@amt.cnet> (raw)
In-Reply-To: <OFF4952BFC.D205FA61-ONC1257E0D.00470A55-C1257E0D.0048D030@de.ibm.com>

On Thu, Mar 19, 2015 at 02:15:18PM +0100, Thomas Huth wrote:
> > Date: Wed, 18 Mar 2015 21:23:48 -0300
> > From: Marcelo Tosatti <mtosatti@redhat.com>
> >
> > On Mon, Mar 16, 2015 at 09:51:40AM +0100, Christian Borntraeger wrote:
> > > From: Thomas Huth <thuth@linux.vnet.ibm.com>
> > >
> > > On s390, we've got to make sure to hold the IPTE lock while accessing
> > > logical memory. So let's add an ioctl for reading and writing logical
> > > memory to provide this feature for userspace, too.
> ...
> >
> > What i was wondering is why you can't translate the address
> > in the kernel and let userspace perform the actual read/write?
> 
> The idea here is to protect the read/write access with the ipte-lock, too.
> That way, the whole address translation _and_ the read/write access are
> protected together against invalidate-page-table operations from other
> CPUs,
> so the whole memory access looks atomic for other VCPUs. And since we do
> not
> want to expose the ipte lock directly to user space, both has to be done
> in the kernel.
> We already had a long internal discussion about this in our team, and
> indeed, if the ipte-lock would be the only "problem" that we face on s390,
> we might also come up with a solution where the memory read/write access
> is done in userspace instead. However, for full architecture compliance,
> we later have got to support the so-called "storage keys" during memory
> accesses, too, and this can hardly be done accurately and safely from
> userspace. So I'm afraid, it's somewhat ugly that we've got to provide an
> ioctl here to read/write the guest memory, but it's the only feasible
> solution that I could think of.

I see, thanks.


  reply	other threads:[~2015-03-19 23:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20150319090759.6acae229@gondolin>
2015-03-19 13:15 ` [PATCH/RFC 4/9] KVM: s390: Add MEMOP ioctls for reading/writing guest memory Thomas Huth
2015-03-19 23:24   ` Marcelo Tosatti [this message]
2015-03-16  8:51 [PATCH/RFC 0/9] Next bunch of KVM/s390x changes for next Christian Borntraeger
2015-03-16  8:51 ` [PATCH/RFC 4/9] KVM: s390: Add MEMOP ioctls for reading/writing guest memory Christian Borntraeger
2015-03-16 12:16   ` Cornelia Huck
2015-03-16 12:23     ` Christian Borntraeger
2015-03-19  0:23   ` Marcelo Tosatti

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=20150319232426.GA11359@amt.cnet \
    --to=mtosatti@redhat.com \
    --cc=THUTH@de.ibm.com \
    --cc=agraf@suse.de \
    --cc=borntraeger@de.ibm.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=jfrei@linux.vnet.ibm.com \
    --cc=kvm@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.