On Tue, 2005-10-11 at 13:25 +0100, Alan Cox wrote: > On Maw, 2005-10-11 at 12:33 +0200, Martin Schwidefsky wrote: > > Sorry to burst bubbles here. A generic diag interface doesn't make > > sense. diag is a way to "call" the hypervisor from the guest kernel to > > do something. > > I'm not entirely sure I agree. Think about things lik scsi generic > or /dev/ioport on the PC. There is a good argument to allow > CAP_SYS_RAWIO capability users to do anything. It is up to them to get > it right. That allows a simple kernel API for it and CAP_SYS_RAWIO > capable users can already machine gun themselves in both feet via other > interfaces anyway > > There is much to be said for a -privileged- API which is of the form > > struct { > struct s390_regs reg_in; > struct s390_regs reg_out; > unsigned long in_ptr; /* Bit map of pointers */ > unsigned long out_ptr; /* Bit map of pointers */ > struct { > void *addr; > int direction; /* IN/OUT/BOTH */ > unsigned long length; > } addresses[MAX_MAP]; > } > > which lets the user say what should be mapped and have the kernel do the > copies in/out as described by the syscall. > > Now you can do anything if you have the rights.
Well, there is at least one example where such this scheme breaks down: for the diag 250 interface the read/write control block contains a pointer to a block list. You have a control block pointing to another control block. Both need to be copied to kernel space but then the address of the block list needs to get corrected in the first control block. We'd need to add a way to store the alias address of one of the memory areas to some field in the other memory areas. That whole interface is scary. I'm not sure I want to debug a system that has a self-destruct unit like that. -- blue skies, Martin Martin Schwidefsky Linux for zSeries Development & Services IBM Deutschland Entwicklung GmbH ---------------------------------------------------------------------- For LINUX-390 subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390