Re: [PATCH -v3] Monitor command: x-gpa2hva, translate guest physical address to host virtual address

2011-04-28 Thread Huang Ying
On 04/28/2011 10:04 PM, Marcelo Tosatti wrote: On Thu, Apr 28, 2011 at 08:00:19AM -0500, Anthony Liguori wrote: On 04/27/2011 06:06 PM, Marcelo Tosatti wrote: On Fri, Nov 19, 2010 at 04:17:35PM +0800, Huang Ying wrote: On Tue, 2010-11-16 at 10:23 +0800, Huang Ying wrote: Author: Max

Re: [PATCH uq/master -v2 2/2] KVM, MCE, unpoison memory address across reboot

2011-02-10 Thread Huang Ying
On Thu, 2011-02-10 at 16:52 +0800, Jan Kiszka wrote: On 2011-02-10 01:27, Huang Ying wrote: @@ -1882,6 +1919,7 @@ int kvm_arch_on_sigbus_vcpu(CPUState *en hardware_memory_error(); } } +kvm_hwpoison_page_add(ram_addr

Re: [PATCH uq/master -v2 2/2] KVM, MCE, unpoison memory address across reboot

2011-02-09 Thread Huang Ying
On Wed, 2011-02-09 at 16:00 +0800, Jan Kiszka wrote: On 2011-02-09 04:00, Huang Ying wrote: In Linux kernel HWPoison processing implementation, the virtual address in processes mapping the error physical memory page is marked as HWPoison. So that, the further accessing to the virtual

[PATCH uq/master -v2 1/2] Add qemu_ram_remap

2011-02-08 Thread Huang Ying
qemu_ram_remap() unmaps the specified RAM pages, then re-maps these pages again. This is used by KVM HWPoison support to clear HWPoisoned page tables across guest rebooting, so that a new page may be allocated later to recover the memory error. Signed-off-by: Huang Ying ying.hu...@intel.com

[PATCH uq/master -v2 2/2] KVM, MCE, unpoison memory address across reboot

2011-02-08 Thread Huang Ying
a new page to recover the issue. Signed-off-by: Huang Ying ying.hu...@intel.com --- target-i386/kvm.c | 39 +++ 1 file changed, 39 insertions(+) --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -508,6 +508,42 @@ static int kvm_get_supported_msrs(KVMSta

[PATCH -v2 0/3] KVM, Replace is_hwpoison_address with __get_user_pages

2011-01-29 Thread Huang Ying
v2: - Export __get_user_pages, because we need other get_user_pages variants too. [PATCH -v2 1/3] mm, export __get_user_pages [PATCH -v2 2/3] mm, Make __get_user_pages return -EHWPOISON for HWPOISON page optionally [PATCH -v2 3/3] KVM, Replace is_hwpoison_address with __get_user_pages -- To

[PATCH -v2 2/3] mm, Make __get_user_pages return -EHWPOISON for HWPOISON page optionally

2011-01-29 Thread Huang Ying
not to be changed. This feature is needed by KVM, where UCR MCE should be relayed to guest for HWPOISON page, while instruction emulation and MMIO will be tried for general FAULT page. The idea comes from Andrew Morton. Signed-off-by: Huang Ying ying.hu...@intel.com Cc: Andrew Morton a...@linux

[PATCH -v2 3/3] KVM, Replace is_hwpoison_address with __get_user_pages

2011-01-29 Thread Huang Ying
guest rebooting. But it is also possible that the underlying memory page is kept poisoned even after the corresponding page table entry is cleared, that is, a new memory page can not be allocated. __get_user_pages can catch these situations. Signed-off-by: Huang Ying ying.hu...@intel.com

[PATCH -v2 1/3] mm, export __get_user_pages

2011-01-29 Thread Huang Ying
directly. There are some symbol name conflicts in infiniband driver, fixed them too. Signed-off-by: Huang Ying ying.hu...@intel.com CC: Andrew Morton a...@linux-foundation.org CC: Michel Lespinasse wal...@google.com CC: Roland Dreier rol...@kernel.org CC: Ralph Campbell infinip...@qlogic.com

Re: [PATCH 1/2] mm, Make __get_user_pages return -EHWPOISON for HWPOISON page optionally

2011-01-26 Thread Huang Ying
Hi, Andrew, On Thu, 2011-01-20 at 23:50 +0800, Marcelo Tosatti wrote: On Mon, Jan 17, 2011 at 08:47:39AM +0800, Huang Ying wrote: Hi, Andrew, On Sun, 2011-01-16 at 23:35 +0800, Avi Kivity wrote: On 01/14/2011 03:37 AM, Huang Ying wrote: On Thu, 2011-01-13 at 18:43 +0800, Avi Kivity

Re: [PATCH 1/2] mm, Make __get_user_pages return -EHWPOISON for HWPOISON page optionally

2011-01-16 Thread Huang Ying
Hi, Andrew, On Sun, 2011-01-16 at 23:35 +0800, Avi Kivity wrote: On 01/14/2011 03:37 AM, Huang Ying wrote: On Thu, 2011-01-13 at 18:43 +0800, Avi Kivity wrote: On 01/13/2011 10:42 AM, Huang Ying wrote: Make __get_user_pages return -EHWPOISON for HWPOISON page only

Re: [PATCH] KVM: x86: Remove user space triggerable MCE error message

2011-01-16 Thread Huang Ying
hardware too, if the Machine Check exception is raised during early boot stage or the second MC exception is raised before the first MC exception is processed/cleared. So I use printk here to help debugging these issues. To avoid flooding the kernel log, we can use ratelimit. Best Regards, Huang

Re: [PATCH uq/master 2/2] MCE, unpoison memory address across reboot

2011-01-16 Thread Huang Ying
On Fri, 2011-01-14 at 16:38 +0800, Jan Kiszka wrote: Am 14.01.2011 02:51, Huang Ying wrote: On Thu, 2011-01-13 at 17:01 +0800, Jan Kiszka wrote: Am 13.01.2011 09:34, Huang Ying wrote: [snip] + +void kvm_unpoison_all(void *param) Minor nit: This can be static now. In uq/master

Re: [PATCH] KVM: x86: Remove user space triggerable MCE error message

2011-01-16 Thread Huang Ying
On Mon, 2011-01-17 at 15:11 +0800, Jan Kiszka wrote: On 2011-01-17 01:54, Huang Ying wrote: On Sat, 2011-01-15 at 17:00 +0800, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com This case is a pure user space error we do not need to record. Moreover, it can be misused to flood

[PATCH uq/master 2/2] MCE, unpoison memory address across reboot

2011-01-13 Thread Huang Ying
page to recover the issue. Signed-off-by: Huang Ying ying.hu...@intel.com --- kvm.h |2 ++ target-i386/kvm.c | 39 +++ 2 files changed, 41 insertions(+) --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -580,6 +580,42 @@ static int

[PATCH uq/master 1/2] Add qemu_ram_remap

2011-01-13 Thread Huang Ying
qemu_ram_remap() unmaps the specified RAM pages, then re-maps these pages again. This is used by KVM HWPoison support to clear HWPoisoned page tables across guest rebooting, so that a new page may be allocated later to recover the memory error. Signed-off-by: Huang Ying ying.hu...@intel.com

[PATCH 1/2] mm, Make __get_user_pages return -EHWPOISON for HWPOISON page optionally

2011-01-13 Thread Huang Ying
Andrew Morton. Signed-off-by: Huang Ying ying.hu...@intel.com Cc: Andrew Morton a...@linux-foundation.org --- include/asm-generic/errno.h |2 + include/linux/mm.h | 17 + mm/memory.c | 55 +--- 3 files changed, 71

[PATCH 2/2] KVM, Replace is_hwpoison_address with get_user_pages_hwpoison

2011-01-13 Thread Huang Ying
across guest rebooting. But it is also possible that the underlying memory page is kept poisoned even after the corresponding page table entry is cleared, that is, a new memory page can not be allocated. get_user_pages_hwpoison can catch these situations. Signed-off-by: Huang Ying ying.hu

Re: [PATCH 1/2] mm, Make __get_user_pages return -EHWPOISON for HWPOISON page optionally

2011-01-13 Thread Huang Ying
On Thu, 2011-01-13 at 18:43 +0800, Avi Kivity wrote: On 01/13/2011 10:42 AM, Huang Ying wrote: Make __get_user_pages return -EHWPOISON for HWPOISON page only if FOLL_HWPOISON is specified. With this patch, the interested callers can distinguish HWPOISON page from general FAULT page, while

Re: [PATCH uq/master 2/2] MCE, unpoison memory address across reboot

2011-01-13 Thread Huang Ying
On Thu, 2011-01-13 at 17:01 +0800, Jan Kiszka wrote: Am 13.01.2011 09:34, Huang Ying wrote: In Linux kernel HWPoison processing implementation, the virtual address in processes mapping the error physical memory page is marked as HWPoison. So that, the further accessing to the virtual

Re: [PATCH v3 12/21] kvm: x86: Drop MCE MSRs write back restrictions

2011-01-05 Thread Huang Ying
On Wed, 2011-01-05 at 16:07 +0800, Jan Kiszka wrote: Am 05.01.2011 07:42, Huang Ying wrote: On Tue, 2011-01-04 at 16:32 +0800, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com There is no need to restrict writing back MCE MSRs to reset or full state updates as setting

Re: [PATCH v3 12/21] kvm: x86: Drop MCE MSRs write back restrictions

2011-01-04 Thread Huang Ying
MCG_STATUS, so their content should be kept. And the following sequence may set uncorrected value in MCE registers. savevm - loadvm - (OS clear MCE registers) - reset - (MCE registers has new (uncorrected) value) Best Regards, Huang Ying Signed-off-by: Jan Kiszka jan.kis...@siemens.com CC

Re: [RFC 2/2] KVM, MCE, unpoison memory address across reboot

2011-01-04 Thread Huang Ying
On Fri, 2010-12-31 at 17:10 +0800, Jan Kiszka wrote: Am 31.12.2010 06:22, Huang Ying wrote: In Linux kernel HWPoison processing implementation, the virtual address in processes mapping the error physical memory page is marked as HWPoison. So that, the further accessing to the virtual

[RFC 1/2] Add qemu_ram_remap

2010-12-30 Thread Huang Ying
qemu_ram_remap() unmaps the specified RAM pages, then re-maps these pages again. This is used by KVM HWPoison support to clear HWPoisoned page tables across guest rebooting, so that a new page may be allocated later to recover the memory error. Signed-off-by: Huang Ying ying.hu...@intel.com

[RFC 2/2] KVM, MCE, unpoison memory address across reboot

2010-12-30 Thread Huang Ying
a new page to recover the issue. Signed-off-by: Huang Ying ying.hu...@intel.com --- kvm.h |2 ++ qemu-kvm.c| 37 + target-i386/kvm.c |2 ++ 3 files changed, 41 insertions(+) --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -1803,6

Re: QEMU, MCE, unpoison memory address across reboot

2010-12-28 Thread Huang Ying
break huge page to 4k pages during poisoning? Yes. That has not been implemented yet. So in fact, we can not deal with hwpoison+hugetlb in kvm now. Best Regards, Huang Ying -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More

Re: QEMU, MCE, unpoison memory address across reboot

2010-12-27 Thread Huang Ying
of MADV_DONTNEED. But on the other hand, whether qemu_vmalloc is implemented via posix_memalign on Linux? If it is, we can not guarantee that corresponding page table is zapped after qemu_vfree and qemu_vmalloc? That is glibc implementation details. Best Regards, Huang Ying -- To unsubscribe from this list

Re: QEMU, MCE, unpoison memory address across reboot

2010-12-23 Thread Huang Ying
guest doesn't need as much as the old one. So you suggest to free/reallocate all guest memory across every reboot regardless whether there's hwpoisoned page? Best Regards, Huang Ying -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord

Re: QEMU, MCE, unpoison memory address across reboot

2010-12-23 Thread Huang Ying
RAMBlock to track these memory, and ignore them during reallocation. But if there are hwpoisoned pages in these memory, we can not recover. Do you think that is OK? Best Regards, Huang Ying -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord

Re: [RFC 1/3] mm, Make __get_user_pages return -EHWPOISON for HWPOISON page optionally

2010-12-22 Thread Huang Ying
Hi, Andrew, Thanks for comments. On Thu, 2010-12-23 at 07:07 +0800, Andrew Morton wrote: On Wed, 22 Dec 2010 10:51:55 +0800 Huang Ying ying.hu...@intel.com wrote: Make __get_user_pages return -EHWPOISON for HWPOISON page only if FOLL_HWPOISON is specified. With this patch

[RFC 0/3] KVM, HWPoison, unpoison address across rebooting

2010-12-21 Thread Huang Ying
Unpoison address across rebooting, to make it possible that a new memory page can be allocated, so that guest system can successfully reboot. [RFC 1/3] mm, Make __get_user_pages return -EHWPOISON for HWPOISON page optionally [RFC 2/3] KVM, Replace is_hwpoison_address with get_user_pages_hwpoison

[RFC 1/3] mm, Make __get_user_pages return -EHWPOISON for HWPOISON page optionally

2010-12-21 Thread Huang Ying
Andrew Morton. Signed-off-by: Huang Ying ying.hu...@intel.com Cc: Andrew Morton a...@linux-foundation.org --- include/asm-generic/errno.h |2 + include/linux/mm.h |5 mm/memory.c | 53 +--- 3 files changed, 57 insertions

[RFC 3/3] KVM, HWPoison, unpoison address across rebooting

2010-12-21 Thread Huang Ying
by clearing the corresponding PTE is provided. So that, when doing rebooting, QEMU can unpoison the poisoned virtual address, and when the unpoisoned memory page is accessed, a new physical memory may be allocated if possible. Signed-off-by: Huang Ying ying.hu...@intel.com --- include/linux/kvm.h

QEMU, MCE, unpoison memory address across reboot

2010-12-21 Thread Huang Ying
that make it possible to allocate a new page to recover the issue. Signed-off-by: Huang Ying ying.hu...@intel.com --- kvm.h |2 ++ kvm/include/linux/kvm.h |2 ++ qemu-kvm.c | 40 target-i386/kvm.c |2 ++ 4

[RFC 2/3] KVM, Replace is_hwpoison_address with get_user_pages_hwpoison

2010-12-21 Thread Huang Ying
a new memory page for the virtual address. But it is also possible that the underlying memory page is kept poisoned even after the corresponding page table entry is cleared, that is, a new memory page can not be allocated. get_user_pages_hwpoison can catch these situations. Signed-off-by: Huang

Re: [PATCH 3/3] Check processor version for broadcast.

2010-11-30 Thread Huang Ying
|= 0x02; /* bit 1: 1(broadcast); 0(not broadcast) */ Why not wrap this into a function? I think it may be used by other functions too. Best Regards, Huang Ying -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo

Re: [PATCH] Add function for clearing the requested VCPUs' mce registers.

2010-11-24 Thread Huang Ying
registers are not cleared in real machine too. And it is not so pain to reboot the guest. Best Regards, Huang Ying -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo

Re: [PATCH 1/2] Add broadcast option for mce command.

2010-11-24 Thread Huang Ying
mcgstatus addr misc, .help = inject a MCE on the given CPU, +#endif Broadcast can not be used by QEMU-TCG? [...] Best Regards, Huang Ying -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info at http

Re: [PATCH] Add function for clearing the requested VCPUs' mce registers.

2010-11-24 Thread Huang Ying
On Thu, 2010-11-25 at 13:30 +0800, Jin Dongming wrote: Hi, Huang-san (2010/11/25 10:27), Huang Ying wrote: Hi, Dongming, On Thu, 2010-11-25 at 09:14 +0800, Jin Dongming wrote: In some case of mce test, the injected data can be remained in the registers and ca affect to the result

Re: [PATCH 2/2] reset mce registers of the given VCPU or all VCPUs with mce command.

2010-11-24 Thread Huang Ying
mode. Best Regards, Huang Ying -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH -v3] Monitor command: x-gpa2hva, translate guest physical address to host virtual address

2010-11-19 Thread Huang Ying
On Tue, 2010-11-16 at 10:23 +0800, Huang Ying wrote: Author: Max Asbock masb...@linux.vnet.ibm.com Add command x-gpa2hva to translate guest physical address to host virtual address. Because gpa to hva translation is not consistent, so this command is only used for debugging. The x-gpa2hva

[PATCH -v3] Monitor command: x-gpa2hva, translate guest physical address to host virtual address

2010-11-15 Thread Huang Ying
is not consistent v2: - Add QMP support Signed-off-by: Max Asbock masb...@linux.vnet.ibm.com Signed-off-by: Jiajia Zheng jiajia.zh...@intel.com Signed-off-by: Huang Ying ying.hu...@intel.com --- hmp-commands.hx | 15 +++ monitor.c | 22 ++ 2 files changed, 37

Re: [PATCH -v2] Monitor command: pfa2hva, translate guest physical address to host virtual address

2010-11-14 Thread Huang Ying
On Sun, 2010-11-14 at 19:08 +0800, Avi Kivity wrote: On 11/12/2010 03:16 AM, Huang Ying wrote: On Thu, 2010-11-11 at 17:39 +0800, Avi Kivity wrote: On 11/11/2010 02:56 AM, Huang Ying wrote: On Thu, 2010-11-11 at 00:49 +0800, Anthony Liguori wrote: On 11/10/2010 02:34 AM, Avi

Re: [PATCH -v2] Monitor command: pfa2hva, translate guest physical address to host virtual address

2010-11-11 Thread Huang Ying
On Thu, 2010-11-11 at 17:39 +0800, Avi Kivity wrote: On 11/11/2010 02:56 AM, Huang Ying wrote: On Thu, 2010-11-11 at 00:49 +0800, Anthony Liguori wrote: On 11/10/2010 02:34 AM, Avi Kivity wrote: Why the gpa - hva mapping is not consistent for RAM if -mempath is not used

Re: [PATCH -v2] Monitor command: pfa2hva, translate guest physical address to host virtual address

2010-11-10 Thread Huang Ying
is not used? Best Regards, Huang Ying -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH -v2] Monitor command: pfa2hva, translate guest physical address to host virtual address

