Re: [RFC PATCH v2 14/26] x86/sgx: Move provisioning device creation out of SGX driver

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

 



> >  
> > +const struct file_operations sgx_provision_fops = {
> > +	.owner			= THIS_MODULE,
> > +};
> > +
> > +static struct miscdevice sgx_dev_provision = {
> > +	.minor = MISC_DYNAMIC_MINOR,
> > +	.name = "sgx_provision",
> > +	.nodename = "sgx_provision",
> > +	.fops = &sgx_provision_fops,
> > +};
> > +
> > +int sgx_set_attribute(unsigned long *allowed_attributes,
> > +		      unsigned int attribute_fd)
> 
> kdoc

Will do.

> 
> > +{
> > +	struct file *file;
> > +
> > +	file = fget(attribute_fd);
> > +	if (!file)
> > +		return -EINVAL;
> > +
> > +	if (file->f_op != &sgx_provision_fops) {
> > +		fput(file);
> > +		return -EINVAL;
> > +	}
> > +
> > +	*allowed_attributes |= SGX_ATTR_PROVISIONKEY;
> > +
> > +	fput(file);
> > +	return 0;
> > +}
> > +EXPORT_SYMBOL_GPL(sgx_set_attribute);
> > +



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux