[PATCH 0/2] Fix node meminfo corruption.

2014-10-31 Thread Tang Chen
: 0 kB .. This patch-set fixes them. Tang Chen (2): mem-hotplug: Reset node managed pages when hot-adding a new pgdat. mem-hotplug: Fix wrong check for zone-pageset initialization in online_pages(). include/linux/bootmem.h | 1 + include/linux/mm.h | 1 + mm/bootmem.c

[PATCH 0/2] Fix node meminfo corruption.

2014-10-31 Thread Tang Chen
: 0 kB .. This patch-set fixes them. Tang Chen (2): mem-hotplug: Reset node managed pages when hot-adding a new pgdat. mem-hotplug: Fix wrong check for zone-pageset initialization in online_pages(). include/linux/bootmem.h | 1 + include/linux/mm.h | 1 + mm/bootmem.c

[PATCH 2/2] mem-hotplug: Fix wrong check for zone-pageset initialization in online_pages().

2014-10-31 Thread Tang Chen
some zones before onlining memory, otherwise no memory could be onlined. So when onlining pages, we should also check if zone-pageset is pointing to boot_pageset. Signed-off-by: Gu Zheng guz.f...@cn.fujitsu.com Signed-off-by: Tang Chen tangc...@cn.fujitsu.com --- include/linux/mm.h | 1 + mm

[PATCH 1/2] mem-hotplug: Reset node managed pages when hot-adding a new pgdat.

2014-10-31 Thread Tang Chen
() 2. Make reset_node_managed_pages() non-static 3. Call reset_node_managed_pages() in hotadd_new_pgdat() after pgdat is initialized Signed-off-by: Tang Chen tangc...@cn.fujitsu.com Signed-off-by: Yasuaki Ishimatsu isimatu.yasu...@jp.fujitsu.com --- include/linux/bootmem.h | 1 + mm/bootmem.c

Re: [PATCH v8 0/8] kvm, mem-hotplug: Do not pin ept identity pagetable and apic access page.

2014-09-25 Thread Tang Chen
On 09/25/2014 09:43 PM, Paolo Bonzini wrote: Il 25/09/2014 10:19, Tang Chen ha scritto: Hi Paolo, I'd like to help to test the patches. Would you please tell me what is the best way to test this patch-set ? How did _you_ test the patches?... I just added "-cpu xxx,-x2apic" opt

Re: [PATCH v8 0/8] kvm, mem-hotplug: Do not pin ept identity pagetable and apic access page.

2014-09-25 Thread Tang Chen
PM, Paolo Bonzini wrote: Il 24/09/2014 09:57, Tang Chen ha scritto: ept identity pagetable and apic access page in kvm are pinned in memory. As a result, they cannot be migrated/hot-removed. But actually they don't need to be pinned in memory. [For ept identity page] Just do not pin it. When it i

Re: [PATCH v8 0/8] kvm, mem-hotplug: Do not pin ept identity pagetable and apic access page.

2014-09-25 Thread Tang Chen
On 09/25/2014 09:43 PM, Paolo Bonzini wrote: Il 25/09/2014 10:19, Tang Chen ha scritto: Hi Paolo, I'd like to help to test the patches. Would you please tell me what is the best way to test this patch-set ? How did _you_ test the patches?... I just added -cpu xxx,-x2apic option, start

Re: [PATCH v8 0/8] kvm, mem-hotplug: Do not pin ept identity pagetable and apic access page.

2014-09-25 Thread Tang Chen
wrote: Il 24/09/2014 09:57, Tang Chen ha scritto: ept identity pagetable and apic access page in kvm are pinned in memory. As a result, they cannot be migrated/hot-removed. But actually they don't need to be pinned in memory. [For ept identity page] Just do not pin it. When it is migrated, guest

Re: [PATCH v8 0/8] kvm, mem-hotplug: Do not pin ept identity pagetable and apic access page.

2014-09-24 Thread Tang Chen
On 09/24/2014 04:20 PM, Paolo Bonzini wrote: Il 24/09/2014 09:57, Tang Chen ha scritto: ept identity pagetable and apic access page in kvm are pinned in memory. As a result, they cannot be migrated/hot-removed. But actually they don't need to be pinned in memory. [For ept identity page] Just

[PATCH v8 3/8] kvm: Make init_rmode_identity_map() return 0 on success.

2014-09-24 Thread Tang Chen
on success, -errno on failure. Signed-off-by: Tang Chen --- arch/x86/kvm/vmx.c | 31 +++ 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 4fb84ad..72a0470 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c

[PATCH v8 5/8] kvm: Rename make_all_cpus_request() to kvm_make_all_cpus_request() and make it non-static.

2014-09-24 Thread Tang Chen
Since different architectures need different handling, we will add some arch specific code later. The code may need to make cpu requests outside kvm_main.c, so make it non-static and rename it to kvm_make_all_cpus_request(). Reviewed-by: Paolo Bonzini Signed-off-by: Tang Chen --- include

[PATCH v8 8/8] kvm, mem-hotplug: Unpin and remove kvm_arch->apic_access_page.

2014-09-24 Thread Tang Chen
v Signed-off-by: Tang Chen --- arch/x86/include/asm/kvm_host.h | 2 +- arch/x86/kvm/vmx.c | 17 ++--- arch/x86/kvm/x86.c | 16 ++-- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/in

[PATCH v8 4/8] kvm, mem-hotplug: Reload L1's apic access page in vcpu_enter_guest().