2010-11-10 Thread Huang Ying
On Wed, 2010-11-10 at 16:28 +0800, Avi Kivity wrote: On 11/10/2010 09:41 AM, Huang Ying wrote: On Wed, 2010-11-10 at 14:59 +0800, Avi Kivity wrote: On 11/10/2010 08:56 AM, Avi Kivity wrote: On 11/08/2010 05:39 AM, Anthony Liguori wrote: Yes. The main usage of the interface

Re: [PATCH -v2] Monitor command: pfa2hva, translate guest physical address to host virtual address

2010-11-10 Thread Huang Ying
during operating. Such as gpa2hva_begin and gpa2hva_end and lock the mapping in between. I think 2) may be possible. But if there are no other users, why do that for a test case? So I think 1) may be the better option. Best Regards, Huang Ying -- To unsubscribe from this list: send the line

Re: [PATCH -v2] Monitor command: pfa2hva, translate guest physical address to host virtual address

2010-11-09 Thread Huang Ying
for hugetlbfs has some issues now. Because it is hard for QEMU to deal with 2M poisoned page reported by host OS. Although it is possible for QEMU to relay 2M poisoned page as MCE to guest OS, the guest OS may not work properly for this kind of MCE. Best Regards, Huang Ying -- To unsubscribe from

Re: [PATCH -v2] Monitor command: pfa2hva, translate guest physical address to host virtual address

