mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
Merge
This commit is contained in:
commit
8001ffc0d3
7 files changed
+51
-24
No files matched your search
@@ -75,7 +75,7 @@ $(LINUX_DIR)/include/linux/autoconf.h: $(LINUX_SRCDIR)/.valid-src
|
||||
# tree. Finally attempt to use make defconfig.
|
||||
set -e ; \
|
||||
CONFIG_VERSION=$$(sed -ne 's/$$(XENGUEST)//; s/^EXTRAVERSION = //p' $(LINUX_SRCDIR)/Makefile); \
|
||||
if [ ! -z "$(XEN_LINUX_CONFIG)" -a -r $(XEN_LINUX_CONFIG) ]; then \
|
||||
if [ ! -z "$(XEN_LINUX_CONFIG)" -a -r "$(XEN_LINUX_CONFIG)" ]; then \
|
||||
cp $(XEN_LINUX_CONFIG) $(CONFIG_FILE); \
|
||||
elif [ -r $(DESTDIR)/boot/config-$(LINUX_VER3)$$CONFIG_VERSION$(EXTRAVERSION) ] ; then \
|
||||
cp $(DESTDIR)/boot/config-$(LINUX_VER3)$$CONFIG_VERSION$(EXTRAVERSION) $(CONFIG_FILE) ; \
|
||||
|
||||
@@ -100,6 +100,7 @@ MAKE_INSTR(VMCALL, 3, 0x0f, 0x01, 0xd9);
|
||||
MAKE_INSTR(HLT, 1, 0xf4);
|
||||
MAKE_INSTR(INT3, 1, 0xcc);
|
||||
MAKE_INSTR(RDTSC, 2, 0x0f, 0x31);
|
||||
MAKE_INSTR(PAUSE, 1, 0x90);
|
||||
|
||||
static const u8 *opc_bytes[INSTR_MAX_COUNT] =
|
||||
{
|
||||
@@ -111,7 +112,8 @@ static const u8 *opc_bytes[INSTR_MAX_COUNT] =
|
||||
[INSTR_VMCALL] = OPCODE_VMCALL,
|
||||
[INSTR_HLT] = OPCODE_HLT,
|
||||
[INSTR_INT3] = OPCODE_INT3,
|
||||
[INSTR_RDTSC] = OPCODE_RDTSC
|
||||
[INSTR_RDTSC] = OPCODE_RDTSC,
|
||||
[INSTR_PAUSE] = OPCODE_PAUSE,
|
||||
};
|
||||
|
||||
static int fetch(struct vcpu *v, u8 *buf, unsigned long addr, int len)
|
||||
|
||||
@@ -1261,6 +1261,22 @@ static void svm_vmexit_do_rdtsc(struct cpu_user_regs *regs)
|
||||
hvm_rdtsc_intercept(regs);
|
||||
}
|
||||
|
||||
static void svm_vmexit_do_pause(struct cpu_user_regs *regs)
|
||||
{
|
||||
unsigned int inst_len;
|
||||
|
||||
if ( (inst_len = __get_instruction_length(current, INSTR_PAUSE)) == 0 )
|
||||
return;
|
||||
__update_guest_eip(regs, inst_len);
|
||||
|
||||
/*
|
||||
* The guest is running a contended spinlock and we've detected it.
|
||||
* Do something useful, like reschedule the guest
|
||||
*/
|
||||
perfc_incr(pauseloop_exits);
|
||||
do_sched_op_compat(SCHEDOP_yield, 0);
|
||||
}
|
||||
|
||||
static void svm_vmexit_ud_intercept(struct cpu_user_regs *regs)
|
||||
{
|
||||
struct hvm_emulate_ctxt ctxt;
|
||||
@@ -1655,12 +1671,7 @@ asmlinkage void svm_vmexit_handler(struct cpu_user_regs *regs)
|
||||
break;
|
||||
|
||||
case VMEXIT_PAUSE:
|
||||
/*
|
||||
* The guest is running a contended spinlock and we've detected it.
|
||||
* Do something useful, like reschedule the guest
|
||||
*/
|
||||
perfc_incr(pauseloop_exits);
|
||||
do_sched_op_compat(SCHEDOP_yield, 0);
|
||||
svm_vmexit_do_pause(regs);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -2228,6 +2228,7 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
|
||||
case MSR_K8_PSTATE5:
|
||||
case MSR_K8_PSTATE6:
|
||||
case MSR_K8_PSTATE7:
|
||||
case MSR_K8_HWCR:
|
||||
if ( boot_cpu_data.x86_vendor != X86_VENDOR_AMD )
|
||||
goto fail;
|
||||
if ( !is_cpufreq_controller(v->domain) )
|
||||
@@ -2267,6 +2268,14 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
|
||||
break;
|
||||
case MSR_IA32_MPERF:
|
||||
case MSR_IA32_APERF:
|
||||
if (( boot_cpu_data.x86_vendor != X86_VENDOR_INTEL ) &&
|
||||
( boot_cpu_data.x86_vendor != X86_VENDOR_AMD ) )
|
||||
goto fail;
|
||||
if ( !is_cpufreq_controller(v->domain) )
|
||||
break;
|
||||
if ( wrmsr_safe(regs->ecx, msr_content ) != 0 )
|
||||
goto fail;
|
||||
break;
|
||||
case MSR_IA32_PERF_CTL:
|
||||
if ( boot_cpu_data.x86_vendor != X86_VENDOR_INTEL )
|
||||
goto fail;
|
||||
|
||||
@@ -1123,14 +1123,11 @@ static void domain_dump_evtchn_info(struct domain *d)
|
||||
|
||||
bitmap_scnlistprintf(keyhandler_scratch, sizeof(keyhandler_scratch),
|
||||
d->poll_mask, d->max_vcpus);
|
||||
printk("Domain %d polling vCPUs: {%s}\n",
|
||||
d->domain_id, keyhandler_scratch);
|
||||
|
||||
if ( !spin_trylock(&d->event_lock) )
|
||||
return;
|
||||
|
||||
printk("Event channel information for domain %d:\n"
|
||||
" port [p/m]\n", d->domain_id);
|
||||
"Polling vCPUs: {%s}\n"
|
||||
" port [p/m]\n", d->domain_id, keyhandler_scratch);
|
||||
|
||||
spin_lock(&d->event_lock);
|
||||
|
||||
for ( port = 1; port < MAX_EVTCHNS(d); ++port )
|
||||
{
|
||||
|
||||
@@ -555,10 +555,11 @@ __csched_vcpu_acct_start(struct csched_private *prv, struct csched_vcpu *svc)
|
||||
|
||||
sdom->active_vcpu_count++;
|
||||
list_add(&svc->active_vcpu_elem, &sdom->active_vcpu);
|
||||
/* Make weight per-vcpu */
|
||||
prv->weight += sdom->weight;
|
||||
if ( list_empty(&sdom->active_sdom_elem) )
|
||||
{
|
||||
list_add(&sdom->active_sdom_elem, &prv->active_sdom);
|
||||
prv->weight += sdom->weight;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -576,13 +577,13 @@ __csched_vcpu_acct_stop_locked(struct csched_private *prv,
|
||||
CSCHED_VCPU_STAT_CRANK(svc, state_idle);
|
||||
CSCHED_STAT_CRANK(acct_vcpu_idle);
|
||||
|
||||
BUG_ON( prv->weight < sdom->weight );
|
||||
sdom->active_vcpu_count--;
|
||||
list_del_init(&svc->active_vcpu_elem);
|
||||
prv->weight -= sdom->weight;
|
||||
if ( list_empty(&sdom->active_vcpu) )
|
||||
{
|
||||
BUG_ON( prv->weight < sdom->weight );
|
||||
list_del_init(&sdom->active_sdom_elem);
|
||||
prv->weight -= sdom->weight;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -804,8 +805,8 @@ csched_dom_cntl(
|
||||
{
|
||||
if ( !list_empty(&sdom->active_sdom_elem) )
|
||||
{
|
||||
prv->weight -= sdom->weight;
|
||||
prv->weight += op->u.credit.weight;
|
||||
prv->weight -= sdom->weight * sdom->active_vcpu_count;
|
||||
prv->weight += op->u.credit.weight * sdom->active_vcpu_count;
|
||||
}
|
||||
sdom->weight = op->u.credit.weight;
|
||||
}
|
||||
@@ -976,9 +977,9 @@ csched_acct(void* dummy)
|
||||
BUG_ON( is_idle_domain(sdom->dom) );
|
||||
BUG_ON( sdom->active_vcpu_count == 0 );
|
||||
BUG_ON( sdom->weight == 0 );
|
||||
BUG_ON( sdom->weight > weight_left );
|
||||
BUG_ON( (sdom->weight * sdom->active_vcpu_count) > weight_left );
|
||||
|
||||
weight_left -= sdom->weight;
|
||||
weight_left -= ( sdom->weight * sdom->active_vcpu_count );
|
||||
|
||||
/*
|
||||
* A domain's fair share is computed using its weight in competition
|
||||
@@ -991,7 +992,9 @@ csched_acct(void* dummy)
|
||||
credit_peak = sdom->active_vcpu_count * CSCHED_CREDITS_PER_ACCT;
|
||||
if ( prv->credit_balance < 0 )
|
||||
{
|
||||
credit_peak += ( ( -prv->credit_balance * sdom->weight) +
|
||||
credit_peak += ( ( -prv->credit_balance
|
||||
* sdom->weight
|
||||
* sdom->active_vcpu_count) +
|
||||
(weight_total - 1)
|
||||
) / weight_total;
|
||||
}
|
||||
@@ -1002,11 +1005,15 @@ csched_acct(void* dummy)
|
||||
if ( credit_cap < credit_peak )
|
||||
credit_peak = credit_cap;
|
||||
|
||||
/* FIXME -- set cap per-vcpu as well...? */
|
||||
credit_cap = ( credit_cap + ( sdom->active_vcpu_count - 1 )
|
||||
) / sdom->active_vcpu_count;
|
||||
}
|
||||
|
||||
credit_fair = ( ( credit_total * sdom->weight) + (weight_total - 1)
|
||||
credit_fair = ( ( credit_total
|
||||
* sdom->weight
|
||||
* sdom->active_vcpu_count )
|
||||
+ (weight_total - 1)
|
||||
) / weight_total;
|
||||
|
||||
if ( credit_fair < credit_peak )
|
||||
|
||||
@@ -31,6 +31,7 @@ enum instruction_index {
|
||||
INSTR_HLT,
|
||||
INSTR_INT3,
|
||||
INSTR_RDTSC,
|
||||
INSTR_PAUSE,
|
||||
INSTR_MAX_COUNT /* Must be last - Number of instructions supported */
|
||||
};
|
||||
|
||||
|
||||