2014-09-24 Thread Tang Chen
n non-shared apic access page for L2. We do this in vmx_set_apic_access_page_addr() when trying to set new apic access page's hpa like this: if (!is_guest_mode(vcpu) || !(vmx->nested.current_vmcs12->secondary_vm_exec_control & SECONDARY_EXEC_VIRTUALIZE_APIC_AC

[PATCH v8 6/8] kvm, mem-hotplug: Reload L1's apic access page on migration when L2 is running.

2014-09-24 Thread Tang Chen
This patch handles 3). In L0->L2 entry, L2's vmcs will be updated in prepare_vmcs02() called by nested_vm_run(). So we need to do nothing. In L2->L1 exit, this patch requests apic access page reload in L2->L1 vmexit. Reviewed-by: Paolo Bonzini Signed-off-by: Tang Chen --- arch/x86

[PATCH v8 7/8] kvm, mem-hotplug: Add arch specific mmu notifier to handle apic access migration.

2014-09-24 Thread Tang Chen
t. This patch force a L1->L0 exit or L2->L0 exit when shared apic access page is migrated using mmu notifier. Since apic access page is only used on intel x86, this is arch specific code. Signed-off-by: Tang Chen --- arch/arm/include/asm/kvm_host.h | 5 + arch/arm64/include/asm/kvm_ho

[PATCH v8 2/8] kvm: Remove ept_identity_pagetable from struct kvm_arch.

2014-09-24 Thread Tang Chen
m_arch->ept_identity_pagetable is removed, ept identity pagetable page is no longer pinned in memory. And it can be migrated/hot-removed. Signed-off-by: Tang Chen Reviewed-by: Gleb Natapov --- arch/x86/include/asm/kvm_host.h | 1 - arch/x86/kvm/vmx.c

[PATCH v8 0/8] kvm, mem-hotplug: Do not pin ept identity pagetable and apic access page.

2014-09-24 Thread Tang Chen
seless set_apic_access_page_addr() hook for svm. Tang Chen (8): kvm: Use APIC_DEFAULT_PHYS_BASE macro as the apic access page address. kvm: Remove ept_identity_pagetable from struct kvm_arch. kvm: Make init_rmode_identity_map() return 0 on success. kvm, mem-hotplug: Reload L1's apic acces

[PATCH v8 1/8] kvm: Use APIC_DEFAULT_PHYS_BASE macro as the apic access page address.

2014-09-24 Thread Tang Chen
We have APIC_DEFAULT_PHYS_BASE defined as 0xfee0, which is also the address of apic access page. So use this macro. Signed-off-by: Tang Chen Reviewed-by: Gleb Natapov --- arch/x86/kvm/svm.c | 3 ++- arch/x86/kvm/vmx.c | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff

Re: [PATCH 1/1] kvm, mem-hotplug: Add arch specific mmu notifier to handle apic access migration.

2014-09-24 Thread Tang Chen
On 09/24/2014 03:08 PM, Jan Kiszka wrote: On 2014-09-24 04:09, Tang Chen wrote: Hi Paolo, I'm not sure if this patch is following your comment. Please review. And all the other comments are followed. If this patch is OK, I'll send v8 soon. Thanks. We are handling "L1 and L2 share one

Re: [PATCH 1/1] kvm, mem-hotplug: Add arch specific mmu notifier to handle apic access migration.

2014-09-24 Thread Tang Chen
On 09/24/2014 03:08 PM, Jan Kiszka wrote: On 2014-09-24 04:09, Tang Chen wrote: Hi Paolo, I'm not sure if this patch is following your comment. Please review. And all the other comments are followed. If this patch is OK, I'll send v8 soon. Thanks. We are handling L1 and L2 share one apic

[PATCH v8 1/8] kvm: Use APIC_DEFAULT_PHYS_BASE macro as the apic access page address.

2014-09-24 Thread Tang Chen
We have APIC_DEFAULT_PHYS_BASE defined as 0xfee0, which is also the address of apic access page. So use this macro. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com Reviewed-by: Gleb Natapov g...@kernel.org --- arch/x86/kvm/svm.c | 3 ++- arch/x86/kvm/vmx.c | 6 +++--- 2 files changed, 5

[PATCH v8 2/8] kvm: Remove ept_identity_pagetable from struct kvm_arch.

2014-09-24 Thread Tang Chen
-ept_identity_pagetable is removed, ept identity pagetable page is no longer pinned in memory. And it can be migrated/hot-removed. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com Reviewed-by: Gleb Natapov g...@kernel.org --- arch/x86/include/asm/kvm_host.h | 1 - arch/x86/kvm/vmx.c

[PATCH v8 0/8] kvm, mem-hotplug: Do not pin ept identity pagetable and apic access page.

2014-09-24 Thread Tang Chen
useless set_apic_access_page_addr() hook for svm. Tang Chen (8): kvm: Use APIC_DEFAULT_PHYS_BASE macro as the apic access page address. kvm: Remove ept_identity_pagetable from struct kvm_arch. kvm: Make init_rmode_identity_map() return 0 on success. kvm, mem-hotplug: Reload L1's apic access

[PATCH v8 6/8] kvm, mem-hotplug: Reload L1's apic access page on migration when L2 is running.

2014-09-24 Thread Tang Chen
vmcs will be updated in prepare_vmcs02() called by nested_vm_run(). So we need to do nothing. In L2-L1 exit, this patch requests apic access page reload in L2-L1 vmexit. Reviewed-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Tang Chen tangc...@cn.fujitsu.com --- arch/x86/include/asm