2010-11-08 Thread Huang Ying
Hi, Anthony, On Mon, 2010-11-08 at 11:39 +0800, Anthony Liguori wrote: On 11/07/2010 07:29 PM, Huang Ying wrote: On Sun, 2010-11-07 at 00:24 +0800, Avi Kivity wrote: On 11/01/2010 03:22 PM, Anthony Liguori wrote: On 11/01/2010 02:20 PM, Huang Ying wrote: Yes

Re: [PATCH -v2] Monitor command: pfa2hva, translate guest physical address to host virtual address

2010-11-08 Thread Huang Ying
On Mon, 2010-11-08 at 11:39 +0800, Anthony Liguori wrote: On 11/07/2010 07:29 PM, Huang Ying wrote: On Sun, 2010-11-07 at 00:24 +0800, Avi Kivity wrote: On 11/01/2010 03:22 PM, Anthony Liguori wrote: On 11/01/2010 02:20 PM, Huang Ying wrote: Yes. As general

Re: [PATCH -v2] Monitor command: pfa2hva, translate guest physical address to host virtual address

2010-11-07 Thread Huang Ying
On Sun, 2010-11-07 at 00:24 +0800, Avi Kivity wrote: On 11/01/2010 03:22 PM, Anthony Liguori wrote: On 11/01/2010 02:20 PM, Huang Ying wrote: Yes. As general interface, it may not work so well, but as test interface, it works quite well and useful. Do we have any mechanism to add a test

