From mboxrd@z Thu Jan 1 00:00:00 1970 Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 21 May 2013 18:21:31 +0200 (CEST) Received: from co9ehsobe004.messaging.microsoft.com ([207.46.163.27]:19585 "EHLO co9outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org with ESMTP id S6824104Ab3EUQV1HQGIN (ORCPT ); Tue, 21 May 2013 18:21:27 +0200 Received: from mail149-co9-R.bigfish.com (10.236.132.241) by CO9EHSOBE024.bigfish.com (10.236.130.87) with Microsoft SMTP Server id 14.1.225.23; Tue, 21 May 2013 16:21:19 +0000 Received: from mail149-co9 (localhost [127.0.0.1]) by mail149-co9-R.bigfish.com (Postfix) with ESMTP id A0C56804F3; Tue, 21 May 2013 16:21:19 +0000 (UTC) X-Forefront-Antispam-Report: CIP:132.245.2.69;KIP:(null);UIP:(null);IPV:NLI;H:BN1PRD0712HT003.namprd07.prod.outlook.com;RD:none;EFVD:NLI X-SpamScore: -1 X-BigFish: PS-1(z37d5kzbb2dI98dI9371I1432Izz1f42h1ee6h1de0h1fdah1202h1e76h1d1ah1d2ah1fc6hzz8275bhz2dh2a8h668h839h947hd25he5bhf0ah1288h12a5h12a9h12bdh137ah13b6h1441h14ddh1504h1537h153bh162dh1631h1758h1765h18e1h190ch1946h19b4h19c3h19ceh1ad9h1b0ah1d0ch1d2eh1d3fh1155h) Received: from mail149-co9 (localhost.localdomain [127.0.0.1]) by mail149-co9 (MessageSwitch) id 1369153276813321_27914; Tue, 21 May 2013 16:21:16 +0000 (UTC) Received: from CO9EHSMHS028.bigfish.com (unknown [10.236.132.251]) by mail149-co9.bigfish.com (Postfix) with ESMTP id C37AD220060; Tue, 21 May 2013 16:21:16 +0000 (UTC) Received: from BN1PRD0712HT003.namprd07.prod.outlook.com (132.245.2.69) by CO9EHSMHS028.bigfish.com (10.236.130.38) with Microsoft SMTP Server (TLS) id 14.1.225.23; Tue, 21 May 2013 16:21:14 +0000 Received: from dl.caveonetworks.com (64.2.3.195) by pod51018.outlook.com (10.255.196.36) with Microsoft SMTP Server (TLS) id 14.16.311.1; Tue, 21 May 2013 16:21:09 +0000 Message-ID: <519B9EF2.8020107@caviumnetworks.com> Date: Tue, 21 May 2013 09:21:06 -0700 From: David Daney User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4 MIME-Version: 1.0 To: Gleb Natapov CC: David Daney , , , , Sanjay Lal , , David Daney Subject: Re: [PATCH v3 5/5] mips/kvm: Fix ABI by moving manipulation of CP0 registers to KVM_{G,S}ET_MSRS References: <1369083686-27524-1-git-send-email-ddaney.cavm@gmail.com> <1369083686-27524-6-git-send-email-ddaney.cavm@gmail.com> <20130521153752.GD14287@redhat.com> In-Reply-To: <20130521153752.GD14287@redhat.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [64.2.3.195] X-OriginatorOrg: caviumnetworks.com Return-Path: X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0) X-Orcpt: rfc822;linux-mips@linux-mips.org Original-Recipient: rfc822;linux-mips@linux-mips.org X-archive-position: 36503 X-ecartis-version: Ecartis v1.0.0 Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org X-original-sender: ddaney@caviumnetworks.com Precedence: bulk List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: linux-mips X-List-ID: linux-mips List-subscribe: List-owner: List-post: List-archive: X-list: linux-mips On 05/21/2013 08:37 AM, Gleb Natapov wrote: > On Mon, May 20, 2013 at 02:01:26PM -0700, David Daney wrote: >> From: David Daney >> >> Because not all 256 CP0 registers are ever implemented, we need a >> different method of manipulating them. Use the >> KVM_GET_MSRS/KVM_SET_MSRS mechanism as x86 does for its MSRs. >> > Have you looked at KVM_(GET|SET)_ONE_REG interface (not used by x86, but is > used bu arm/ppc/s390). It looks like it is more suitable for your case. > Actually you can use it instead of KVM_(GET|SET)_REGS for all registers. Yes, I suppose it could be used. One problem it has is that there is no way to query the set of supported registers. Also you have to make multiple calls to set multiple registers, which involves vcpu_{load,put} for each register. We will definitely implement it for all the FP and General Purpose registers. > >> Code related to implementing KVM_GET_MSRS/KVM_SET_MSRS is consolidated From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from co9ehsobe004.messaging.microsoft.com ([207.46.163.27]:19585 "EHLO co9outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org with ESMTP id S6824104Ab3EUQV1HQGIN (ORCPT ); Tue, 21 May 2013 18:21:27 +0200 Message-ID: <519B9EF2.8020107@caviumnetworks.com> Date: Tue, 21 May 2013 09:21:06 -0700 From: David Daney MIME-Version: 1.0 Subject: Re: [PATCH v3 5/5] mips/kvm: Fix ABI by moving manipulation of CP0 registers to KVM_{G,S}ET_MSRS References: <1369083686-27524-1-git-send-email-ddaney.cavm@gmail.com> <1369083686-27524-6-git-send-email-ddaney.cavm@gmail.com> <20130521153752.GD14287@redhat.com> In-Reply-To: <20130521153752.GD14287@redhat.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Return-Path: Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-subscribe: List-owner: List-post: List-archive: To: Gleb Natapov Cc: David Daney , linux-mips@linux-mips.org, ralf@linux-mips.org, kvm@vger.kernel.org, Sanjay Lal , linux-kernel@vger.kernel.org, David Daney Message-ID: <20130521162106.MOPwzbmLW3UEwTlWDy-rHefG7ZHwK8aOfIDg10RrQlo@z> On 05/21/2013 08:37 AM, Gleb Natapov wrote: > On Mon, May 20, 2013 at 02:01:26PM -0700, David Daney wrote: >> From: David Daney >> >> Because not all 256 CP0 registers are ever implemented, we need a >> different method of manipulating them. Use the >> KVM_GET_MSRS/KVM_SET_MSRS mechanism as x86 does for its MSRs. >> > Have you looked at KVM_(GET|SET)_ONE_REG interface (not used by x86, but is > used bu arm/ppc/s390). It looks like it is more suitable for your case. > Actually you can use it instead of KVM_(GET|SET)_REGS for all registers. Yes, I suppose it could be used. One problem it has is that there is no way to query the set of supported registers. Also you have to make multiple calls to set multiple registers, which involves vcpu_{load,put} for each register. We will definitely implement it for all the FP and General Purpose registers. > >> Code related to implementing KVM_GET_MSRS/KVM_SET_MSRS is consolidated