[PATCH v8 7/8] kvm, mem-hotplug: Add arch specific mmu notifier to handle apic access migration.

2014-09-24 Thread Tang Chen
when shared apic access page is migrated using mmu notifier. Since apic access page is only used on intel x86, this is arch specific code. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com --- arch/arm/include/asm/kvm_host.h | 5 + arch/arm64/include/asm/kvm_host.h | 5 + arch/ia64

[PATCH v8 4/8] kvm, mem-hotplug: Reload L1's apic access page in vcpu_enter_guest().

2014-09-24 Thread Tang Chen
for L2. We do this in vmx_set_apic_access_page_addr() when trying to set new apic access page's hpa like this: if (!is_guest_mode(vcpu) || !(vmx-nested.current_vmcs12-secondary_vm_exec_control SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES)) Signed-off-by: Tang Chen tangc

[PATCH v8 8/8] kvm, mem-hotplug: Unpin and remove kvm_arch-apic_access_page.

2014-09-24 Thread Tang Chen
...@kernel.org Signed-off-by: Tang Chen tangc...@cn.fujitsu.com --- arch/x86/include/asm/kvm_host.h | 2 +- arch/x86/kvm/vmx.c | 17 ++--- arch/x86/kvm/x86.c | 16 ++-- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/arch/x86/include/asm

[PATCH v8 5/8] kvm: Rename make_all_cpus_request() to kvm_make_all_cpus_request() and make it non-static.

2014-09-24 Thread Tang Chen
Since different architectures need different handling, we will add some arch specific code later. The code may need to make cpu requests outside kvm_main.c, so make it non-static and rename it to kvm_make_all_cpus_request(). Reviewed-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Tang

[PATCH v8 3/8] kvm: Make init_rmode_identity_map() return 0 on success.

2014-09-24 Thread Tang Chen
on success, -errno on failure. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com --- arch/x86/kvm/vmx.c | 31 +++ 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 4fb84ad..72a0470 100644 --- a/arch/x86/kvm/vmx.c +++ b

Re: [PATCH v8 0/8] kvm, mem-hotplug: Do not pin ept identity pagetable and apic access page.

2014-09-24 Thread Tang Chen
On 09/24/2014 04:20 PM, Paolo Bonzini wrote: Il 24/09/2014 09:57, Tang Chen ha scritto: ept identity pagetable and apic access page in kvm are pinned in memory. As a result, they cannot be migrated/hot-removed. But actually they don't need to be pinned in memory. [For ept identity page] Just

[PATCH 1/1] kvm, mem-hotplug: Add arch specific mmu notifier to handle apic access migration.

2014-09-23 Thread Tang Chen
Hi Paolo, I'm not sure if this patch is following your comment. Please review. And all the other comments are followed. If this patch is OK, I'll send v8 soon. Thanks. We are handling "L1 and L2 share one apic access page" situation when migrating apic access page. We should do some handling

[PATCH 1/1] kvm, mem-hotplug: Add arch specific mmu notifier to handle apic access migration.

2014-09-23 Thread Tang Chen
Hi Paolo, I'm not sure if this patch is following your comment. Please review. And all the other comments are followed. If this patch is OK, I'll send v8 soon. Thanks. We are handling L1 and L2 share one apic access page situation when migrating apic access page. We should do some handling

[PATCH v7 3/9] kvm: Make init_rmode_identity_map() return 0 on success.

2014-09-20 Thread Tang Chen
on success, -errno on failure. Signed-off-by: Tang Chen --- arch/x86/kvm/vmx.c | 31 +++ 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 4fb84ad..72a0470 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c

[PATCH v7 5/9] kvm, mem-hotplug: Reload L1's apic access page in vcpu_enter_guest().

2014-09-20 Thread Tang Chen
c virtualzed apic accesses is enabled. Signed-off-by: Tang Chen --- arch/x86/include/asm/kvm_host.h | 1 + arch/x86/kvm/svm.c | 6 ++ arch/x86/kvm/vmx.c | 6 ++ arch/x86/kvm/x86.c | 23 +++ include/linux/kvm_host.h| 1 + 5

[PATCH v7 2/9] kvm: Remove ept_identity_pagetable from struct kvm_arch.

2014-09-20 Thread Tang Chen
m_arch->ept_identity_pagetable is removed, ept identity pagetable page is no longer pinned in memory. And it can be migrated/hot-removed. Signed-off-by: Tang Chen Reviewed-by: Gleb Natapov --- arch/x86/include/asm/kvm_host.h | 1 - arch/x86/kvm/vmx.c

[PATCH v7 1/9] kvm: Use APIC_DEFAULT_PHYS_BASE macro as the apic access page address.

2014-09-20 Thread Tang Chen
We have APIC_DEFAULT_PHYS_BASE defined as 0xfee0, which is also the address of apic access page. So use this macro. Signed-off-by: Tang Chen Reviewed-by: Gleb Natapov --- arch/x86/kvm/svm.c | 3 ++- arch/x86/kvm/vmx.c | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff

[PATCH v7 7/9] kvm, mem-hotplug: Reload L1's apic access page on migration when L2 is running.

2014-09-20 Thread Tang Chen
This patch handles 3). In L0->L2 entry, L2's vmcs will be updated in prepare_vmcs02() called by nested_vm_run(). So we need to do nothing. In L2->L1 exit, this patch requests apic access page reload in L2->L1 vmexit. Signed-off-by: Tang Chen --- arch/x86/include/asm/kvm_host.h

