From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH] QEMU-KVM: MCE: Relay UCR MCE to guest Date: Tue, 08 Sep 2009 08:07:57 -0500 Message-ID: <4AA6572D.50203@us.ibm.com> References: <1252312353.14648.731.camel@yhuang-dev.sh.intel.com> <4AA57187.5020502@us.ibm.com> <1252388463.14648.975.camel@yhuang-dev.sh.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Avi Kivity , Andi Kleen , "kvm@vger.kernel.org" To: Huang Ying Return-path: Received: from e8.ny.us.ibm.com ([32.97.182.138]:35490 "EHLO e8.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752912AbZIHNH4 (ORCPT ); Tue, 8 Sep 2009 09:07:56 -0400 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e8.ny.us.ibm.com (8.14.3/8.13.1) with ESMTP id n88D7UTV010373 for ; Tue, 8 Sep 2009 09:07:30 -0400 Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id n88D7xpa237618 for ; Tue, 8 Sep 2009 09:07:59 -0400 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n88D7weY003428 for ; Tue, 8 Sep 2009 09:07:59 -0400 In-Reply-To: <1252388463.14648.975.camel@yhuang-dev.sh.intel.com> Sender: kvm-owner@vger.kernel.org List-ID: Huang Ying wrote: > I find there is already a function named qemu_ram_addr_from_host which > translate from user space virtual address into qemu RAM address. But I > need function to return a error code instead of abort in case of no RAM > address corresponding specified user space virtual address. So I plan to > use following code to deal with that. > > int do_qemu_ram_addr_from_host(void *ptr, ram_addr_t *ram_addr); > ram_addr_t qemu_ram_addr_from_host(void *ptr); > > Does this follow the coding style of qemu? > I don't like the do_ prefix much but I don't have a better suggestion. >> If the instruction gets skipped, we may be leaking host memory because >> the access never happened. >> > > There are two kinds of recoverable MCE named SRAO (Software Recoverable > Action Optional) and SRAR (Software Recoverable Action Required). For > your example, it is a SRAR error. Where kernel will munmap the error > page and send SIGBUS to qemu via force_sig_info, which will unblock > SIGBUS and reset its action to SIG_DFL, so qemu will be terminated. > > If the guest mode is interrupted, because signal mask processing of KVM > kernel part, SIGBUS can be captured by qemu. > Ah, I didn't realize this path just worked. -- Regards, Anthony Liguori