X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=linux_module%2Fiface-pstate-ctrl.c;h=2c49be919c143b82ff3973f3f505c2841a6d9395;hb=devel;hp=15596793006ede90e00916ac5bad94bf5ae13eb2;hpb=85c259546c85d19af43b443f9724c44caffb9b20;p=palacios.git diff --git a/linux_module/iface-pstate-ctrl.c b/linux_module/iface-pstate-ctrl.c index 1559679..2c49be9 100644 --- a/linux_module/iface-pstate-ctrl.c +++ b/linux_module/iface-pstate-ctrl.c @@ -876,6 +876,7 @@ static int get_current_governor(char **buf, unsigned int cpu) } strncpy(govname, policy->governor->name, MAX_GOV_NAME_LEN); + govname[MAX_GOV_NAME_LEN-1] = 0; get_cpu_var(core_state).linux_governor = govname; put_cpu_var(core_state); @@ -938,8 +939,22 @@ static int governor_switch(char * s, unsigned int cpu) argv[3] = NULL; /* KCH: we can't wait here to actually see if we succeeded, we're in interrupt context */ - return call_usermodehelper_fns("/bin/sh", argv, envp, UMH_NO_WAIT, NULL, gov_switch_cleanup, NULL); +#if LINUX_VERSION_CODE <= KERNEL_VERSION(3,9,0) + return call_usermodehelper_fns("/bin/sh", argv, envp, UMH_NO_WAIT, NULL, gov_switch_cleanup, NULL); +#else + { + struct subprocess_info *sp; + + sp = call_usermodehelper_setup("/bin/sh", argv, envp, GFP_ATOMIC, NULL, gov_switch_cleanup, NULL); + if (!sp) { + goto out_freeargv; + } + + return call_usermodehelper_exec(sp,0); + } +#endif + out_freeargv: palacios_free(argv); return -1; @@ -1686,7 +1701,7 @@ static int pstate_hw_show(struct seq_file * file, void * v) } - seq_printf(file,"\nPstate\tCtrl\tKHz\n"); + seq_printf(file,"\nPstate\tCtrl\tKHz\tmW\tuS(X)\tuS(B)\n"); numstates = get_cpu_var(processors)->performance->state_count; if (!numstates) { seq_printf(file,"UNKNOWN\n"); @@ -1694,10 +1709,13 @@ static int pstate_hw_show(struct seq_file * file, void * v) int i; for (i=0;iperformance->states[i].control, - get_cpu_var(processors)->performance->states[i].core_frequency*1000); + get_cpu_var(processors)->performance->states[i].core_frequency*1000, + get_cpu_var(processors)->performance->states[i].power, + get_cpu_var(processors)->performance->states[i].transition_latency, + get_cpu_var(processors)->performance->states[i].bus_master_latency); } } put_cpu_var(processors); @@ -1736,27 +1754,22 @@ int pstate_proc_setup(void) struct proc_dir_entry *proc; struct proc_dir_entry *prochw; - proc = create_proc_entry("v3-dvfs",0444, palacios_get_procdir()); + PAL_PROC_CREATE(proc,"v3-dvfs",0444,palacios_get_procdir(),&pstate_fops); if (!proc) { ERROR("Failed to create proc entry for p-state control\n"); return -1; } - proc->proc_fops = &pstate_fops; - INFO("/proc/v3vee/v3-dvfs successfully created\n"); - prochw = create_proc_entry("v3-dvfs-hw",0444,palacios_get_procdir()); - + PAL_PROC_CREATE(prochw,"v3-dvfs-hw",0444,palacios_get_procdir(),&pstate_hw_fops); if (!prochw) { ERROR("Failed to create proc entry for p-state hw info\n"); return -1; } - prochw->proc_fops = &pstate_hw_fops; - INFO("/proc/v3vee/v3-dvfs-hw successfully created\n"); return 0;