* [Qemu-devel] [PATCH for-2.11] hw/s390x/s390-skeys: Mark the storage key devices with user_creatable = false
@ 2017-08-24 10:08 Thomas Huth
2017-08-24 10:29 ` Claudio Imbrenda
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Thomas Huth @ 2017-08-24 10:08 UTC (permalink / raw)
To: qemu-devel, Cornelia Huck, Christian Borntraeger
Cc: David Hildenbrand, Claudio Imbrenda, Dong Jia Shi, Eric Farman,
Halil Pasic, Jason J Herne, Pierre Morel
QEMU currently aborts if the user tries to create a skey device:
$ s390x-softmmu/qemu-system-s390x -nographic -device s390-skeys-qemu
qemu-system-s390x: hw/s390x/s390-skeys.c:30: s390_get_skeys_device:
Assertion `ss' failed.
Aborted (core dumped)
The storage key devices are only meant to be instantiated one time,
internally. They can not be used by the user, so mark them with
user_creatable = false.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
hw/s390x/s390-skeys-kvm.c | 4 ++++
hw/s390x/s390-skeys.c | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/hw/s390x/s390-skeys-kvm.c b/hw/s390x/s390-skeys-kvm.c
index 131da56..dc54ed8 100644
--- a/hw/s390x/s390-skeys-kvm.c
+++ b/hw/s390x/s390-skeys-kvm.c
@@ -54,10 +54,14 @@ static int kvm_s390_skeys_set(S390SKeysState *ss, uint64_t start_gfn,
static void kvm_s390_skeys_class_init(ObjectClass *oc, void *data)
{
S390SKeysClass *skeyclass = S390_SKEYS_CLASS(oc);
+ DeviceClass *dc = DEVICE_CLASS(oc);
skeyclass->skeys_enabled = kvm_s390_skeys_enabled;
skeyclass->get_skeys = kvm_s390_skeys_get;
skeyclass->set_skeys = kvm_s390_skeys_set;
+
+ /* Reason: Internal device (only one skeys device for the whole memory) */
+ dc->user_creatable = false;
}
static const TypeInfo kvm_s390_skeys_info = {
diff --git a/hw/s390x/s390-skeys.c b/hw/s390x/s390-skeys.c
index c0de3b0..53ad5d3 100644
--- a/hw/s390x/s390-skeys.c
+++ b/hw/s390x/s390-skeys.c
@@ -229,10 +229,14 @@ static int qemu_s390_skeys_get(S390SKeysState *ss, uint64_t start_gfn,
static void qemu_s390_skeys_class_init(ObjectClass *oc, void *data)
{
S390SKeysClass *skeyclass = S390_SKEYS_CLASS(oc);
+ DeviceClass *dc = DEVICE_CLASS(oc);
skeyclass->skeys_enabled = qemu_s390_skeys_enabled;
skeyclass->get_skeys = qemu_s390_skeys_get;
skeyclass->set_skeys = qemu_s390_skeys_set;
+
+ /* Reason: Internal device (only one skeys device for the whole memory) */
+ dc->user_creatable = false;
}
static const TypeInfo qemu_s390_skeys_info = {
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH for-2.11] hw/s390x/s390-skeys: Mark the storage key devices with user_creatable = false
2017-08-24 10:08 [Qemu-devel] [PATCH for-2.11] hw/s390x/s390-skeys: Mark the storage key devices with user_creatable = false Thomas Huth
@ 2017-08-24 10:29 ` Claudio Imbrenda
2017-08-24 10:40 ` Halil Pasic
2017-08-24 11:28 ` Cornelia Huck
2 siblings, 0 replies; 4+ messages in thread
From: Claudio Imbrenda @ 2017-08-24 10:29 UTC (permalink / raw)
To: Thomas Huth
Cc: qemu-devel, Cornelia Huck, Christian Borntraeger,
David Hildenbrand, Dong Jia Shi, Eric Farman, Halil Pasic,
Jason J Herne, Pierre Morel
On Thu, 24 Aug 2017 12:08:48 +0200
Thomas Huth <thuth@redhat.com> wrote:
> QEMU currently aborts if the user tries to create a skey device:
>
> $ s390x-softmmu/qemu-system-s390x -nographic -device s390-skeys-qemu
> qemu-system-s390x: hw/s390x/s390-skeys.c:30: s390_get_skeys_device:
> Assertion `ss' failed.
> Aborted (core dumped)
>
> The storage key devices are only meant to be instantiated one time,
> internally. They can not be used by the user, so mark them with
> user_creatable = false.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> hw/s390x/s390-skeys-kvm.c | 4 ++++
> hw/s390x/s390-skeys.c | 4 ++++
> 2 files changed, 8 insertions(+)
>
> diff --git a/hw/s390x/s390-skeys-kvm.c b/hw/s390x/s390-skeys-kvm.c
> index 131da56..dc54ed8 100644
> --- a/hw/s390x/s390-skeys-kvm.c
> +++ b/hw/s390x/s390-skeys-kvm.c
> @@ -54,10 +54,14 @@ static int kvm_s390_skeys_set(S390SKeysState *ss,
> uint64_t start_gfn, static void kvm_s390_skeys_class_init(ObjectClass
> *oc, void *data) {
> S390SKeysClass *skeyclass = S390_SKEYS_CLASS(oc);
> + DeviceClass *dc = DEVICE_CLASS(oc);
>
> skeyclass->skeys_enabled = kvm_s390_skeys_enabled;
> skeyclass->get_skeys = kvm_s390_skeys_get;
> skeyclass->set_skeys = kvm_s390_skeys_set;
> +
> + /* Reason: Internal device (only one skeys device for the whole
> memory) */
> + dc->user_creatable = false;
> }
>
> static const TypeInfo kvm_s390_skeys_info = {
> diff --git a/hw/s390x/s390-skeys.c b/hw/s390x/s390-skeys.c
> index c0de3b0..53ad5d3 100644
> --- a/hw/s390x/s390-skeys.c
> +++ b/hw/s390x/s390-skeys.c
> @@ -229,10 +229,14 @@ static int qemu_s390_skeys_get(S390SKeysState
> *ss, uint64_t start_gfn, static void
> qemu_s390_skeys_class_init(ObjectClass *oc, void *data) {
> S390SKeysClass *skeyclass = S390_SKEYS_CLASS(oc);
> + DeviceClass *dc = DEVICE_CLASS(oc);
>
> skeyclass->skeys_enabled = qemu_s390_skeys_enabled;
> skeyclass->get_skeys = qemu_s390_skeys_get;
> skeyclass->set_skeys = qemu_s390_skeys_set;
> +
> + /* Reason: Internal device (only one skeys device for the whole
> memory) */
> + dc->user_creatable = false;
> }
>
> static const TypeInfo qemu_s390_skeys_info = {
Reviewed-by: Claudio Imbrenda <imbrenda@linux.vnet.ibm.com>
we probably need something like this for the storage attributes
device too
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH for-2.11] hw/s390x/s390-skeys: Mark the storage key devices with user_creatable = false
2017-08-24 10:08 [Qemu-devel] [PATCH for-2.11] hw/s390x/s390-skeys: Mark the storage key devices with user_creatable = false Thomas Huth
2017-08-24 10:29 ` Claudio Imbrenda
@ 2017-08-24 10:40 ` Halil Pasic
2017-08-24 11:28 ` Cornelia Huck
2 siblings, 0 replies; 4+ messages in thread
From: Halil Pasic @ 2017-08-24 10:40 UTC (permalink / raw)
To: Thomas Huth, qemu-devel, Cornelia Huck, Christian Borntraeger
Cc: Eric Farman, David Hildenbrand, Pierre Morel, Claudio Imbrenda,
Jason J Herne, Dong Jia Shi
On 08/24/2017 12:08 PM, Thomas Huth wrote:
> QEMU currently aborts if the user tries to create a skey device:
>
> $ s390x-softmmu/qemu-system-s390x -nographic -device s390-skeys-qemu
> qemu-system-s390x: hw/s390x/s390-skeys.c:30: s390_get_skeys_device:
> Assertion `ss' failed.
> Aborted (core dumped)
>
> The storage key devices are only meant to be instantiated one time,
> internally. They can not be used by the user, so mark them with
> user_creatable = false.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> hw/s390x/s390-skeys-kvm.c | 4 ++++
> hw/s390x/s390-skeys.c | 4 ++++
> 2 files changed, 8 insertions(+)
>
> diff --git a/hw/s390x/s390-skeys-kvm.c b/hw/s390x/s390-skeys-kvm.c
> index 131da56..dc54ed8 100644
> --- a/hw/s390x/s390-skeys-kvm.c
> +++ b/hw/s390x/s390-skeys-kvm.c
> @@ -54,10 +54,14 @@ static int kvm_s390_skeys_set(S390SKeysState *ss, uint64_t start_gfn,
> static void kvm_s390_skeys_class_init(ObjectClass *oc, void *data)
> {
> S390SKeysClass *skeyclass = S390_SKEYS_CLASS(oc);
> + DeviceClass *dc = DEVICE_CLASS(oc);
>
> skeyclass->skeys_enabled = kvm_s390_skeys_enabled;
> skeyclass->get_skeys = kvm_s390_skeys_get;
> skeyclass->set_skeys = kvm_s390_skeys_set;
> +
> + /* Reason: Internal device (only one skeys device for the whole memory) */
> + dc->user_creatable = false;
> }
>
> static const TypeInfo kvm_s390_skeys_info = {
> diff --git a/hw/s390x/s390-skeys.c b/hw/s390x/s390-skeys.c
> index c0de3b0..53ad5d3 100644
> --- a/hw/s390x/s390-skeys.c
> +++ b/hw/s390x/s390-skeys.c
> @@ -229,10 +229,14 @@ static int qemu_s390_skeys_get(S390SKeysState *ss, uint64_t start_gfn,
> static void qemu_s390_skeys_class_init(ObjectClass *oc, void *data)
> {
> S390SKeysClass *skeyclass = S390_SKEYS_CLASS(oc);
> + DeviceClass *dc = DEVICE_CLASS(oc);
>
> skeyclass->skeys_enabled = qemu_s390_skeys_enabled;
> skeyclass->get_skeys = qemu_s390_skeys_get;
> skeyclass->set_skeys = qemu_s390_skeys_set;
> +
> + /* Reason: Internal device (only one skeys device for the whole memory) */
> + dc->user_creatable = false;
> }
>
> static const TypeInfo qemu_s390_skeys_info = {
>
Reviewed-by: Halil Pasic <pasic@linux.vnet.ibm.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH for-2.11] hw/s390x/s390-skeys: Mark the storage key devices with user_creatable = false
2017-08-24 10:08 [Qemu-devel] [PATCH for-2.11] hw/s390x/s390-skeys: Mark the storage key devices with user_creatable = false Thomas Huth
2017-08-24 10:29 ` Claudio Imbrenda
2017-08-24 10:40 ` Halil Pasic
@ 2017-08-24 11:28 ` Cornelia Huck
2 siblings, 0 replies; 4+ messages in thread
From: Cornelia Huck @ 2017-08-24 11:28 UTC (permalink / raw)
To: Thomas Huth
Cc: qemu-devel, Christian Borntraeger, David Hildenbrand,
Claudio Imbrenda, Dong Jia Shi, Eric Farman, Halil Pasic,
Jason J Herne, Pierre Morel
On Thu, 24 Aug 2017 12:08:48 +0200
Thomas Huth <thuth@redhat.com> wrote:
> QEMU currently aborts if the user tries to create a skey device:
>
> $ s390x-softmmu/qemu-system-s390x -nographic -device s390-skeys-qemu
> qemu-system-s390x: hw/s390x/s390-skeys.c:30: s390_get_skeys_device:
> Assertion `ss' failed.
> Aborted (core dumped)
>
> The storage key devices are only meant to be instantiated one time,
> internally. They can not be used by the user, so mark them with
> user_creatable = false.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> hw/s390x/s390-skeys-kvm.c | 4 ++++
> hw/s390x/s390-skeys.c | 4 ++++
> 2 files changed, 8 insertions(+)
Thanks, applied.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-08-24 11:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-24 10:08 [Qemu-devel] [PATCH for-2.11] hw/s390x/s390-skeys: Mark the storage key devices with user_creatable = false Thomas Huth
2017-08-24 10:29 ` Claudio Imbrenda
2017-08-24 10:40 ` Halil Pasic
2017-08-24 11:28 ` Cornelia Huck
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).