linux-mips
[Top] [All Lists]

Re: [PATCH v2 11/18] KVM/MIPS32: Routines to handle specific traps/excep

To: Gleb Natapov <gleb@redhat.com>
Subject: Re: [PATCH v2 11/18] KVM/MIPS32: Routines to handle specific traps/exceptions while executing the guest.
From: Sanjay Lal <sanjayl@kymasys.com>
Date: Fri, 15 Feb 2013 11:10:46 -0500
Cc: kvm@vger.kernel.org, linux-mips@linux-mips.org
In-reply-to: <20130206132018.GC7837@redhat.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
References: <1353551656-23579-1-git-send-email-sanjayl@kymasys.com> <1353551656-23579-12-git-send-email-sanjayl@kymasys.com> <20130206132018.GC7837@redhat.com>
Sender: linux-mips-bounce@linux-mips.org
On Feb 6, 2013, at 8:20 AM, Gleb Natapov wrote:

> On Wed, Nov 21, 2012 at 06:34:09PM -0800, Sanjay Lal wrote:
>> +static gpa_t kvm_trap_emul_gva_to_gpa_cb(gva_t gva)
>> +{
>> +    gpa_t gpa;
>> +    uint32_t kseg = KSEGX(gva);
>> +
>> +    if ((kseg == CKSEG0) || (kseg == CKSEG1))
> You seems to be using KVM_GUEST_KSEGX variants on gva in all other
> places. Why not here?

This function is invoked to handle 2 scenarios:
(1) Parse the boot code config tables setup by QEMU's Malta emulation. The 
pointers in the tables are actual KSEG0 addresses (unmapped, cached) and not 
Guest KSEG0 addresses.

(2) Handle I/O accesses by the guest.  On MIPS platforms, I/O device registers 
are mapped into the KSEG1 address space (unmapped, uncached).  Again like (1) 
these are actual KSEG1 addresses, which cause an exception and are passed onto 
QEMU for I/O emulation.

Regards
Sanjay


<Prev in Thread] Current Thread [Next in Thread>