Re: [PATCH 2/4] reduce stack usage in kvm_vcpu_ioctl()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Avi Kivity
Date: Monday, August 11, 2008 - 2:41 am

Dave Hansen wrote:

Spurious blank line.


memset unneeded after kzalloc.


btw, this is a generic problem, and could be handled generically:

struct ioctl_handler_entry {
    u32 ioctl;
    union {
        long (*handler_parg)(void *arg);
        long (*handler_larg)(long arg);
    };
};

void process_ioctl(struct ioctl_handler_entry *ioctls)
{
     search for correct entry;
     allocate memory (get size from ioctl number);
     copy from user (if _IOW);
     call handler;
     copy to user (if _IOR, and no error);
     free memory;
}

I imagine this can be used to simplify many ioctls.

-- 
error compiling committee.c: too many arguments to function

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 2/4] reduce stack usage in kvm_vcpu_ioctl(), Dave Hansen, (Mon Aug 4, 11:31 am)
[PATCH 4/4] kvm: reduce stack usage in kvm_pv_mmu_op(), Dave Hansen, (Mon Aug 4, 11:31 am)
Re: [PATCH 2/4] reduce stack usage in kvm_vcpu_ioctl(), Avi Kivity, (Mon Aug 11, 2:41 am)