pu_ioctl(env, KVM_SET_SLAVE_CPU, slave);
+if (r < 0)
+perror("kvm_set_slave_cpu");
+return r;
+}
+
static int _kvm_arch_init_vcpu(CPUState *env)
{
kvm_arch_reset_vcpu(env);
kvm_enable_tpr_access_reporting(env);
+kvm_set_slave_cpu(env);
+
return kvm_up
Split memory hotplug function from cpu_up() as cpu_memory_up(), which will
be used for assigning memory area to off-lined cpus at following patch
in this series.
Signed-off-by: Tomoki Sekiyama
Cc: Avi Kivity
Cc: Marcelo Tosatti
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc: "H. Peter
7; is provided to manage whether CPU is slave.
In addition, `cpu_online_or_slave_mask' is also provided for convenence of
APIC handling, etc.
Signed-off-by: Tomoki Sekiyama
Cc: Avi Kivity
Cc: Marcelo Tosatti
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc: "H. Peter Anvin"
---
arch/x86/Kconfi
Enable virtualization when slave CPUs are activated, and disable when
the CPUs are dying using slave CPU notifier call chain.
In x86, TSC kHz must also be initialized by tsc_khz_changed when the
new slave CPUs are activated.
Signed-off-by: Tomoki Sekiyama
Cc: Avi Kivity
Cc: Marcelo Tosatti
Cc
ion, kvm_arch_vcpu_put_migrate is used to avoid using IPI to
clear loaded vmcs from the old CPU. Instead, this immediately clears
vmcs.
Signed-off-by: Tomoki Sekiyama
Cc: Avi Kivity
Cc: Marcelo Tosatti
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc: "H. Peter Anvin"
---
arch/x86/include/asm/kvm_
-by: Tomoki Sekiyama
Cc: Avi Kivity
Cc: Marcelo Tosatti
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc: "H. Peter Anvin"
---
arch/x86/include/asm/kvm_host.h |2 +
arch/x86/kvm/vmx.c |7 +
arch/x86/kvm/x86.c | 54 ++
If the slave CPU receives an interrupt in running a guest, current
implementation must once go back to onilne CPUs to handle the interupt.
This behavior will be replaced by later patch, which introduces direct
interrupt handling mechanism by the guest.
Signed-off-by: Tomoki Sekiyama
Cc: Avi
Replace local_irq_disable/enable with local_irq_save/restore in the path
where is executed on slave CPUs. This is required because irqs are disabled
while the guest is running on the slave CPUs.
Signed-off-by: Tomoki Sekiyama
Cc: Avi Kivity
Cc: Marcelo Tosatti
Cc: Thomas Gleixner
Cc: Ingo
Avoid exiting from a guest on slave CPU even if HLT instruction is
executed. Since the slave CPU is dedicated to a vCPU, exit on HLT is
not required, and avoiding VM exit will improve the guest's performance.
This is a partial revert of
10166744b80a ("KVM: VMX: remove yield_on_hlt")
Cc:
CPU with IRQ remapper of IOMMU.
This is intended to be used to routing interrupts directly to KVM guest
which is running on slave CPUs which do not cause VM EXIT by external
interrupts.
Signed-off-by: Tomoki Sekiyama
Cc: Avi Kivity
Cc: Marcelo Tosatti
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc: &q
upts to be routed either online CPUs or slave CPUs.
In this patch, if online CPUs are contained in specified affinity settings,
the affinity settings will be only applied to online CPUs. If every
specified CPU is slave, IRQ will be routed to slave CPUs.
Signed-off-by: Tomoki Sekiyama
Cc: Avi
EXIT_REASON_PREEMPTION_TIMER,
which just goes back to VM execution soon.
These are currently intended only to be used with avoid entering the
guest on a slave CPU when vmx_prevent_run(vcpu, 1) is called.
Signed-off-by: Tomoki Sekiyama
Cc: Avi Kivity
Cc: Marcelo Tosatti
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc: "H.
-by: Tomoki Sekiyama
Cc: Avi Kivity
Cc: Marcelo Tosatti
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc: "H. Peter Anvin"
---
arch/x86/include/asm/kvm_host.h |5
arch/x86/kvm/mmu.c | 50 ---
arch/x86/kvm/mmu.h |4
the guest is resumed on an online CPU.
Signed-off-by: Tomoki Sekiyama
Cc: Avi Kivity
Cc: Marcelo Tosatti
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc: "H. Peter Anvin"
---
arch/x86/include/asm/kvm_host.h | 15 +++
arch/x86/kvm/mmu.c | 13 +
arch/x
are called with CPU_SLAVE_UP when a slave CPU
becomes active. When the slave CPU is stopped, callbacks are called with
CPU_SLAVE_DYING on slave CPUs, and with CPU_SLAVE_DEAD on online CPUs.
Signed-off-by: Tomoki Sekiyama
Cc: Avi Kivity
Cc: Marcelo Tosatti
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc
s, if the guest issues EOI when there are no
in-service interrupts in the virtual APIC, physical EOI is issued.
Signed-off-by: Tomoki Sekiyama
Cc: Avi Kivity
Cc: Marcelo Tosatti
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc: "H. Peter Anvin"
---
arch/x86/include/asm/kvm_host.h | 19
. Then, NMI handler will check the
requests and handles the requests.
Signed-off-by: Tomoki Sekiyama
Cc: Avi Kivity
Cc: Marcelo Tosatti
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc: "H. Peter Anvin"
---
arch/x86/include/asm/mmu.h |7 +
arch/x86/kvm/x86.c | 26 ++
slave CPUs.
Signed-off-by: Tomoki Sekiyama
Cc: Avi Kivity
Cc: Marcelo Tosatti
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc: "H. Peter Anvin"
---
arch/x86/kvm/vmx.c |4
arch/x86/kvm/x86.c | 40
include/linux/kvm_host.h |
patch adds kvm_arch_vcpu_prevent_run(), which causes VM exit right
after VM enter. The NMI handler uses this to ensure the execution of the
guest is cancelled after NMI.
Signed-off-by: Tomoki Sekiyama
Cc: Avi Kivity
Cc: Marcelo Tosatti
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc: "H. Peter
re support always helps, but it always seems to come after the
> software support is in place and needs to be supported forever.
Thanks,
--
Tomoki Sekiyama
Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
--
To unsubscribe from this list: send the line "unsubscribe kvm&
On 2012/06/29 2:02, Avi Kivity wrote:
> On 06/28/2012 09:07 AM, Tomoki Sekiyama wrote:
>> Add path to migrate execution of vcpu_enter_guest to a slave CPU when
>> vcpu->arch.slave_cpu is set.
>>
>> After moving to the slave CPU, it goes back to the online CPU when the
On 2012/06/29 1:48, Avi Kivity wrote:
> On 06/28/2012 09:08 AM, Tomoki Sekiyama wrote:
>> Since NMI can not be disabled around VM enter, there is a race between
>> receiving NMI to kick a guest and entering the guests on slave CPUs.If the
>> NMI is received just before enter
On 2012/06/29 1:38, Avi Kivity wrote:
> On 06/28/2012 09:08 AM, Tomoki Sekiyama wrote:
>> For slave CPUs, it is inapropriate to request TLB flush using IPI.
>> because the IPI may be sent to a KVM guest when the slave CPU is running
>> the guest with direct interrupt routi
E_CPU _IO(KVMIO, 0xaf)
#define KVM_DEV_ASSIGN_ENABLE_IOMMU(1 << 0)
Thanks,
--
Tomoki Sekiyama
Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majo
nderstood why.
One reason is ease of deployment of applications to nodes.
Especially in IaaS environment like Amazon EC2 Cluster Compute Instances,
virtualization is often introduced as a simple way to move applications
around flexibly among nodes shared by many users.
Thanks,
--
Tomoki Sekiyama
Linu
p;tac);
}
+static int kvm_set_slave_cpu(CPUState *env)
+{
+int r, slave = env->cpu_index == 0 ? 2 : env->cpu_index == 1 ? 3 : -1;
`slave' is the offlined CPU ID assigned, and `env->cpu_index' is
the virtual CPU ID. You need to modify here and recompile qemu-kvm
(or just
p;tac);
}
+static int kvm_set_slave_cpu(CPUState *env)
+{
+int r, slave = env->cpu_index == 0 ? 2 : env->cpu_index == 1 ? 3 : -1;
`slave' is the offlined CPU ID assigned, and `env->cpu_index' is
the virtual CPU ID. You need to modify here and recompile qemu-kvm
(or just
tch of SR-IOV 10G NIC, which is only limited by
NIC's controller chip performance and the bus speed.
>My benchmark also shows a interesting data: the throughput of a pass-
>through device is higher than bare-mental sometime.(I use NetPIPE)
Thanks,
Tomoki Sekiyama
>Thanks a lot.
stem/cpu/cpu3/online
- Launch qemu-kvm with -no-kvm-pit option.
The offlined CPU is booted as a slave CPU and guest is runs on that CPU.
* To-do
- Enable slave CPUs to handle access fault
- Support AMD SVM
- Support non-Linux guests
---
Tomoki Sekiyama (21):
x86: request TLB flush
the guest is resumed on an online CPU.
Signed-off-by: Tomoki Sekiyama
Cc: Avi Kivity
Cc: Marcelo Tosatti
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc: "H. Peter Anvin"
---
arch/x86/include/asm/kvm_host.h | 15 +++
arch/x86/kvm/mmu.c | 13 +
arch/x
Add trace event "kvm_set_direct_interrupt" to trace enabling/disabling
direct interrupt delivery on slave CPUs. At the event, the guest rip and
whether the feature is enabled or not is logged.
Signed-off-by: Tomoki Sekiyama
Cc: Avi Kivity
Cc: Marcelo Tosatti
Cc: Thomas Gleixner
CPU with IRQ remapper of IOMMU.
This is intended to be used to routing interrupts directly to KVM guest
which is running on slave CPUs which do not cause VM EXIT by external
interrupts.
Signed-off-by: Tomoki Sekiyama
Cc: Avi Kivity
Cc: Marcelo Tosatti
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc: &q
guest must use the same vector as host.
Signed-off-by: Tomoki Sekiyama
Cc: Avi Kivity
Cc: Marcelo Tosatti
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc: "H. Peter Anvin"
---
arch/x86/include/asm/apic.h |4 +++
arch/x86/include/asm/kvm_host.h |1 +
arch/x86/kernel/apic/apic.c
patch adds kvm_arch_vcpu_prevent_run(), which causes VM exit right
after VM enter. The NMI handler uses this to ensure the execution of the
guest is cancelled after NMI.
Signed-off-by: Tomoki Sekiyama
Cc: Avi Kivity
Cc: Marcelo Tosatti
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc: "H. Peter
upts to be routed either online CPUs or slave CPUs.
In this patch, if online CPUs are contained in specified affinity settings,
the affinity settings will be only applied to online CPUs. If every
specified CPU is slave, IRQ will be routed to slave CPUs.
Signed-off-by: Tomoki Sekiyama
Cc: Avi
Avoid exiting from a guest on slave CPU even if HLT instruction is
executed. Since the slave CPU is dedicated to a vCPU, exit on HLT is
not required, and avoiding VM exit will improve the guest's performance.
This is a partial revert of
10166744b80a ("KVM: VMX: remove yield_on_hlt")
Cc:
Initialize rcu related variables to avoid warnings about RCU usage while
slave CPUs is running specified functions. Also notify RCU subsystem before
the slave CPU is entered into idle state.
Signed-off-by: Tomoki Sekiyama
Cc: Avi Kivity
Cc: Marcelo Tosatti
Cc: Thomas Gleixner
Cc: Ingo Molnar
EXIT_REASON_PREEMPTION_TIMER,
which just goes back to VM execution soon.
These are currently intended only to be used with avoid entering the
guest on a slave CPU when vmx_prevent_run(vcpu, 1) is called.
Signed-off-by: Tomoki Sekiyama
Cc: Avi Kivity
Cc: Marcelo Tosatti
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc: "H.
after every virtual IRQ is handled.
Signed-off-by: Tomoki Sekiyama
Cc: Avi Kivity
Cc: Marcelo Tosatti
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc: "H. Peter Anvin"
---
arch/x86/kvm/vmx.c | 69 ++--
1 files changed, 67 insertions(+), 2
. Then, NMI handler will check the
requests and handles the requests.
This implementation has an issue in scalability, and is just for PoC.
Signed-off-by: Tomoki Sekiyama
Cc: Avi Kivity
Cc: Marcelo Tosatti
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc: "H. Peter Anvin"
---
arch/x86/i
s, if the guest issues EOI when there are no
in-service interrupts in the virtual APIC, physical EOI is issued.
Signed-off-by: Tomoki Sekiyama
Cc: Avi Kivity
Cc: Marcelo Tosatti
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc: "H. Peter Anvin"
---
arch/x86/include/asm/kvm_host.h | 19
slave CPUs.
Signed-off-by: Tomoki Sekiyama
Cc: Avi Kivity
Cc: Marcelo Tosatti
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc: "H. Peter Anvin"
---
arch/x86/include/asm/kvm_host.h |1 +
arch/x86/kvm/lapic.c|5 +
arch/x86/kvm/vmx.c | 19 ++
Split memory hotplug function from cpu_up() as cpu_memory_up(), which will
be used for assigning memory area to off-lined cpus at following patch
in this series.
Signed-off-by: Tomoki Sekiyama
Cc: Avi Kivity
Cc: Marcelo Tosatti
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc: "H. Peter
vided to manage whether CPU is slave.
In addition, `cpu_online_or_slave_mask' is also provided for convenence of
APIC handling, etc.
Signed-off-by: Tomoki Sekiyama
Cc: Avi Kivity
Cc: Marcelo Tosatti
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc: "H. Peter Anvin"
---
arch/x86/Kconfi
are called with CPU_SLAVE_UP when a slave CPU
becomes active. When the slave CPU is stopped, callbacks are called with
CPU_SLAVE_DYING on slave CPUs, and with CPU_SLAVE_DEAD on online CPUs.
Signed-off-by: Tomoki Sekiyama
Cc: Avi Kivity
Cc: Marcelo Tosatti
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc
ion, kvm_arch_vcpu_put_migrate is used to avoid using IPI to
clear loaded vmcs from the old CPU. Instead, this immediately clears
vmcs.
Signed-off-by: Tomoki Sekiyama
Cc: Avi Kivity
Cc: Marcelo Tosatti
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc: "H. Peter Anvin"
---
arch/x86/include/asm/kvm_
-by: Tomoki Sekiyama
Cc: Avi Kivity
Cc: Marcelo Tosatti
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc: "H. Peter Anvin"
---
arch/x86/include/asm/kvm_host.h |2 +
arch/x86/kvm/vmx.c |7 +
arch/x86/kvm/x86.c | 58 ++
-by: Tomoki Sekiyama
Cc: Avi Kivity
Cc: Marcelo Tosatti
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc: "H. Peter Anvin"
---
arch/x86/include/asm/kvm_host.h |5
arch/x86/kvm/mmu.c | 52 ---
arch/x86/kvm/mmu.h |4
If the slave CPU receives an interrupt in running a guest, current
implementation must once go back to onilne CPUs to handle the interupt.
This behavior will be replaced by later patch, which introduces direct
interrupt handling mechanism by the guest.
Signed-off-by: Tomoki Sekiyama
Cc: Avi
Enable virtualization when slave CPUs are activated, and disable when
the CPUs are dying using slave CPU notifier call chain.
In x86, TSC kHz must also be initialized by tsc_khz_changed when the
new slave CPUs are activated.
Signed-off-by: Tomoki Sekiyama
Cc: Avi Kivity
Cc: Marcelo Tosatti
Cc
Hi Jan,
On 2012/09/07 17:26, Jan Kiszka wrote:
> On 2012-09-06 13:27, Tomoki Sekiyama wrote:
>> This RFC patch series provides facility to dedicate CPUs to KVM guests
>> and enable the guests to handle interrupts from passed-through PCI devices
>> directly (without VM exit
Hi Paul,
Thank you for your comments, and sorry for my late reply.
On 2012/09/21 2:34, Paul E. McKenney wrote:
> On Thu, Sep 06, 2012 at 08:27:40PM +0900, Tomoki Sekiyama wrote:
>> Initialize rcu related variables to avoid warnings about RCU usage while
>> slave CPUs is ru
52 matches
Mail list logo