[PATCH v7 9/9] kvm, mem-hotplug: Unpin and remove kvm_arch->apic_access_page.

2014-09-20 Thread Tang Chen
v Signed-off-by: Tang Chen --- arch/x86/include/asm/kvm_host.h | 2 +- arch/x86/kvm/vmx.c | 15 +-- arch/x86/kvm/x86.c | 16 +++- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/in

[PATCH v7 6/9] kvm: Rename make_all_cpus_request() to kvm_make_all_cpus_request() and make it non-static.

2014-09-20 Thread Tang Chen
Since different architectures need different handling, we will add some arch specific code later. The code may need to make cpu requests outside kvm_main.c, so make it non-static and rename it to kvm_make_all_cpus_request(). Signed-off-by: Tang Chen --- include/linux/kvm_host.h | 1 + virt

[PATCH v7 8/9] kvm, mem-hotplug: Add arch specific mmu notifier to handle apic access migration.

2014-09-20 Thread Tang Chen
t. This patch force a L1->L0 exit or L2->L0 exit when shared apic access page is migrated using mmu notifier. Since apic access page is only used on intel x86, this is arch specific code. Signed-off-by: Tang Chen --- arch/x86/kvm/x86.c | 11 +++ include/linux/kvm_host.h

[PATCH v7 4/9] kvm: Add interface to check if secondary exec virtualzed apic accesses is enabled.

2014-09-20 Thread Tang Chen
nabled. This patch adds an interface to check if L2's secondary exec virtualzed apic accesses is enabled, because vmx cannot be accessed outside vmx.c. Signed-off-by: Tang Chen --- arch/x86/include/asm/kvm_host.h | 1 + arch/x86/kvm/svm.c | 6 ++ arch/x86/kvm/vmx.c

[PATCH v7 0/9] kvm, mem-hotplug: Do not pin ept identity pagetable and apic access page.

2014-09-20 Thread Tang Chen
mmu notifier. Tang Chen (9): kvm: Use APIC_DEFAULT_PHYS_BASE macro as the apic access page address. kvm: Remove ept_identity_pagetable from struct kvm_arch. kvm: Make init_rmode_identity_map() return 0 on success. kvm: Add interface to check if secondary exec virtualzed apic acces

[PATCH v7 0/9] kvm, mem-hotplug: Do not pin ept identity pagetable and apic access page.

2014-09-20 Thread Tang Chen
request in mmu notifier. Tang Chen (9): kvm: Use APIC_DEFAULT_PHYS_BASE macro as the apic access page address. kvm: Remove ept_identity_pagetable from struct kvm_arch. kvm: Make init_rmode_identity_map() return 0 on success. kvm: Add interface to check if secondary exec virtualzed apic

[PATCH v7 4/9] kvm: Add interface to check if secondary exec virtualzed apic accesses is enabled.

2014-09-20 Thread Tang Chen
an interface to check if L2's secondary exec virtualzed apic accesses is enabled, because vmx cannot be accessed outside vmx.c. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com --- arch/x86/include/asm/kvm_host.h | 1 + arch/x86/kvm/svm.c | 6 ++ arch/x86/kvm/vmx.c | 9

[PATCH v7 7/9] kvm, mem-hotplug: Reload L1's apic access page on migration when L2 is running.

2014-09-20 Thread Tang Chen
vmcs will be updated in prepare_vmcs02() called by nested_vm_run(). So we need to do nothing. In L2-L1 exit, this patch requests apic access page reload in L2-L1 vmexit. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com --- arch/x86/include/asm/kvm_host.h | 1 + arch/x86/kvm/vmx.c

[PATCH v7 9/9] kvm, mem-hotplug: Unpin and remove kvm_arch-apic_access_page.

2014-09-20 Thread Tang Chen
...@kernel.org Signed-off-by: Tang Chen tangc...@cn.fujitsu.com --- arch/x86/include/asm/kvm_host.h | 2 +- arch/x86/kvm/vmx.c | 15 +-- arch/x86/kvm/x86.c | 16 +++- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/arch/x86/include/asm

[PATCH v7 6/9] kvm: Rename make_all_cpus_request() to kvm_make_all_cpus_request() and make it non-static.

2014-09-20 Thread Tang Chen
Since different architectures need different handling, we will add some arch specific code later. The code may need to make cpu requests outside kvm_main.c, so make it non-static and rename it to kvm_make_all_cpus_request(). Signed-off-by: Tang Chen tangc...@cn.fujitsu.com --- include/linux

[PATCH v7 8/9] kvm, mem-hotplug: Add arch specific mmu notifier to handle apic access migration.

2014-09-20 Thread Tang Chen
when shared apic access page is migrated using mmu notifier. Since apic access page is only used on intel x86, this is arch specific code. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com --- arch/x86/kvm/x86.c | 11 +++ include/linux/kvm_host.h | 14 +- virt/kvm

[PATCH v7 2/9] kvm: Remove ept_identity_pagetable from struct kvm_arch.

2014-09-20 Thread Tang Chen
-ept_identity_pagetable is removed, ept identity pagetable page is no longer pinned in memory. And it can be migrated/hot-removed. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com Reviewed-by: Gleb Natapov g...@kernel.org --- arch/x86/include/asm/kvm_host.h | 1 - arch/x86/kvm/vmx.c

[PATCH v7 1/9] kvm: Use APIC_DEFAULT_PHYS_BASE macro as the apic access page address.