Re: [PATCH -v2] Monitor command: pfa2hva, translate guest physical address to host virtual address

2010-11-01 Thread Huang Ying
On Mon, 2010-11-01 at 11:49 -0700, Anthony Liguori wrote: On 11/01/2010 11:09 AM, Marcelo Tosatti wrote: On Tue, Oct 26, 2010 at 10:39:48AM +0800, Huang Ying wrote: Author: Max Asbockmasb...@linux.vnet.ibm.com Add command pfa2hva to translate guest physical address to host virtual

[PATCH -v2] Monitor command: pfa2hva, translate guest physical address to host virtual address

2010-10-25 Thread Huang Ying
to inject a machine check error. As a consequence the HWPOISON code on the host and the MCE injection code in qemu-kvm are exercised. v2: - Add QMP support Signed-off-by: Max Asbock masb...@linux.vnet.ibm.com Signed-off-by: Jiajia Zheng jiajia.zh...@intel.com Signed-off-by: Huang Ying ying.hu

Re: [Qemu-devel] Re: [PATCH 11/11] kvm, x86: broadcast mce depending on the cpu version

2010-10-14 Thread Huang Ying
Regards, Huang Ying -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH 1/2] kvm, MCE, Add MCG_SER_P into KVM_MCE_CAP_SUPPORTED

