All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>,
	Thomas Huth <thuth@linux.vnet.ibm.com>
Cc: cornelia.huck@de.ibm.com, qemu-devel@nongnu.org,
	kvm@vger.kernel.org, agraf@suse.de
Subject: Re: [PATCH RFC 1/1] KVM: s390: Add MEMOP ioctl for reading/writing guest memory
Date: Wed, 04 Feb 2015 11:39:30 +0100	[thread overview]
Message-ID: <54D1F6E2.1040201@redhat.com> (raw)
In-Reply-To: <54D1D7A3.8010508@de.ibm.com>



On 04/02/2015 09:26, Christian Borntraeger wrote:
> Am 03.02.2015 um 16:22 schrieb Paolo Bonzini:
>> On 03/02/2015 16:16, Thomas Huth wrote:
>>> Actually, I'd prefer to keep the "virtual" in the defines for the type
>>> of operation below: When it comes to s390 storage keys, we likely might
>>> need some calls for reading and writing to physical memory, too. Then
>>> we could simply extend this ioctl instead of inventing a new one.
> 
> Rereading that. Shall we replace "virtual" with "logical"? That is what is
> used architecturally when we mean "do whatever is appropriate right now"
> That can boil down to virtual via DAT, virtual via access register mode, 
> real if DAT is off... and if fact your kernel implementation does that.

That makes sense.

>> Can you explain why it is necessary to read/write physical addresses
>> from user space?  In the case of QEMU, I'm worried that you would have
>> to invent your own memory read/write APIs that are different from
>> everything else.
>>
>> On real s390 zPCI, does bus-master DMA update storage keys?
> 
> the classic channel I/O does set the storage key change/reference and
> also triggers errors in the storage key protection value mismatches.
> 
> The PCI IOTA structure does contain a storage key value for accesses,
> so I assume its the same here, but I dont know for sure.

Emulating that in QEMU would be very hard.  Every DMA read/write would
have to go through a bounce buffer, but QEMU block device models for
example try hard to read from host disk directly into guest memory.

> Conny:
> I am asking myself, if we should explicitly add a comment in the 
> virtio-ccw spec, that all accesses are assumed to be with key 0 and 
> thus never cause key protection. The change/reference bit is set
> by the underlying I/O or memory copy anyway.

Can you explain the last sentence? :)

Paolo

> We can then add a ccw later on to set a different key if we ever need
> that.
> 
> 
>>
>>>> Not really true, as you don't check it.  So "It is not used by KVM with
>>>> the currently defined set of flags" is a better explanation.
>>>
>>> ok ... and maybe add "should be set to zero" ?
>>
>> If you don't check it, it is misleading to document this.
>>
>> Paolo
>> --
>> To unsubscribe from this list: send the line "unsubscribe kvm" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
> 
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

WARNING: multiple messages have this Message-ID (diff)
From: Paolo Bonzini <pbonzini@redhat.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>,
	Thomas Huth <thuth@linux.vnet.ibm.com>
Cc: cornelia.huck@de.ibm.com, qemu-devel@nongnu.org,
	kvm@vger.kernel.org, agraf@suse.de
Subject: Re: [Qemu-devel] [PATCH RFC 1/1] KVM: s390: Add MEMOP ioctl for reading/writing guest memory
Date: Wed, 04 Feb 2015 11:39:30 +0100	[thread overview]
Message-ID: <54D1F6E2.1040201@redhat.com> (raw)
In-Reply-To: <54D1D7A3.8010508@de.ibm.com>



On 04/02/2015 09:26, Christian Borntraeger wrote:
> Am 03.02.2015 um 16:22 schrieb Paolo Bonzini:
>> On 03/02/2015 16:16, Thomas Huth wrote:
>>> Actually, I'd prefer to keep the "virtual" in the defines for the type
>>> of operation below: When it comes to s390 storage keys, we likely might
>>> need some calls for reading and writing to physical memory, too. Then
>>> we could simply extend this ioctl instead of inventing a new one.
> 
> Rereading that. Shall we replace "virtual" with "logical"? That is what is
> used architecturally when we mean "do whatever is appropriate right now"
> That can boil down to virtual via DAT, virtual via access register mode, 
> real if DAT is off... and if fact your kernel implementation does that.