2014-09-20 Thread Tang Chen
We have APIC_DEFAULT_PHYS_BASE defined as 0xfee0, which is also the address of apic access page. So use this macro. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com Reviewed-by: Gleb Natapov g...@kernel.org --- arch/x86/kvm/svm.c | 3 ++- arch/x86/kvm/vmx.c | 6 +++--- 2 files changed, 5

[PATCH v7 5/9] kvm, mem-hotplug: Reload L1's apic access page in vcpu_enter_guest().

2014-09-20 Thread Tang Chen
-by: Tang Chen tangc...@cn.fujitsu.com --- arch/x86/include/asm/kvm_host.h | 1 + arch/x86/kvm/svm.c | 6 ++ arch/x86/kvm/vmx.c | 6 ++ arch/x86/kvm/x86.c | 23 +++ include/linux/kvm_host.h| 1 + 5 files changed, 37 insertions

[PATCH v7 3/9] kvm: Make init_rmode_identity_map() return 0 on success.

2014-09-20 Thread Tang Chen
on success, -errno on failure. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com --- arch/x86/kvm/vmx.c | 31 +++ 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 4fb84ad..72a0470 100644 --- a/arch/x86/kvm/vmx.c +++ b

Re: [PATCH v6 4/6] kvm, mem-hotplug: Reload L1' apic access page on migration in vcpu_enter_guest().

