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,

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(); > >>> } > >>>

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 fur

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

2011-02-08 Thread Huang Ying
new page to recover the issue. Signed-off-by: Huang Ying --- 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 return ret

[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 --- cpu-all.h|4

[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 CC: Andrew Morton CC: Michel Lespinasse CC: Roland Dreier CC: Ralph Campbell --- drivers/infiniband/hw/ipath/ipath_user_pages.c |6 +-- drivers/infiniband/hw/qib

[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 --- include/linux/mm.h |8

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

2011-01-29 Thread Huang Ying
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 Cc: Andrew Morton --- include/asm-generic/errno.h |2

[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 uns

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: >

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 > >> > >> This case is a pure user space error we do not need to record. Moreover,

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) &

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

2011-01-16 Thread Huang Ying
dware 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 Ying

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 -EHWPO

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 fur

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 fr

Re: [Qemu-devel] [PATCH uq/master 1/2] Add qemu_ram_remap

2011-01-13 Thread Huang Ying
On Fri, 2011-01-14 at 05:14 +0800, Blue Swirl wrote: > On Thu, Jan 13, 2011 at 8:34 AM, Huang Ying wrote: > > 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 acros

[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 Cc: Andrew Morton --- include/asm-generic/errno.h |2 + include/linux/mm.h | 17 + mm/memory.c | 55 +--- 3 files changed, 71 insertions(+), 3 deletions(-) --- a/include

[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 --- include

[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 --- cpu-all.h|4

[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 --- 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 kvm_get_supported_msrs(void

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 > >> > >> There is no need to restrict writing back MCE MSRs to reset or full > >&

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 fur

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

2011-01-04 Thread Huang Ying
G_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 > CC: Huang Yi

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

2010-12-30 Thread Huang Ying
new page to recover the issue. Signed-off-by: Huang Ying --- 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 +1803,7 @@ int

[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 --- cpu-all.h|4

Re: QEMU, MCE, unpoison memory address across reboot

2010-12-28 Thread Huang Ying
gt; > >> +} > > > > > > > >Can't you free and reallocate all guest memory instead, on reboot, if > > > >there's a hwpoisoned page? Then you don't need this interface. > > > > > > > > > > Alternatively, MADV_DONTNEED

Re: QEMU, MCE, unpoison memory address across reboot

2010-12-28 Thread Huang Ying
DONTNEED? We already use it for ballooning. > > > > Does not work for hugetlbfs. > > > > True. We can munmap() the page (extending it to the huge page size in > effect), and then mmap() it back in. The kernel should merge the new > vma with its ne

Re: QEMU, MCE, unpoison memory address across reboot

2010-12-27 Thread Huang Ying
_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: 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: QEMU, MCE, unpoison memory address across reboot

2010-12-23 Thread Huang Ying
need a flag in struct 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

Re: QEMU, MCE, unpoison memory address across reboot

2010-12-23 Thread Huang Ying
lly save a lot > of memory if the new 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 "

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 wrote: > > > Make __get_user_pages return -EHWPOISON for HWPOISON page only if > > FOLL_HWPOISON is specified. With this patch, t

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

2010-12-21 Thread Huang Ying
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

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 --- kvm.h |2 ++ kvm/include/linux/kvm.h |2 ++ qemu-kvm.c | 40 target-i386/kvm.c |2 ++ 4 files changed, 46

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

2010-12-21 Thread Huang Ying
address 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 --- include/linux/kvm.h |1 + inc

[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 Cc: Andrew Morton --- include/asm-generic/errno.h |2 + include/linux/mm.h |5 mm/memory.c | 53 +--- 3 files changed, 57 insertions(+), 3 deletions(-) --- a/include/asm-generic

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

2010-11-30 Thread Huang Ying
fprintf(stderr, "Current CPU does not support broadcast\n"); > +return; > +} > +} > + > if (kvm_enabled()) { > if (broadcast) > flag |= 0x02; /* bit 1: 1(broadcast); 0(not broadcast) */ Why not wrap this into a fun

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

2010-11-24 Thread Huang Ying
Check registers not cleared? I have had a test case before that injects another MCE when MCIP in MCGSTATUS is set to check whether system will go reset. It may be better to clear MC registers in an explicit 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] 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

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

2010-11-24 Thread Huang Ying
= > "cpu_index:i,bank:i,status:l,mcg_status:l,addr:l,misc:l", > .params = "cpu bank status mcgstatus addr misc", > .help = "inject a MCE on the given CPU", > +#endif Broadcast can not be used by QEMU-TCG? [...] Bes

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

2010-11-24 Thread Huang Ying
sting? If it is, why not use full reboot? MCE 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 Mo

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 > > 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-gpa

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

2010-11-15 Thread Huang Ying
support Signed-off-by: Max Asbock Signed-off-by: Jiajia Zheng Signed-off-by: Huang Ying --- hmp-commands.hx | 15 +++ monitor.c | 22 ++ 2 files changed, 37 insertions(+) --- a/monitor.c +++ b/monitor.c @@ -2272,6 +2272,28 @@ static void do_inject_mce

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 wrot

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 >

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

2010-11-10 Thread Huang Ying
nvironment (normal memory, without hot-remove, maybe only on x86). 2) Find some way to lock the gpa -> hva mapping 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?

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: > >

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

2010-11-10 Thread Huang Ying
y stupid question. Why the gpa -> hva mapping is not consistent for RAM if -mempath 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-09 Thread Huang Ying
y 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 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-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: > >> > >>

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: > >> > >>

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 usefu

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 Asbock > >> > >> Add command pfa2hva to translate guest phy

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

2010-10-25 Thread Huang Ying
. 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 Signed-off-by: Jiajia Zheng Signed-off-by: Huang Ying --- hmp-commands.hx | 15 +++ monitor.c | 22

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

2010-10-14 Thread Huang Ying
; One problem here is that SRAR is not broadcasted. > The guest might observe the event differently, like "some cpus > don't enter machine check." Yes. SRAR "Broadcast" follows spec better. 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 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 > > s

[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 Signed-off-by: Huang Ying --- arch/x86/kvm/x86.c |2 +- 1 file changed, 1 insertion

[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 Signed-off-by: Huang Ying --- arch/x86

[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 Signed-off-by: Huang Ying --- qemu-kvm.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a

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

2010-10-07 Thread Huang Ying
d of being sent via touching poisoned virtual address. > > I would think that if the the bad page can't be sidelined, such that > > the newly booting guest can't use it, then the new guest shouldn't be > > allowed to boot. But perhaps there is some merit in letting it

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

2010-10-07 Thread Huang Ying
ives 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 -- 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] Monitor command to translate guest physical address to host virtual address

2010-09-30 Thread Huang Ying
consequence the HWPOISON code on the host and the MCE injection code in qemu-kvm are exercised. Signed-off-by: Max Asbock Signed-off-by: Jiajia Zheng Signed-off-by: Huang Ying --- monitor.c | 11 +++ qemu-monitor.hx | 13 + 2 files changed, 24 insertions(+) --- a

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

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

2010-09-18 Thread Huang Ying
: Huang Ying --- 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 if (first_cpu->mcg_cap &&a

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

2010-07-11 Thread Huang Ying
e'll > need to add bank support). I think there's no problem clearing _CTL on > reset. If there is, we can patch qemu not to clear the MSR. Is that > acceptable? Yes. At least for Linux that is OK. Don't know whether Windows will set _CTL during boot. Best Regards

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

2010-07-08 Thread Huang Ying
On Thu, 2010-07-08 at 16:16 +0800, Avi Kivity wrote: > On 07/08/2010 11:03 AM, Huang Ying wrote: > > On Thu, 2010-07-08 at 15:43 +0800, Avi Kivity wrote: > > > >> On 07/08/2010 05:07 AM, Huang Ying wrote: > >> > >>&g

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, > >> > &

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

2010-07-07 Thread Huang Ying
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 MSR_IA32_MCG_CTL. > }; > > static int set_efer(struct kvm_vcpu *vcpu, u64 efer) Best Regards, Huang Ying

[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 Signed-off-by: Huang Ying --- mm/

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

2010-06-16 Thread huang ying
hva_to_pfn_atomic(), 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-30 Thread Huang Ying
pmd_large address. v2: - Use page table walker to determine whether the virtual 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 Signed-off-by: Huang

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

2010-05-17 Thread Huang Ying
pmd_large address. v2: - Use page table walker to determine whether the virtual 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 Signed-off-by: Huang

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_

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

2010-05-11 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 Signed-off-by: Huang Ying --- arch/x86/kvm/mmu.c | 34

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

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

2010-04-28 Thread Huang Ying
On Thu, 2010-04-29 at 00:33 +0800, Avi Kivity wrote: > On 04/28/2010 09:08 AM, Huang Ying wrote: > > > > There is some test script and document for this in: > > > > git://git.kernel.org/pub/scm/utils/cpu/mce/mce-test.git > > > > test script is in "kv

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

2010-04-27 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 r

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) > >

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) > &g

[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 --- 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(&qemu_work_

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

2010-03-03 Thread Huang Ying
framework. Signed-off-by: Huang Ying --- 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: env

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. > > >

[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 --- qemu-kvm-x86.c | 43

Add savevm/loadvm support for MCE

2010-02-25 Thread Huang Ying
o 0 after saving. Signed-off-by: Huang Ying --- 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 * DESC_AV

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

2010-01-06 Thread Huang Ying
dler. But I will try to check the real hardware behavior. 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: [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, > >>>

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 d

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

2010-01-05 Thread Huang Ying
real hardware. This patch fixes this via set IA32_MCG_STATUS to 0 during system reset. Signed-off-by: Huang Ying --- 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) #endif

[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 Signed-off-by: Huang Ying --- qemu-kvm.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/qemu-kvm.c +++ b/qemu-kvm.c

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 c

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

2009-09-20 Thread Huang Ying
. Thanks Anthony Liguori. Signed-off-by: Huang Ying --- cpu-common.h |1 exec.c | 20 +++-- qemu-kvm.c | 195 +++ qemu-kvm.h |9 +- target-i386/cpu.h| 20 - target-i386/helper.c |2 6

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 P

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

2009-09-18 Thread Huang Ying
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
gt; (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 not relay to guest as MCE, we can either abort or > > reset SIGBUS to SIGDFL

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 P

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

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

2009-09-13 Thread Huang Ying
; bug. Ideally a error message in a way that it can be parsed by libvirt etc. > 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 major

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

2009-09-09 Thread Huang Ying
ll). For UCR MCE caused by user space read/write, SIGBUS will be sent via force_sig_info. For guest mode qemu, SIGBUS will be captured, and for user mode qemu, SIGBUS will kill qemu. 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] QEMU-KVM: MCE: Relay UCR MCE to guest

2009-09-09 Thread Huang Ying
process terminates due to the SIGBUS). For SIGBUS we can not relay to guest as MCE, we can either abort or reset SIGBUS to SIGDFL and re-raise it. Both are OK for me. You prefer the latter one? 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

  1   2   >