Hi, While creating a patch file from the latest Xen, I noticed something strange. There''s an ioctl being added to /dev/mem. I''m wondering what it''s used for and why it''s using /dev/mem instead of (say) /dev/xenctl ... +static int ioctl_mem(struct inode * inode, struct file * file, unsigned int cmd, unsigned long arg) +{ + switch (cmd) { + case _IO(''M'', 1): file->private_data = (void *)arg; break; + default: return -ENOSYS; + } + return 0; +} +#if defined(CONFIG_XEN_PRIVILEGED_GUEST) + .ioctl = ioctl_mem, +#endif -- "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." - Brian W. Kernighan ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
The ioctl was used to set the domain whose memory you want /dev/mem to map, for domain builder etc. I don''t know what (if anything) it''s used for now... Mark On Friday 01 October 2004 21:32, Rik van Riel wrote:> Hi, > > While creating a patch file from the latest Xen, I noticed > something strange. There''s an ioctl being added to /dev/mem. > > I''m wondering what it''s used for and why it''s using /dev/mem > instead of (say) /dev/xenctl ... > > +static int ioctl_mem(struct inode * inode, struct file * file, unsigned > int cmd, unsigned long arg) > +{ > + switch (cmd) { > + case _IO(''M'', 1): file->private_data = (void *)arg; break; > + default: return -ENOSYS; > + } > + return 0; > +} > > +#if defined(CONFIG_XEN_PRIVILEGED_GUEST) > + .ioctl = ioctl_mem, > +#endif------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
On Sat, 2 Oct 2004, Mark A. Williamson wrote:> The ioctl was used to set the domain whose memory you want /dev/mem to map, > for domain builder etc. I don''t know what (if anything) it''s used for now...Cool. Might be worthwhile to get rid of that piece of code then, to make merging Xen into the upstream kernel easier. -- "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." - Brian W. Kernighan ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
> On Sat, 2 Oct 2004, Mark A. Williamson wrote: > > > The ioctl was used to set the domain whose memory you want /dev/mem to map, > > for domain builder etc. I don''t know what (if anything) it''s used for now... > > Cool. Might be worthwhile to get rid of that piece of code > then, to make merging Xen into the upstream kernel easier.The domain builder still uses the /dev/mem ioctl, although it should be using the special Xen device file which has a higher-performance mmap''ing interface. I''ll fix the tools to use that instead, and clean up in /dev/mem. -- Keir ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
> On Sat, 2 Oct 2004, Mark A. Williamson wrote: > > > The ioctl was used to set the domain whose memory you want /dev/mem to map, > > for domain builder etc. I don''t know what (if anything) it''s used for now... > > Cool. Might be worthwhile to get rid of that piece of code > then, to make merging Xen into the upstream kernel easier.Done. -- Keir ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel