On 06.02.2025 18:17, Roger Pau Monné wrote:
> On Thu, Feb 06, 2025 at 05:39:00PM +0800, Jiqian Chen wrote:
>> + rc = vpci_add_register(pdev->vpci, vpci_hw_read32, rebar_ctrl_write,
>> + rebar_offset + PCI_REBAR_CTRL(i), 4, bar);
>> + if ( rc )
>> + {
>> + printk(XENLOG_ERR "%pd %pp: BAR%u fail to add reg of REBAR_CTRL
>> rc=%d\n",
>> + pdev->domain, &pdev->sbdf, index, rc);
>> + /*
>> + * Ideally we would hide the ReBar capability here, but code
>> + * for doing so still needs to be written. And using continue
>> + * can keep any possible hooks working, instead, returning
>> + * failure would cause all vPCI hooks down and hardware domain
>> + * has entirely unmediated access to the device, which is worse.
>> + */
>
> "Ideally we would hide the ReBar capability on error, but code for
> doing so still needs to be written. Use continue instead to keep any
> already setup register hooks, as returning an error will cause
> the hardware domain to get unmediated access to all device registers."
>
> Seems slightly easier to parse IMO (again I'm not a native speaker, so
> your proposed comment might be better).
+1
Jan