That makes sense.

>> Can you explain why it is necessary to read/write physical addresses
>> from user space?  In the case of QEMU, I'm worried that you would have
>> to invent your own memory read/write APIs that are different from
>> everything else.
>>
>> On real s390 zPCI, does bus-master DMA update storage keys?
> 
> the classic channel I/O does set the storage key change/reference and
> also triggers errors in the storage key protection value mismatches.
> 
> The PCI IOTA structure does contain a storage key value for accesses,
> so I assume its the same here, but I dont know for sure.

Emulating that in QEMU would be very hard.  Every DMA read/write would
have to go through a bounce buffer, but QEMU block device models for
example try hard to read from host disk directly into guest memory.

> Conny:
> I am asking myself, if we should explicitly add a comment in the 
> virtio-ccw spec, that all accesses are assumed to be with key 0 and 
> thus never cause key protection. The change/reference bit is set
> by the underlying I/O or memory copy anyway.

Can you explain the last sentence? :)

Paolo

> We can then add a ccw later on to set a different key if we ever need
> that.
> 
> 
>>
>>>> Not really true, as you don't check it.  So "It is not used by KVM with
>>>> the currently defined set of flags" is a better explanation.
>>>
>>> ok ... and maybe add "should be set to zero" ?
>>
>> If you don't check it, it is misleading to document this.
>>
>> Paolo
>> --
>> To unsubscribe from this list: send the line "unsubscribe kvm" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
> 
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

  reply	other threads:[~2015-02-04 10:39 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-03 12:11 [PATCH RFC 0/1] KVM: ioctl for reading/writing guest memory Thomas Huth
2015-02-03 12:11 ` [Qemu-devel] " Thomas Huth
2015-02-03 12:11 ` [PATCH RFC 1/1] KVM: s390: Add MEMOP " Thomas Huth
2015-02-03 12:11   ` [Qemu-devel] " Thomas Huth
2015-02-03 13:04   ` Paolo Bonzini
2015-02-03 13:04     ` [Qemu-devel] " Paolo Bonzini
2015-02-03 15:16     ` Thomas Huth
2015-02-03 15:16       ` [Qemu-devel] " Thomas Huth
2015-02-03 15:22       ` Paolo Bonzini
2015-02-03 15:22         ` [Qemu-devel] " Paolo Bonzini
2015-02-04  7:53         ` Thomas Huth
2015-02-04  7:53           ` [Qemu-devel] " Thomas Huth
2015-02-04  8:26         ` Christian Borntraeger
2015-02-04  8:26           ` [Qemu-devel] " Christian Borntraeger
2015-02-04 10:39           ` Paolo Bonzini [this message]
2015-02-04 10:39             ` Paolo Bonzini
2015-02-04 11:25             ` Christian Borntraeger
2015-02-04 11:25               ` [Qemu-devel] " Christian Borntraeger
2015-02-04 11:42               ` Paolo Bonzini
2015-02-04 11:42                 ` [Qemu-devel] " Paolo Bonzini
2015-02-04 12:16                 ` Christian Borntraeger
2015-02-04 12:16                   ` [Qemu-devel] " Christian Borntraeger
2015-02-04 10:57           ` Thomas Huth
2015-02-04 10:57             ` [Qemu-devel] " Thomas Huth
2015-02-05 13:00           ` Cornelia Huck
2015-02-05 13:00             ` [Qemu-devel] " Cornelia Huck
2015-02-03 12:59 ` [PATCH RFC 0/1] KVM: " Paolo Bonzini
2015-02-03 12:59   ` [Qemu-devel] " Paolo Bonzini
2015-02-03 13:05   ` Christian Borntraeger
2015-02-03 13:05     ` [Qemu-devel] " Christian Borntraeger

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=54D1F6E2.1040201@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=agraf@suse.de \
    --cc=borntraeger@de.ibm.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@linux.vnet.ibm.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 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.