From: Christian Borntraeger <borntraeger@de.ibm.com>
To: David Hildenbrand <david@redhat.com>, Cornelia Huck <cohuck@redhat.com>
Cc: KVM <kvm@vger.kernel.org>,
linux-s390 <linux-s390@vger.kernel.org>,
Thomas Huth <thuth@redhat.com>,
Halil Pasic <pasic@linux.vnet.ibm.com>
Subject: Re: [PATCH 1/1] KVM: s390: mark irq_state.flags as non-usable
Date: Tue, 21 Nov 2017 18:42:25 +0100 [thread overview]
Message-ID: <11a6b47b-9e82-78b0-aba0-89d8ae3e4339@de.ibm.com> (raw)
In-Reply-To: <638982df-e3a1-16d4-51a2-5a400075ac3d@redhat.com>
On 11/21/2017 04:18 PM, David Hildenbrand wrote:
> On 21.11.2017 16:08, Christian Borntraeger wrote:
>> Old kernels did not check for zero in the irq_state.flags field and old
>> QEMUs did not zero the flag field when calling KVM_S390_*_IRQ_STATE.
>> Let's add a comment and dummy code to prevent future usage of flags
>> and pad.
>>
>> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
>> ---
>> arch/s390/kvm/kvm-s390.c | 14 ++++++++++++++
>> 1 file changed, 14 insertions(+)
>>
>> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
>> index 6a5e02f..1baa393 100644
>> --- a/arch/s390/kvm/kvm-s390.c
>> +++ b/arch/s390/kvm/kvm-s390.c
>> @@ -3834,6 +3834,16 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
>> r = -EINVAL;
>> break;
>> }
>> + if (irq_state.flags) {
>
> I don't see the need for if (do I need more coffee?).
It is a dummy construct that matches other checks like "if flags return -EINVAL". But since
it is dummy we can do whatever we want (even just a comment) since nobody reads flags as of
today.
>
>> + /*
>> + * This is a placeholder to make sure that nobody uses
>> + * flags and pad. Old kernels did not check for zero
>> + * and old QEMUs did not zero the flag field.
>> + * That means that we cannot use the flags field for
>> + * any possible extension.
>> + */
>> + irq_state.flags = 0;
>> + }
>> r = kvm_s390_set_irq_state(vcpu,
>> (void __user *) irq_state.buf,
>> irq_state.len);
>> @@ -3849,6 +3859,10 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
>> r = -EINVAL;
>> break;
>> }
>> + if (irq_state.flags) {
>
> dito
>
>> + /* see above */
>
> /* same handling as for kvm_s390_set_irq_state() */
>
>> + irq_state.flags = 0;
>> + }
>> r = kvm_s390_get_irq_state(vcpu,
>> (__u8 __user *) irq_state.buf,
>> irq_state.len);
>>
>
>
next prev parent reply other threads:[~2017-11-21 17:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-21 15:08 [PATCH 1/1] KVM: s390: mark irq_state.flags as non-usable Christian Borntraeger
2017-11-21 15:08 ` Christian Borntraeger
2017-11-21 15:18 ` David Hildenbrand
2017-11-21 15:32 ` Cornelia Huck
2017-11-21 17:42 ` Christian Borntraeger [this message]
2017-11-21 18:27 ` Thomas Huth
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=11a6b47b-9e82-78b0-aba0-89d8ae3e4339@de.ibm.com \
--to=borntraeger@de.ibm.com \
--cc=cohuck@redhat.com \
--cc=david@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=pasic@linux.vnet.ibm.com \
--cc=thuth@redhat.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