diff options
Diffstat (limited to 'tools/testing/selftests/kvm/lib/kvm_util.c')
| -rw-r--r-- | tools/testing/selftests/kvm/lib/kvm_util.c | 17 | 
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/selftests/kvm/lib/kvm_util.c index 298c4372fb1a..9741a7ff6380 100644 --- a/tools/testing/selftests/kvm/lib/kvm_util.c +++ b/tools/testing/selftests/kvm/lib/kvm_util.c @@ -494,6 +494,23 @@ static uint32_t parse_pcpu(const char *cpu_str, const cpu_set_t *allowed_mask)  	return pcpu;  } +void kvm_print_vcpu_pinning_help(void) +{ +	const char *name = program_invocation_name; + +	printf(" -c: Pin tasks to physical CPUs.  Takes a list of comma separated\n" +	       "     values (target pCPU), one for each vCPU, plus an optional\n" +	       "     entry for the main application task (specified via entry\n" +	       "     <nr_vcpus + 1>).  If used, entries must be provided for all\n" +	       "     vCPUs, i.e. pinning vCPUs is all or nothing.\n\n" +	       "     E.g. to create 3 vCPUs, pin vCPU0=>pCPU22, vCPU1=>pCPU23,\n" +	       "     vCPU2=>pCPU24, and pin the application task to pCPU50:\n\n" +	       "         %s -v 3 -c 22,23,24,50\n\n" +	       "     To leave the application task unpinned, drop the final entry:\n\n" +	       "         %s -v 3 -c 22,23,24\n\n" +	       "     (default: no pinning)\n", name, name); +} +  void kvm_parse_vcpu_pinning(const char *pcpus_string, uint32_t vcpu_to_pcpu[],  			    int nr_vcpus)  {  |