Re: [PATCH v4 1/2] virt: pvmemcontrol: control guest physical memory properties

From: Greg Kroah-Hartman
Date: Tue Oct 22 2024 - 01:19:03 EST


On Mon, Oct 21, 2024 at 01:48:48PM -0700, Yuanchu Xie wrote:
> +static DEFINE_RWLOCK(pvmemcontrol_lock);

What does this lock control?

> +static struct pvmemcontrol *pvmemcontrol __read_mostly;

Having a single static device should not be needed, please tie this
properly to the pci device that the driver core gives you. With this
design, you have limited yourself to a fixed number of devices in the
system at once (i.e. 1). This isn't the 1990's anymore, drivers should
be able to handle any number of devices at once.

thanks,

greg k-h