Re: [RFC PATCH 10/13] x86/uintr: Introduce user IPI sender syscalls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 28, 2021 at 11:01:54AM -0700, Sohil Mehta wrote:
> On 9/23/2021 5:28 AM, Greg KH wrote:
> > On Mon, Sep 13, 2021 at 01:01:29PM -0700, Sohil Mehta wrote:
> > > +/* User Interrupt Target Table Entry (UITTE) */
> > > +struct uintr_uitt_entry {
> > > +	u8	valid;			/* bit 0: valid, bit 1-7: reserved */
> > Do you check that the other bits are set to 0?
> 
> I don't have a check but kzalloc() in alloc_uitt() should set it to 0.
> 
> > > +	u8	user_vec;
> > > +	u8	reserved[6];
> > What is this reserved for?
> 
> This is hardware defined structure as well. I should probably mention this
> it in the comment above.
> 
> > > +	u64	target_upid_addr;
> > If this is a pointer, why not say it is a pointer?
> 
> I used a u64 to get the size and alignment of this structure as required by
> the hardware. I wasn't sure if using a struct upid * would complicate that.
> 
> Also this field is never used as a pointer by the kernel. It is only used to
> program an entry that is read by the hardware.
> 
> Is this reasonable or would you still prefer a pointer?

Ok, just document it really well that this is NOT a real address used by
the kernel.  As it is, that's not obvious at all.

And if this crosses the user/kernel boundry, it needs to be __u64 right?

thanks,

greg k-h



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux