From patchwork Mon Dec 22 09:04:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: PranavkumarSawargaonkar X-Patchwork-Id: 42508 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 604B325BA1 for ; Mon, 22 Dec 2014 09:08:20 +0000 (UTC) Received: by mail-la0-f72.google.com with SMTP id gq15sf2622247lab.3 for ; Mon, 22 Dec 2014 01:08:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=kppVCiIz2ZaJSTB9wIPxIPFZ+g5zvBGX9WtRzO/bNnM=; b=Mnp2bKwdjL6+3hMRyy8m0H0AaipqPtn626cqWWJw6K+SofilwxhcmYjrC692/8rXtP AgZQCLaTkVCuvElbyp+2uxSFfp6elOeVrVSAlogudoAAA00Ip3+P/UqZGoj+yU2V9Az2 rqM2rg/G1NRlP0d1W43CbMeZ1BE5aksnz6M4yUCWMzTuq725pTjSAgsVtuVPH6agQlkh l3t4jfectjP97DWIK8nSCCxC+DeOIyuTMLjTYmrDXSOaWMPPaz9O5DtPDii4fqyyC/Hl GFafONZk/2hxZwbK4KN7nioi2z2SGO07otDOcRO4EhbdheobhWYVwJUaTJ43f+d9c8hF 1jkw== X-Gm-Message-State: ALoCoQnntlm3tMGjaB0hkHZLU3r2dOLQLxgHgV5lnlTyRxXgUxWwB9aUrYjh3A1BWg43clOwGJLR X-Received: by 10.180.89.140 with SMTP id bo12mr1966797wib.6.1419239299354; Mon, 22 Dec 2014 01:08:19 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.99 with SMTP id s3ls1289634lag.79.gmail; Mon, 22 Dec 2014 01:08:19 -0800 (PST) X-Received: by 10.112.204.233 with SMTP id lb9mr21063720lbc.43.1419239299126; Mon, 22 Dec 2014 01:08:19 -0800 (PST) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com. [209.85.215.46]) by mx.google.com with ESMTPS id w8si6627565lal.81.2014.12.22.01.08.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Dec 2014 01:08:19 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by mail-la0-f46.google.com with SMTP id q1so3614685lam.5 for ; Mon, 22 Dec 2014 01:08:19 -0800 (PST) X-Received: by 10.152.234.35 with SMTP id ub3mr21057951lac.70.1419239299008; Mon, 22 Dec 2014 01:08:19 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.142.69 with SMTP id ru5csp964274lbb; Mon, 22 Dec 2014 01:08:18 -0800 (PST) X-Received: by 10.229.104.199 with SMTP id q7mr34400126qco.8.1419239297739; Mon, 22 Dec 2014 01:08:17 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id v91si12860196qge.81.2014.12.22.01.08.17 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 22 Dec 2014 01:08:17 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:39702 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y2yyO-0005eZ-NX for patch@linaro.org; Mon, 22 Dec 2014 04:08:16 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45125) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y2yvr-0001ec-F2 for qemu-devel@nongnu.org; Mon, 22 Dec 2014 04:05:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y2yvl-0001as-Gg for qemu-devel@nongnu.org; Mon, 22 Dec 2014 04:05:39 -0500 Received: from mail-pa0-f43.google.com ([209.85.220.43]:54826) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y2yvl-0001am-8b for qemu-devel@nongnu.org; Mon, 22 Dec 2014 04:05:33 -0500 Received: by mail-pa0-f43.google.com with SMTP id kx10so5580261pab.2 for ; Mon, 22 Dec 2014 01:05:32 -0800 (PST) X-Received: by 10.70.128.15 with SMTP id nk15mr32775304pdb.121.1419239131471; Mon, 22 Dec 2014 01:05:31 -0800 (PST) Received: from pnqlab006.amcc.com ([182.73.239.130]) by mx.google.com with ESMTPSA id ly9sm2305423pdb.45.2014.12.22.01.05.27 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Dec 2014 01:05:30 -0800 (PST) From: Pranavkumar Sawargaonkar To: qemu-devel@nongnu.org Date: Mon, 22 Dec 2014 14:34:56 +0530 Message-Id: <1419239097-14758-2-git-send-email-pranavkumar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1419239097-14758-1-git-send-email-pranavkumar@linaro.org> References: <1419239097-14758-1-git-send-email-pranavkumar@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.220.43 Cc: peter.maydell@linaro.org, patches@apm.com, alex.bennee@linaro.org, kvmarm@lists.cs.columbia.edu, christoffer.dall@linaro.org, Pranavkumar Sawargaonkar Subject: [Qemu-devel] [PATCH V2 1/2] target-arm: KVM64: Get and Sync up guest register state like kvm32. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: pranavkumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 This patch adds: 1. Call write_kvmstate_to_list() and write_list_to_cpustate() in kvm_arch_get_registers() to sync guest register state. 2. Call write_list_to_kvmstate() in kvm_arch_put_registers() to sync guest register state. These changes are already there for kvm32 in target-arm/kvm32.c. Signed-off-by: Pranavkumar Sawargaonkar Reviewed-by: Peter Maydell --- target-arm/kvm64.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/target-arm/kvm64.c b/target-arm/kvm64.c index ba16821..96148c6 100644 --- a/target-arm/kvm64.c +++ b/target-arm/kvm64.c @@ -193,6 +193,10 @@ int kvm_arch_put_registers(CPUState *cs, int level) } } + if (!write_list_to_kvmstate(cpu)) { + return EINVAL; + } + /* TODO: * FP state * system registers @@ -269,6 +273,14 @@ int kvm_arch_get_registers(CPUState *cs) } } + if (!write_kvmstate_to_list(cpu)) { + return EINVAL; + } + /* Note that it's OK to have registers which aren't in CPUState, + * so we can ignore a failure return here. + */ + write_list_to_cpustate(cpu); + /* TODO: other registers */ return ret; }