2010-10-08 Thread Huang Ying
Now we have MCG_SER_P (and corresponding SRAO/SRAR MCE) support in kernel and QEMU-KVM, the MCG_SER_P should be added into KVM_MCE_CAP_SUPPORTED to make all these code really works. Reported-by: Dean Nelson dnel...@redhat.com Signed-off-by: Huang Ying ying.hu...@intel.com --- arch/x86/kvm/x86.c

[PATCH 2/2] kvm, MCE, Send SRAR SIGBUS directly

2010-10-08 Thread Huang Ying
Originally, SRAR SIGBUS is sent to QEMU-KVM via touching the poisoned page. But commit 96054569190bdec375fe824e48ca1f4e3b53dd36 prevents the signal from being sent. So now the signal is sent via force_sig_info_fault directly. Reported-by: Dean Nelson dnel...@redhat.com Signed-off-by: Huang Ying

[PATCH] Fix SRAO/SRAR MCE injecting on guest without MCG_SER_P

2010-10-08 Thread Huang Ying
On real machine, if MCG_SER_P in MSR_MCG_CAP is not set, SRAO/SRAR MCE should not be raised by hardware. This patch makes QEMU-KVM to follow the same rule. Reported-by: Hidetoshi Seto seto.hideto...@jp.fujitsu.com Signed-off-by: Huang Ying ying.hu...@intel.com --- qemu-kvm.c |6 +++--- 1

Re: [PATCH 2/2] kvm, MCE, Send SRAR SIGBUS directly

2010-10-08 Thread Huang Ying
On Sat, 2010-10-09 at 04:25 +0800, Marcelo Tosatti wrote: On Fri, Oct 08, 2010 at 04:24:15PM +0800, Huang Ying wrote: Originally, SRAR SIGBUS is sent to QEMU-KVM via touching the poisoned page. But commit 96054569190bdec375fe824e48ca1f4e3b53dd36 prevents the signal from being sent. So now

Re: [patch uq/master 7/8] MCE: Relay UCR MCE to guest

2010-10-07 Thread Huang Ying
to guest will mean that guest receives VAL|UC|!PCC and RIPV event from virtual processor that doesn't have SER_P. Dean also noted this. I don't think it was deliberate choice to not expose SER_P. Huang? In fact, that should be a BUG. I will fix it as soon as possible. Best Regards, Huang Ying

Re: [patch uq/master 7/8] MCE: Relay UCR MCE to guest

2010-10-07 Thread Huang Ying
in business... Because the contents of poisoned pages are not relevant after reboot. Qemu can replace the poisoned pages with good pages when reboot guest. Do you think that is good. Best Regards, Huang Ying -- To unsubscribe from this list: send the line unsubscribe kvm in the body

[PATCH] Monitor command to translate guest physical address to host virtual address

2010-09-30 Thread Huang Ying
a machine check error. As a consequence the HWPOISON code on the host and the MCE injection code in qemu-kvm are exercised. Signed-off-by: Max Asbock masb...@linux.vnet.ibm.com Signed-off-by: Jiajia Zheng jiajia.zh...@intel.com Signed-off-by: Huang Ying ying.hu...@intel.com --- monitor.c | 11

Re: [PATCH] Add RAM - physical addr mapping in MCE simulation

2010-09-26 Thread Huang Ying
Hi, Marcelo, On Tue, 2010-09-21 at 00:10 +0800, Marcelo Tosatti wrote: On Sun, Sep 19, 2010 at 09:00:33AM +0800, Huang Ying wrote: In QEMU-KVM, physical address != RAM address. While MCE simulation needs physical address instead of RAM address. So kvm_physical_memory_addr_from_ram

[PATCH] Add RAM - physical addr mapping in MCE simulation