2014-09-17 Thread Tang Chen
On 09/16/2014 07:24 PM, Paolo Bonzini wrote: Il 16/09/2014 12:42, Tang Chen ha scritto: diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 33712fb..0df82c1 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -210,6 +210,11 @@ void kvm_make_scan_ioapic_request(struct kvm

Re: [PATCH v6 4/6] kvm, mem-hotplug: Reload L1' apic access page on migration in vcpu_enter_guest().

2014-09-17 Thread Tang Chen
On 09/16/2014 07:24 PM, Paolo Bonzini wrote: Il 16/09/2014 12:42, Tang Chen ha scritto: diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 33712fb..0df82c1 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -210,6 +210,11 @@ void kvm_make_scan_ioapic_request(struct kvm

[PATCH v6 3/6] kvm: Make init_rmode_identity_map() return 0 on success.

2014-09-16 Thread Tang Chen
on success, -errno on failure. Signed-off-by: Tang Chen --- arch/x86/kvm/vmx.c | 31 +++ 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 4fb84ad..72a0470 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c

[PATCH v6 1/6] kvm: Use APIC_DEFAULT_PHYS_BASE macro as the apic access page address.

2014-09-16 Thread Tang Chen
We have APIC_DEFAULT_PHYS_BASE defined as 0xfee0, which is also the address of apic access page. So use this macro. Signed-off-by: Tang Chen Reviewed-by: Gleb Natapov --- arch/x86/kvm/svm.c | 3 ++- arch/x86/kvm/vmx.c | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff

[PATCH v6 6/6] kvm, mem-hotplug: Unpin and remove kvm_arch->apic_access_page.

2014-09-16 Thread Tang Chen
v Signed-off-by: Tang Chen --- arch/x86/include/asm/kvm_host.h | 2 +- arch/x86/kvm/vmx.c | 15 +-- arch/x86/kvm/x86.c | 15 +-- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/in

[PATCH v6 5/6] kvm, mem-hotplug: Reload L1's apic access page on migration when L2 is running.

2014-09-16 Thread Tang Chen
for all L2 vmcs. And this patch requests apic access page reload in L2->L1 vmexit. Signed-off-by: Tang Chen --- arch/x86/include/asm/kvm_host.h | 1 + arch/x86/kvm/vmx.c | 6 ++ arch/x86/kvm/x86.c | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --g

[PATCH v6 2/6] kvm: Remove ept_identity_pagetable from struct kvm_arch.

2014-09-16 Thread Tang Chen
m_arch->ept_identity_pagetable is removed, ept identity pagetable page is no longer pinned in memory. And it can be migrated/hot-removed. Signed-off-by: Tang Chen Reviewed-by: Gleb Natapov --- arch/x86/include/asm/kvm_host.h | 1 - arch/x86/kvm/vmx.c

[PATCH v6 0/6] kvm, mem-hotplug: Do not pin ept identity pagetable and apic access page.

2014-09-16 Thread Tang Chen
h 7 since we are not able to handle the situation in nested vm. Tang Chen (6): kvm: Use APIC_DEFAULT_PHYS_BASE macro as the apic access page address. kvm: Remove ept_identity_pagetable from struct kvm_arch. kvm: Make init_rmode_identity_map() return 0 on success. kvm, mem-hotplug: Reload

[PATCH v6 4/6] kvm, mem-hotplug: Reload L1' apic access page on migration in vcpu_enter_guest().

2014-09-16 Thread Tang Chen
->arch.apic_access_page to the new page. Signed-off-by: Tang Chen --- arch/x86/include/asm/kvm_host.h | 1 + arch/x86/kvm/svm.c | 6 ++ arch/x86/kvm/vmx.c | 6 ++ arch/x86/kvm/x86.c | 15 +++ include/linux/kvm_host.h|

[PATCH v6 0/6] kvm, mem-hotplug: Do not pin ept identity pagetable and apic access page.

2014-09-16 Thread Tang Chen
original patch 7 since we are not able to handle the situation in nested vm. Tang Chen (6): kvm: Use APIC_DEFAULT_PHYS_BASE macro as the apic access page address. kvm: Remove ept_identity_pagetable from struct kvm_arch. kvm: Make init_rmode_identity_map() return 0 on success. kvm, mem

[PATCH v6 4/6] kvm, mem-hotplug: Reload L1' apic access page on migration in vcpu_enter_guest().

2014-09-16 Thread Tang Chen
-arch.apic_access_page to the new page. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com --- arch/x86/include/asm/kvm_host.h | 1 + arch/x86/kvm/svm.c | 6 ++ arch/x86/kvm/vmx.c | 6 ++ arch/x86/kvm/x86.c | 15 +++ include/linux

[PATCH v6 2/6] kvm: Remove ept_identity_pagetable from struct kvm_arch.

2014-09-16 Thread Tang Chen
-ept_identity_pagetable is removed, ept identity pagetable page is no longer pinned in memory. And it can be migrated/hot-removed. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com Reviewed-by: Gleb Natapov g...@kernel.org --- arch/x86/include/asm/kvm_host.h | 1 - arch/x86/kvm/vmx.c

[PATCH v6 6/6] kvm, mem-hotplug: Unpin and remove kvm_arch-apic_access_page.

2014-09-16 Thread Tang Chen
...@kernel.org Signed-off-by: Tang Chen tangc...@cn.fujitsu.com --- arch/x86/include/asm/kvm_host.h | 2 +- arch/x86/kvm/vmx.c | 15 +-- arch/x86/kvm/x86.c | 15 +-- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/arch/x86/include/asm

[PATCH v6 5/6] kvm, mem-hotplug: Reload L1's apic access page on migration when L2 is running.

2014-09-16 Thread Tang Chen
vmcs. And this patch requests apic access page reload in L2-L1 vmexit. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com --- arch/x86/include/asm/kvm_host.h | 1 + arch/x86/kvm/vmx.c | 6 ++ arch/x86/kvm/x86.c | 3 ++- 3 files changed, 9 insertions(+), 1 deletion

[PATCH v6 3/6] kvm: Make init_rmode_identity_map() return 0 on success.

2014-09-16 Thread Tang Chen
on success, -errno on failure. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com --- arch/x86/kvm/vmx.c | 31 +++ 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 4fb84ad..72a0470 100644 --- a/arch/x86/kvm/vmx.c +++ b

[PATCH v6 1/6] kvm: Use APIC_DEFAULT_PHYS_BASE macro as the apic access page address.

2014-09-16 Thread Tang Chen
We have APIC_DEFAULT_PHYS_BASE defined as 0xfee0, which is also the address of apic access page. So use this macro. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com Reviewed-by: Gleb Natapov g...@kernel.org --- arch/x86/kvm/svm.c | 3 ++- arch/x86/kvm/vmx.c | 6 +++--- 2 files changed, 5

[PATCH v5 3/7] kvm: Make init_rmode_identity_map() return 0 on success.

2014-09-10 Thread Tang Chen
on success, -errno on failure. Signed-off-by: Tang Chen --- arch/x86/kvm/vmx.c | 25 +++-- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 953d529..63c4c3e 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c

[PATCH v5 7/7] kvm, mem-hotplug: Unpin and remove nested_vmx->apic_access_page.

2014-09-10 Thread Tang Chen
Just like we removed kvm_arch->apic_access_page, nested_vmx->apic_access_page becomes useless for the same reason. This patch removes nested_vmx->apic_access_page, and use gfn_to_page() to pin it in memory when we need it, and unpin it after then. Signed-off-by: Tang Chen --- arc

[PATCH v5 2/7] kvm: Remove ept_identity_pagetable from struct kvm_arch.

2014-09-10 Thread Tang Chen
m_arch->ept_identity_pagetable is removed, ept identity pagetable page is no longer pinned in memory. And it can be migrated/hot-removed. Signed-off-by: Tang Chen Reviewed-by: Gleb Natapov --- arch/x86/include/asm/kvm_host.h | 1 - arch/x86/kvm/vmx.c

[PATCH v5 1/7] kvm: Use APIC_DEFAULT_PHYS_BASE macro as the apic access page address.

2014-09-10 Thread Tang Chen
We have APIC_DEFAULT_PHYS_BASE defined as 0xfee0, which is also the address of apic access page. So use this macro. Signed-off-by: Tang Chen Reviewed-by: Gleb Natapov --- arch/x86/kvm/svm.c | 3 ++- arch/x86/kvm/vmx.c | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff

[PATCH v5 0/7] kvm, mem-hotplug: Do not pin ept identity pagetable and apic access page.

2014-09-10 Thread Tang Chen
ch 7/7: Remove nested_vmx->apic_access_page. Tang Chen (7): kvm: Use APIC_DEFAULT_PHYS_BASE macro as the apic access page address. kvm: Remove ept_identity_pagetable from struct kvm_arch. kvm: Make init_rmode_identity_map() return 0 on success. kvm, mem-hotplug: Reload L1' apic ac

[PATCH v5 4/7] kvm, mem-hotplug: Reload L1' apic access page on migration in vcpu_enter_guest().

2014-09-10 Thread Tang Chen
->arch.apic_access_page to the new page. Signed-off-by: Tang Chen --- arch/x86/include/asm/kvm_host.h | 1 + arch/x86/kvm/svm.c | 6 ++ arch/x86/kvm/vmx.c | 6 ++ arch/x86/kvm/x86.c | 15 +++ include/linux/kvm_host.h|

[PATCH v5 5/7] kvm, mem-hotplug: Reload L1's apic access page on migration when L2 is running.

2014-09-10 Thread Tang Chen
for all L2 vmcs. And this patch requests apic access page reload in L2->L1 vmexit. Signed-off-by: Tang Chen --- arch/x86/kvm/vmx.c | 7 +++ virt/kvm/kvm_main.c | 1 + 2 files changed, 8 insertions(+) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index da6d55d..e7704b2 100644 --- a

[PATCH v5 6/7] kvm, mem-hotplug: Unpin and remove kvm_arch->apic_access_page.

2014-09-10 Thread Tang Chen
v Signed-off-by: Tang Chen --- arch/x86/include/asm/kvm_host.h | 2 +- arch/x86/kvm/vmx.c | 32 +--- arch/x86/kvm/x86.c | 15 +-- 3 files changed, 35 insertions(+), 14 deletions(-) diff --git a/arch/x86/include/asm/kvm_host.h b

[PATCH v5 6/7] kvm, mem-hotplug: Unpin and remove kvm_arch-apic_access_page.

2014-09-10 Thread Tang Chen
...@kernel.org Signed-off-by: Tang Chen tangc...@cn.fujitsu.com --- arch/x86/include/asm/kvm_host.h | 2 +- arch/x86/kvm/vmx.c | 32 +--- arch/x86/kvm/x86.c | 15 +-- 3 files changed, 35 insertions(+), 14 deletions(-) diff --git a/arch/x86

[PATCH v5 1/7] kvm: Use APIC_DEFAULT_PHYS_BASE macro as the apic access page address.

2014-09-10 Thread Tang Chen
We have APIC_DEFAULT_PHYS_BASE defined as 0xfee0, which is also the address of apic access page. So use this macro. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com Reviewed-by: Gleb Natapov g...@kernel.org --- arch/x86/kvm/svm.c | 3 ++- arch/x86/kvm/vmx.c | 6 +++--- 2 files changed, 5

[PATCH v5 0/7] kvm, mem-hotplug: Do not pin ept identity pagetable and apic access page.

2014-09-10 Thread Tang Chen
...@kernel.org) 3. Patch 7/7: Remove nested_vmx-apic_access_page. Tang Chen (7): kvm: Use APIC_DEFAULT_PHYS_BASE macro as the apic access page address. kvm: Remove ept_identity_pagetable from struct kvm_arch. kvm: Make init_rmode_identity_map() return 0 on success. kvm, mem-hotplug: Reload L1

[PATCH v5 2/7] kvm: Remove ept_identity_pagetable from struct kvm_arch.

2014-09-10 Thread Tang Chen
-ept_identity_pagetable is removed, ept identity pagetable page is no longer pinned in memory. And it can be migrated/hot-removed. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com Reviewed-by: Gleb Natapov g...@kernel.org --- arch/x86/include/asm/kvm_host.h | 1 - arch/x86/kvm/vmx.c

[PATCH v5 4/7] kvm, mem-hotplug: Reload L1' apic access page on migration in vcpu_enter_guest().

2014-09-10 Thread Tang Chen
-arch.apic_access_page to the new page. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com --- arch/x86/include/asm/kvm_host.h | 1 + arch/x86/kvm/svm.c | 6 ++ arch/x86/kvm/vmx.c | 6 ++ arch/x86/kvm/x86.c | 15 +++ include/linux

[PATCH v5 5/7] kvm, mem-hotplug: Reload L1's apic access page on migration when L2 is running.

2014-09-10 Thread Tang Chen
vmcs. And this patch requests apic access page reload in L2-L1 vmexit. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com --- arch/x86/kvm/vmx.c | 7 +++ virt/kvm/kvm_main.c | 1 + 2 files changed, 8 insertions(+) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index da6d55d..e7704b2

[PATCH v5 7/7] kvm, mem-hotplug: Unpin and remove nested_vmx-apic_access_page.

2014-09-10 Thread Tang Chen
Just like we removed kvm_arch-apic_access_page, nested_vmx-apic_access_page becomes useless for the same reason. This patch removes nested_vmx-apic_access_page, and use gfn_to_page() to pin it in memory when we need it, and unpin it after then. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com

[PATCH v5 3/7] kvm: Make init_rmode_identity_map() return 0 on success.

2014-09-10 Thread Tang Chen
on success, -errno on failure. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com --- arch/x86/kvm/vmx.c | 25 +++-- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 953d529..63c4c3e 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch

[PATCH v4 3/6] kvm: Make init_rmode_identity_map() return 0 on success.

2014-08-27 Thread Tang Chen
on success, -errno on failure. Signed-off-by: Tang Chen --- arch/x86/kvm/vmx.c | 25 +++-- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 953d529..63c4c3e 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c

[PATCH v4 2/6] kvm: Remove ept_identity_pagetable from struct kvm_arch.

2014-08-27 Thread Tang Chen
m_arch->ept_identity_pagetable is removed, ept identity pagetable page is no longer pinned in memory. And it can be migrated/hot-removed. Signed-off-by: Tang Chen --- arch/x86/include/asm/kvm_host.h | 1 - arch/x86/kvm/vmx.c | 50 -

[PATCH v4 0/6] kvm, mem-hotplug: Do not pin ept identity pagetable and apic access page.

2014-08-27 Thread Tang Chen
pages in memory, if user uses nested vm, memory hot-remove will not work. Change log v3 -> v4: 1. The original patch 6 is now patch 5. ( by Jan Kiszka ) 2. The original patch 1 is now patch 6 since we should unpin apic access page at the very last moment. Tang Chen (6): kvm:

[PATCH v4 4/6] kvm, mem-hotplug: Reload L1' apic access page on migration in vcpu_enter_guest().

2014-08-27 Thread Tang Chen
->arch.apic_access_page to the new page. Signed-off-by: Tang Chen --- arch/x86/include/asm/kvm_host.h | 1 + arch/x86/kvm/svm.c | 6 ++ arch/x86/kvm/vmx.c | 6 ++ arch/x86/kvm/x86.c | 15 +++ include/linux/kvm_host.h|

[PATCH v4 5/6] kvm, mem-hotplug: Reload L1's apic access page on migration when L2 is running.

2014-08-27 Thread Tang Chen
for all L2 vmcs. And this patch requests apic access page reload in L2->L1 vmexit. Signed-off-by: Tang Chen --- arch/x86/include/asm/kvm_host.h | 1 + arch/x86/kvm/svm.c | 6 ++ arch/x86/kvm/vmx.c | 32 arch/x86/kvm/x86.c

[PATCH v4 1/6] kvm: Use APIC_DEFAULT_PHYS_BASE macro as the apic access page address.

2014-08-27 Thread Tang Chen
We have APIC_DEFAULT_PHYS_BASE defined as 0xfee0, which is also the address of apic access page. So use this macro. Signed-off-by: Tang Chen --- arch/x86/kvm/svm.c | 3 ++- arch/x86/kvm/vmx.c | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/x86/kvm/svm.c b

[PATCH v4 6/6] kvm, mem-hotplug: Do not pin apic access page in memory.

2014-08-27 Thread Tang Chen
gfn_to_page() will finally call hva_to_pfn() to get the pfn, and pin the page in memory by calling GUP functions. This function unpins the page. After this patch, acpi access page is able to be migrated. Signed-off-by: Tang Chen --- arch/x86/kvm/vmx.c | 2 +- arch/x86/kvm/x86.c

[PATCH v4 4/6] kvm, mem-hotplug: Reload L1' apic access page on migration in vcpu_enter_guest().

2014-08-27 Thread Tang Chen
-arch.apic_access_page to the new page. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com --- arch/x86/include/asm/kvm_host.h | 1 + arch/x86/kvm/svm.c | 6 ++ arch/x86/kvm/vmx.c | 6 ++ arch/x86/kvm/x86.c | 15 +++ include/linux

[PATCH v4 5/6] kvm, mem-hotplug: Reload L1's apic access page on migration when L2 is running.

2014-08-27 Thread Tang Chen
vmcs. And this patch requests apic access page reload in L2-L1 vmexit. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com --- arch/x86/include/asm/kvm_host.h | 1 + arch/x86/kvm/svm.c | 6 ++ arch/x86/kvm/vmx.c | 32 arch/x86/kvm/x86.c

[PATCH v4 1/6] kvm: Use APIC_DEFAULT_PHYS_BASE macro as the apic access page address.

2014-08-27 Thread Tang Chen
We have APIC_DEFAULT_PHYS_BASE defined as 0xfee0, which is also the address of apic access page. So use this macro. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com --- arch/x86/kvm/svm.c | 3 ++- arch/x86/kvm/vmx.c | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git

[PATCH v4 3/6] kvm: Make init_rmode_identity_map() return 0 on success.

2014-08-27 Thread Tang Chen
on success, -errno on failure. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com --- arch/x86/kvm/vmx.c | 25 +++-- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 953d529..63c4c3e 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch

[PATCH v4 2/6] kvm: Remove ept_identity_pagetable from struct kvm_arch.

2014-08-27 Thread Tang Chen
-ept_identity_pagetable is removed, ept identity pagetable page is no longer pinned in memory. And it can be migrated/hot-removed. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com --- arch/x86/include/asm/kvm_host.h | 1 - arch/x86/kvm/vmx.c | 50

[PATCH v4 6/6] kvm, mem-hotplug: Do not pin apic access page in memory.

2014-08-27 Thread Tang Chen
gfn_to_page() will finally call hva_to_pfn() to get the pfn, and pin the page in memory by calling GUP functions. This function unpins the page. After this patch, acpi access page is able to be migrated. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com --- arch/x86/kvm/vmx.c | 2 +- arch

[PATCH v4 0/6] kvm, mem-hotplug: Do not pin ept identity pagetable and apic access page.

2014-08-27 Thread Tang Chen
pages in memory, if user uses nested vm, memory hot-remove will not work. Change log v3 - v4: 1. The original patch 6 is now patch 5. ( by Jan Kiszka jan.kis...@web.de ) 2. The original patch 1 is now patch 6 since we should unpin apic access page at the very last moment. Tang Chen (6

[PATCH 1/1] memblock, memhotplug: Fix wrong type in memblock_find_in_range_node().

2014-08-10 Thread Tang Chen
ishi Qiu Signed-off-by: Tang Chen --- mm/memblock.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/memblock.c b/mm/memblock.c index 6d2f219..70fad0c 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -192,8 +192,7 @@ phys_addr_t __init_memblock memblock_find_in_range_n

[PATCH 1/1] memblock, memhotplug: Fix wrong type in memblock_find_in_range_node().

2014-08-10 Thread Tang Chen
...@huawei.com Signed-off-by: Tang Chen tangc...@cn.fujitsu.com --- mm/memblock.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/memblock.c b/mm/memblock.c index 6d2f219..70fad0c 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -192,8 +192,7 @@ phys_addr_t __init_memblock

<    1   2   3   4   5   6   7   8   9   10   >