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

2010-11-15 Thread Andi Kleen
The issue of d) is that there are multiple ways to inject MCE. Now one software based, one APEI based, and maybe some others in the future. They all use different interfaces. And as debug interface, there are not considered kernel ABI too (some are in debugfs). So I think it is better to use

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

2010-11-14 Thread Avi Kivity
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 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-14 Thread Avi Kivity
On 11/14/2010 01:08 PM, Avi Kivity wrote: 4) Use -mempath on /dev/shm and poison a page in the backing file If we can poison a page in the backing file, how do we know the corresponding gpa and hpa? I think you currently can't know it's gpa (why do you want to?); the upcoming NUMA

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 Avi Kivity
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? Video RAM in the range a-b and PCI mapped RAM can

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
On Wed, 2010-11-10 at 14:56 +0800, Avi Kivity wrote: On 11/08/2010 05:39 AM, Anthony Liguori wrote: Yes. The main usage of the interface is automated testing. That's precisely what the command should not be used for. You can't assume a gpa - hva mapping is consistent in an external

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

2010-11-10 Thread Avi Kivity
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 is automated testing. That's precisely what the command

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 is

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

2010-11-10 Thread Avi Kivity
On 11/10/2010 10:38 AM, Huang Ying wrote: If we get a full address (rather than just a frame number) then we can identify the 4k page and send an mce just for that frame? We need host kernel to break down the 2M huge page into 4k pages. Then send SIGBUS to QEMU with the poisoned 4k page.

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

2010-11-10 Thread Avi Kivity
On 11/10/2010 10:21 AM, Huang Ying wrote: On Wed, 2010-11-10 at 14:56 +0800, Avi Kivity wrote: On 11/08/2010 05:39 AM, Anthony Liguori wrote: Yes. The main usage of the interface is automated testing. That's precisely what the command should not be used for. You can't assume

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

2010-11-10 Thread Andi Kleen
We need host kernel to break down the 2M huge page into 4k pages. Then send SIGBUS to QEMU with the poisoned 4k page. Because host kernel will poison the whole 2M virtual address space otherwise, and other 4k pages inside the 2M page can not used accessed in guest (will trigger SIGBUS and

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

2010-11-10 Thread Anthony Liguori
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? Video RAM in the range a-b and PCI mapped RAM can change gpas (while remaining in the same hva). Even for ordinary RAM, which doesn't normally change gpa/hva, I'm

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

2010-11-10 Thread Avi Kivity
On 11/10/2010 06:42 PM, Andi Kleen wrote: We need host kernel to break down the 2M huge page into 4k pages. Then send SIGBUS to QEMU with the poisoned 4k page. Because host kernel will poison the whole 2M virtual address space otherwise, and other 4k pages inside the 2M page can not used

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

2010-11-10 Thread Andi Kleen
Doing it in userspace in easier, since we can replace the vma for that section (and avoid mixed 4k/2M pages in hugetlbfs). You can't do that today, there's no way currently to access the non corrupted portion of the 2MB page. Once it's poisoned it's all gone. -Andi -- a...@linux.intel.com --

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

2010-11-10 Thread Avi Kivity
On 11/10/2010 07:44 PM, Andi Kleen wrote: Doing it in userspace in easier, since we can replace the vma for that section (and avoid mixed 4k/2M pages in hugetlbfs). You can't do that today, there's no way currently to access the non corrupted portion of the 2MB page. Once it's poisoned it's

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

2010-11-10 Thread Andi Kleen
On Wed, Nov 10, 2010 at 07:47:11PM +0200, Avi Kivity wrote: On 11/10/2010 07:44 PM, Andi Kleen wrote: Doing it in userspace in easier, since we can replace the vma for that section (and avoid mixed 4k/2M pages in hugetlbfs). You can't do that today, there's no way currently to access the

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

2010-11-10 Thread Avi Kivity
On 11/10/2010 09:16 PM, Andi Kleen wrote: On Wed, Nov 10, 2010 at 07:47:11PM +0200, Avi Kivity wrote: On 11/10/2010 07:44 PM, Andi Kleen wrote: Doing it in userspace in easier, since we can replace the vma for that section (and avoid mixed 4k/2M pages in hugetlbfs). You can't do

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

2010-11-10 Thread Huang Ying
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? Video RAM in the range a-b and PCI mapped RAM can change gpas (while remaining in the same hva).

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

2010-11-09 Thread Avi Kivity
On 11/08/2010 05:39 AM, Anthony Liguori wrote: Yes. The main usage of the interface is automated testing. That's precisely what the command should not be used for. You can't assume a gpa - hva mapping is consistent in an external application. If you want to implement an interface for

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

2010-11-09 Thread Avi Kivity
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 is automated testing. That's precisely what the command should not be used for. You can't assume a gpa - hva mapping is consistent in an external application. If

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

2010-11-09 Thread Huang Ying
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 is automated testing. That's precisely what the command should not be used for. You can't assume a gpa -

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

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-07 Thread Anthony Liguori
On 11/06/2010 11:24 AM, 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 only interface?

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

2010-11-07 Thread Anthony Liguori
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 interface, it may not work so well, but as test interface, it works quite

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

2010-11-06 Thread Avi Kivity
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 only interface? I'd like to see what Luiz/Markus think

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

2010-11-04 Thread Luiz Capitulino
On Mon, 01 Nov 2010 14:22:21 -0500 Anthony Liguori aligu...@linux.vnet.ibm.com 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 only

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

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

2010-11-01 Thread Anthony Liguori
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 only interface? I'd like to see what Luiz/Markus think but definitely only a human monitor interface

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

2010-10-25 Thread Huang Ying
Author: Max Asbock masb...@linux.vnet.ibm.com Add command pfa2hva to translate guest physical address to host virtual address. The pfa2hva command provides one step in a chain of translations from guest virtual to guest physical to host virtual to host physical. Host physical is then used to