2010-09-18 Thread Huang Ying
Signed-off-by: Huang Ying ying.hu...@intel.com --- kvm-all.c | 18 ++ kvm.h |3 +++ qemu-kvm.c | 13 ++--- 3 files changed, 31 insertions(+), 3 deletions(-) --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -1137,12 +1137,15 @@ static void sigbus_handler(int n, struct

Re: [PATCH 1/2] KVM: Expose MCE control MSRs to userspace

2010-07-11 Thread Huang Ying
. At least for Linux that is OK. Don't know whether Windows will set _CTL during boot. Best Regards, Huang Ying -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 1/2] KVM: Expose MCE control MSRs to userspace

2010-07-08 Thread Huang Ying
On Thu, 2010-07-08 at 15:43 +0800, Avi Kivity wrote: On 07/08/2010 05:07 AM, Huang Ying wrote: static u32 emulated_msrs[] = { MSR_IA32_MISC_ENABLE, + MSR_IA32_MCG_STATUS, + MSR_IA32_MCG_CTL, We need only clear MSR_IA32_MCG_STATUS during reset, but should not clear

Re: [PATCH 1/2] KVM: Expose MCE control MSRs to userspace

2010-07-07 Thread Huang Ying
, + MSR_IA32_MCG_STATUS, + MSR_IA32_MCG_CTL, We need only clear MSR_IA32_MCG_STATUS during reset, but should not clear MSR_IA32_MCG_CTL. }; static int set_efer(struct kvm_vcpu *vcpu, u64 efer) Best Regards, Huang Ying -- To unsubscribe from this list: send the line unsubscribe kvm

[BUGFIX] kvm, Fix a race condition for usage of is_hwpoison_address

2010-06-22 Thread Huang Ying
is_hwpoison_address accesses the page table, so the caller must hold current-mm-mmap_sem in read mode. So fix its usage in hav_to_pfn of kvm accordingly. Comments on is_hwpoison_address are added to remind other users. Reported-by: Avi Kivity a...@redhat.com Signed-off-by: Huang Ying ying.hu

Re: [PATCH 3/6] KVM: MMU: introduce gfn_to_page_atomic() and gfn_to_pfn_atomic()

2010-06-16 Thread huang ying
(), is it? For is_hwpoison_address() in hva_to_pfn(), we can protect it with mmap_sem. Best Regards, Huang Ying -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH -v3] KVM, Fix QEMU-KVM is killed by guest SRAO MCE (resend)

2010-05-31 Thread Huang Ying
...@linux.vnet.ibm.com Signed-off-by: Huang Ying ying.hu...@intel.com --- arch/x86/kvm/mmu.c | 34 ++ arch/x86/kvm/paging_tmpl.h |7 ++- include/linux/kvm_host.h |1 + include/linux/mm.h |8 mm/memory-failure.c| 30

[PATCH -v3] KVM, Fix QEMU-KVM is killed by guest SRAO MCE

2010-05-17 Thread Huang Ying
...@linux.vnet.ibm.com Signed-off-by: Huang Ying ying.hu...@intel.com --- arch/x86/kvm/mmu.c | 34 ++ arch/x86/kvm/paging_tmpl.h |7 ++- include/linux/kvm_host.h |1 + include/linux/mm.h |8 mm/memory-failure.c| 30

Re: [PATCH -v2] KVM, Fix QEMU-KVM is killed by guest SRAO MCE

