All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jared Rossi <jrossi@linux.ibm.com>
To: Thomas Huth <thuth@redhat.com>, qemu-devel@nongnu.org
Cc: qemu-s390x@nongnu.org,
	"Christian Borntraeger" <borntraeger@linux.ibm.com>,
	"Cédric Le Goater" <clg@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Boris Fiuczynski" <fiuczy@linux.ibm.com>
Subject: Re: [PATCH] hw/s390x: Restrict "loadparm" property to devices that can be used for booting
Date: Thu, 14 Nov 2024 11:45:09 -0500	[thread overview]
Message-ID: <cb59817c-e9ba-4d64-913c-b68d640cde8c@linux.ibm.com> (raw)
In-Reply-To: <a3d5ecee-3959-4136-a29c-1f7ec36831e3@redhat.com>



On 11/14/24 7:39 AM, Thomas Huth wrote:
> On 13/11/2024 15.49, Jared Rossi wrote:
> ...
>> Hi Thomas,
>>
>> Thanks for putting this fix together.  As we previously discussed, I 
>> do agree
>> that my naive implementation of the “loadparm” property at the top-level
>> CcwDevice was not satisfactory, and certainly virtio-gpu and 
>> virtio-tablet
>> should not have a “loadparm.”
>>
>> The reason I had not yet submitted a fix is that I’ve gotten some 
>> feedback from
>> the Libvirt side that suggests the CcwDevice implementation is not 
>> sufficient
>> in general.  Libvirt will require that non-ccw devices (e.g. scsi-hd) 
>> also
>> support per-device loadparm.  I do not yet know how to add that type 
>> of support
>> and given that we are in hard freeze I’m not sure it is possible now.
>>
>> Obviously this is not ideal, and I truly do apologize for the confusion.
>
>  Hi Jared,
>
> yes, that scsi-hd problem is a little bit tricky, since it's common 
> code that we should not "pollute" too much with s390x specific stuff, 
> especially since we're in hard freeze now.
>
> After staring at the code for quite a while, I think one option might 
> be to just add a string "loadparm" property to the SCSI devices, 
> that's just a simple two-line change to the common code. Patch 
> suggestion can be found here:
>
>  https://lore.kernel.org/qemu-devel/20241114122919.973930-1-thuth@redhat.com/ 
>
>
> The only disadvantage is that this is now checking for valid 
> characters in the string after the property has already been set, so 
> it cannot prevent the setting of bad characters. But it still prints 
> out an error message later, so I hope that is also still acceptable.
>
> Let me know what you think about it!
>
>  Thanks,
>   Thomas
>
Thanks Thomas,

I replied to the patch as well, but the setter does other validation 
beyond just the characters.  In particular it ensures a loadparm value 
is assigned only to boot devices.  This has significance when probing 
for devices, since the per-device loadparm value is stored in the IPLB, 
and an IPLB is only generated for devices with an assigned boot index.

I would say the scsi loadparm probing issue is actually a legitimate 
concern since it can result in unexpected behavior with which kernel is 
selected, but probably we want to avoid adding too much s390x specific 
validation to the common code, so I'm not sure what the best solution 
is.  Maybe there is a better way to restrict the loadparm to boot 
devices that doesn't need the property setter?

On a side note, while testing your patch I also realized that the 
machine loadparm was being ignored during probing, so I've sent out a 
patch to fix that...

Thanks again for all the help with this,
     Jared Rossi


  reply	other threads:[~2024-11-14 16:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-13 11:47 [PATCH] hw/s390x: Restrict "loadparm" property to devices that can be used for booting Thomas Huth
2024-11-13 11:53 ` Philippe Mathieu-Daudé
2024-11-13 14:49 ` Jared Rossi
2024-11-14 12:39   ` Thomas Huth
2024-11-14 16:45     ` Jared Rossi [this message]
2024-11-13 20:50 ` Jared Rossi

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=cb59817c-e9ba-4d64-913c-b68d640cde8c@linux.ibm.com \
    --to=jrossi@linux.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=clg@redhat.com \
    --cc=fiuczy@linux.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --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 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.