2010-05-13 Thread Huang Ying
On Fri, 2010-05-14 at 05:43 +0800, Marcelo Tosatti wrote: On Wed, May 12, 2010 at 02:44:03PM +0800, Huang Ying wrote: @@ -1975,6 +1976,27 @@ static int __direct_map(struct kvm_vcpu return pt_write; } +static void kvm_send_hwpoison_signal(struct kvm *kvm, gfn_t gfn

[PATCH -v2] KVM, Fix QEMU-KVM is killed by guest SRAO MCE

2010-05-12 Thread Huang Ying
address is poisoned to avoid change user space interface (via changing get_user_pages). - Wrap bad page processing into kvm_handle_bad_page to avoid code duplicating. Reported-by: Max Asbock masb...@linux.vnet.ibm.com Signed-off-by: Huang Ying ying.hu...@intel.com --- arch/x86/kvm/mmu.c

Re: [PATCH] Ignore SRAO MCE if another MCE is being processed

2010-04-28 Thread Huang Ying
On Wed, 2010-04-28 at 00:12 +0800, Marcelo Tosatti wrote: On Tue, Apr 27, 2010 at 03:10:49PM +0800, Huang Ying wrote: In common cases, guest SRAO MCE will cause corresponding poisoned page be un-mapped in host and SIGBUS be sent to QEMU-KVM, then QEMU-KVM will relay the MCE to guest OS

Re: [PATCH 2/2] KVM, Fix QEMU-KVM is killed by guest SRAO MCE

2010-04-28 Thread Huang Ying
On Wed, 2010-04-28 at 17:47 +0800, Avi Kivity wrote: On 04/28/2010 05:56 AM, Huang Ying wrote: Just want to use the side effect of copy_from_user, SIGBUS will be sent to current process because the page touched is marked as poisoned. That is, failure is expected, so the return value

[PATCH] Ignore SRAO MCE if another MCE is being processed

2010-04-27 Thread Huang Ying
system is given opportunity to survive. Signed-off-by: Huang Ying ying.hu...@intel.com --- qemu-kvm.c | 28 1 file changed, 28 insertions(+) --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -1610,6 +1610,19 @@ static void flush_queued_work(CPUState * pthread_cond_broadcast

Re: [PATCH 2/2] KVM, Fix QEMU-KVM is killed by guest SRAO MCE

2010-04-27 Thread Huang Ying
On Tue, 2010-04-27 at 15:47 +0800, Avi Kivity wrote: (please copy kvm@vger.kernel.org on kvm patches) Sorry, will do that for all future patches. On 04/27/2010 10:04 AM, Huang Ying wrote: +static void kvm_send_hwpoison_signal(struct kvm *kvm, gfn_t gfn) +{ + char buf[1]; + void

Re: [PATCH 2/2] KVM, Fix QEMU-KVM is killed by guest SRAO MCE

2010-04-27 Thread Huang Ying
On Tue, 2010-04-27 at 17:30 +0800, Avi Kivity wrote: On 04/27/2010 12:25 PM, Huang Ying wrote: On 04/27/2010 10:04 AM, Huang Ying wrote: +static void kvm_send_hwpoison_signal(struct kvm *kvm, gfn_t gfn) +{ + char buf[1]; + void __user *hva; + int r; + + /* Touch

[PATCH -v3] Add savevm/loadvm support for MCE

2010-03-03 Thread Huang Ying
framework. Signed-off-by: Huang Ying ying.hu...@intel.com --- qemu-kvm-x86.c | 36 1 file changed, 36 insertions(+) --- a/qemu-kvm-x86.c +++ b/qemu-kvm-x86.c @@ -748,7 +748,22 @@ static int get_msr_entry(struct kvm_msr_ case MSR_KVM_WALL_CLOCK

Re: [PATCH -v2] Add savevm/loadvm support for MCE

2010-03-02 Thread Huang Ying
On Tue, 2010-03-02 at 16:09 +0800, Jan Kiszka wrote: Huang Ying wrote: MCE registers are saved/load into/from CPUState in kvm_arch_save/load_regs. To simulate the MCG_STATUS clearing upon reset, MSR_MCG_STATUS is set to 0 for KVM_PUT_RESET_STATE. v2: - Rebased on new CPU

[PATCH -v2] Add savevm/loadvm support for MCE

2010-03-01 Thread Huang Ying
MCE registers are saved/load into/from CPUState in kvm_arch_save/load_regs. To simulate the MCG_STATUS clearing upon reset, MSR_MCG_STATUS is set to 0 for KVM_PUT_RESET_STATE. v2: - Rebased on new CPU registers save/load framework. Signed-off-by: Huang Ying ying.hu...@intel.com --- qemu-kvm

Add savevm/loadvm support for MCE

2010-02-25 Thread Huang Ying
saving. Signed-off-by: Huang Ying ying.hu...@intel.com --- qemu-kvm-x86.c | 54 ++ 1 file changed, 54 insertions(+) --- a/qemu-kvm-x86.c +++ b/qemu-kvm-x86.c @@ -803,6 +803,27 @@ static void get_seg(SegmentCache *lhs, c | (rhs-avl

Re: [BUGFIX] MCE: Fix bug of IA32_MCG_STATUS after system reset

2010-01-06 Thread Huang Ying
On Wed, 2010-01-06 at 16:03 +0800, Avi Kivity wrote: On 01/06/2010 09:05 AM, Huang Ying wrote: @@ -1015,6 +1015,7 @@ void kvm_arch_load_regs(CPUState *env) #endif set_msr_entry(msrs[n++], MSR_KVM_SYSTEM_TIME, env-system_time_msr); set_msr_entry(msrs[n

Re: [BUGFIX] MCE: Fix bug of IA32_MCG_STATUS after system reset

2010-01-06 Thread Huang Ying
, env-wall_clock_msr); +set_msr_entry(msrs[n++], MSR_MCG_STATUS, 0); Still need to keep EIPV and possibly RIPV, don't we? It appears that EIPV and RIPV is meaningless outside of MCE exception handler. But I will try to check the real hardware behavior. Best Regards, Huang Ying

[BUGFIX] MCE: Fix bug of IA32_MCG_STATUS after system reset

2010-01-05 Thread Huang Ying
in real hardware. This patch fixes this via set IA32_MCG_STATUS to 0 during system reset. Signed-off-by: Huang Ying ying.hu...@intel.com --- qemu-kvm-x86.c |1 + 1 file changed, 1 insertion(+) --- a/qemu-kvm-x86.c +++ b/qemu-kvm-x86.c @@ -1015,6 +1015,7 @@ void kvm_arch_load_regs(CPUState *env

Re: [BUGFIX] MCE: Fix bug of IA32_MCG_STATUS after system reset

2010-01-05 Thread Huang Ying
Hi, Avi, On Tue, 2010-01-05 at 18:50 +0800, Avi Kivity wrote: On 01/05/2010 10:34 AM, Huang Ying wrote: Now, if we inject a fatal MCE into guest OS, for example Linux, Linux will go panic and then reboot. But if we inject another MCE now, system will reset directly instead of go panic

[PATCH] Fix parameters of prctl

2009-12-15 Thread Huang Ying
Because kenrel prctl implementation checks whether arg4 and arg5 are 0 for PR_MCE_KILL, qmeu-kvm should invoke prctl syscall as that. Reported-by: Max Asbock masb...@linux.vnet.ibm.com Signed-off-by: Huang Ying ying.hu...@intel.com --- qemu-kvm.c |2 +- 1 file changed, 1 insertion(+), 1

Re: [PATCH -v4] QEMU-KVM: MCE: Relay UCR MCE to guest

2009-09-21 Thread Huang Ying
On Mon, 2009-09-21 at 18:08 +0800, Avi Kivity wrote: On 09/21/2009 05:43 AM, Huang Ying wrote: UCR (uncorrected recovery) MCE is supported in recent Intel CPUs, where some hardware error such as some memory error can be reported without PCC (processor context corrupted). To recover from

Re: [PATCH -v3] QEMU-KVM: MCE: Relay UCR MCE to guest

2009-09-20 Thread Huang Ying
On Sat, 2009-09-19 at 01:05 +0800, Marcelo Tosatti wrote: On Fri, Sep 18, 2009 at 03:58:59PM +0800, Huang Ying wrote: UCR (uncorrected recovery) MCE is supported in recent Intel CPUs, where some hardware error such as some memory error can be reported without PCC (processor context

[PATCH -v4] QEMU-KVM: MCE: Relay UCR MCE to guest

2009-09-20 Thread Huang Ying
. Thanks Anthony Liguori. Signed-off-by: Huang Ying ying.hu...@intel.com --- cpu-common.h |1 exec.c | 20 +++-- qemu-kvm.c | 195 +++ qemu-kvm.h |9 +- target-i386/cpu.h| 20 - target-i386

[PATCH -v3] QEMU-KVM: MCE: Relay UCR MCE to guest

2009-09-18 Thread Huang Ying
) will be broadcast to all VCPU threads as UCR MCE. v3: - Re-raise SIGBUS for SIGBUS not from MCE - Kill itself for error in kvm_inject_x86_mce v2: - Use qemu_ram_addr_from_host instead of self made one to covert from host address to guest RAM address. Thanks Anthony Liguori. Signed-off-by: Huang

Re: [PATCH -v2] QEMU-KVM: MCE: Relay UCR MCE to guest

2009-09-17 Thread Huang Ying
on non-MCE SIGBUS as usual? We discuss this before. Copied below, please comment the comments below, :) Avi: (also, I if we can't handle guest-mode SIGBUS I think it would be nice to raise it again so the process terminates due to the SIGBUS). Huang Ying: For SIGBUS we can

Re: [PATCH -v2] QEMU-KVM: MCE: Relay UCR MCE to guest

2009-09-16 Thread Huang Ying
On Thu, 2009-09-17 at 01:59 +0800, Marcelo Tosatti wrote: On Wed, Sep 09, 2009 at 10:28:02AM +0800, Huang Ying wrote: UCR (uncorrected recovery) MCE is supported in recent Intel CPUs, where some hardware error such as some memory error can be reported without PCC (processor context

Re: [PATCH -v2] QEMU-KVM: MCE: Relay UCR MCE to guest

2009-09-15 Thread Huang Ying
On Mon, 2009-09-14 at 13:10 +0800, Avi Kivity wrote: On 09/14/2009 05:55 AM, Huang Ying wrote: Hi, Avi, On Thu, 2009-09-10 at 17:35 +0800, Andi Kleen wrote: (also, I if we can't handle guest-mode SIGBUS I think it would be nice to raise it again so the process terminates due

Re: [PATCH -v2] QEMU-KVM: MCE: Relay UCR MCE to guest

2009-09-13 Thread Huang Ying
. and reported in a suitable way. Do you agree with us about SIGBUS processing? Best Regards, Huang Ying -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH] QEMU-KVM: MCE: Relay UCR MCE to guest

2009-09-08 Thread Huang Ying
On Tue, 2009-09-08 at 14:44 +0800, Avi Kivity wrote: On 09/07/2009 11:32 AM, Huang Ying wrote: UCR (uncorrected recovery) MCE is supported in recent Intel CPUs, where some hardware error such as some memory error can be reported without PCC (processor context corrupted). To recover from

Re: [PATCH] QEMU-KVM: MCE: Relay UCR MCE to guest

2009-09-08 Thread Huang Ying
structure. Yes, this is the current behavior. If MCE is caused by user mode accessing, the KVM will be killed by force_sig_info, only MCE caused by guest mode accessing will be captured by SIGBUS signal handler. Best Regards, Huang Ying -- To unsubscribe from this list: send the line unsubscribe kvm

[PATCH -v2] QEMU-KVM: MCE: Relay UCR MCE to guest

2009-09-08 Thread Huang Ying
) will be broadcast to all VCPU threads as UCR MCE. v2: - Use qemu_ram_addr_from_host instead of self made one to covert from host address to guest RAM address. Thanks Anthony Liguori. Signed-off-by: Huang Ying ying.hu...@intel.com --- cpu-common.h |1 exec.c| 20 +-- qemu

[PATCH] QEMU-KVM: MCE: Relay UCR MCE to guest

2009-09-07 Thread Huang Ying
) will be broadcast to all VCPU threads as UCR MCE. Signed-off-by: Huang Ying ying.hu...@intel.com --- qemu-kvm.c| 173 ++ target-i386/cpu.h | 20 +- 2 files changed, 181 insertions(+), 12 deletions(-) --- a/qemu-kvm.c +++ b/qemu-kvm.c

Re: [PATCH] QEMU-KVM: MCE: Relay UCR MCE to guest

2009-09-07 Thread Huang Ying
On Tue, 2009-09-08 at 04:48 +0800, Anthony Liguori wrote: Hi Huang, Huang Ying wrote: UCR (uncorrected recovery) MCE is supported in recent Intel CPUs, where some hardware error such as some memory error can be reported without PCC (processor context corrupted). To recover from such MCE

[PATCH -v6] QEMU-KVM: MCE: Add MCE simulation support to qemu/kvm

2009-07-15 Thread Huang Ying
: - Use new kernel MCE capability exportion interface. Signed-off-by: Huang Ying ying.hu...@intel.com --- kvm/include/linux/kvm.h | 20 kvm/include/x86/asm/kvm.h |1 libkvm-all.h |4 +++ qemu-kvm-x86.c| 55

  1   2   >