From patchwork Mon Oct 8 03:25:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suraj Jitindar Singh X-Patchwork-Id: 10629947 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 420F614DB for ; Mon, 8 Oct 2018 03:39:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3124128A72 for ; Mon, 8 Oct 2018 03:39:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 237C828A77; Mon, 8 Oct 2018 03:39:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CB43728A72 for ; Mon, 8 Oct 2018 03:39:22 +0000 (UTC) Received: from localhost ([::1]:44334 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g9MOA-0005GT-3U for patchwork-qemu-devel@patchwork.kernel.org; Sun, 07 Oct 2018 23:39:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34814) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g9MML-0003ev-52 for qemu-devel@nongnu.org; Sun, 07 Oct 2018 23:37:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g9MBI-0008Gg-VG for qemu-devel@nongnu.org; Sun, 07 Oct 2018 23:26:05 -0400 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]:43351) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g9MBI-0008G4-OW; Sun, 07 Oct 2018 23:26:04 -0400 Received: by mail-pg1-x542.google.com with SMTP id 80-v6so7164390pgh.10; Sun, 07 Oct 2018 20:26:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=f2INdkO7MoW75h/pQx3+DaibNBhHxNEIGJfW37c9xJk=; b=sbb4A80m2gOj53suDQ8qBuv7zI/Nag4MRgtCKvFee9Dm0rxzJulZ7IPF3hPEWVxhSF IAR7fIcmWav8PaN5nAFbi0b1paAH5NCPIC42SF9ipWl0DZwBxYi5ZsqjHUhJPg70FpHv kMSDda4pW+daTr9fzT6cvBD7MtiA96sBlQS7BS59SR3A646dNXtGL11R/GdysyxJUQMA Mr1MaM8NPwhukgK0Sv5C1OS458Fo6bf7EEU/IuCN0lor94nRMFDfIlUs7WCw0XwsbHSV rc/XOFwjB5FZ+B2PVdFiLhPbxoNhDPiLjyZBB+e7K9lYXC58bNU+uCHmsQwKPD87HU9u wpjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=f2INdkO7MoW75h/pQx3+DaibNBhHxNEIGJfW37c9xJk=; b=cH7TkBcE/kBrcJOQVSkxAYhhqVOCVo/2F5yRgXBmV781XiYROKp5WKPZ+RK1CW3ASB npC9Tw6M2QpX2PAzCX2NR42WruVcI1Hwc5cseElVAOjXd9p53YzIX6oMp8XcGBLcfgR5 5GEr3NYGk/rXdJgBYo8Cg7iLApE68gEs6p7gnY20h5229wAYvzNPSUbGLZXxUXREExFM CUSDrPiSRpHLAEPErgEzPGb8IQ9scZYt+42fDdi4NJc6NtZzCdox8G0Peh4qDSWueMsr 1AhOJnzNLs8rYm0h0r16tsVnqAboEdshxsP4r/3m4dx6fGsjppP7kLGwlYhKssLhHHTx Vx4g== X-Gm-Message-State: ABuFfoiHaOaRuheTgdRBvr7p1I1ks6QBpEgxJQc5HckpsAdND5o1oOPF K9KQkNg9b+m+xqG7N0e6Z+0= X-Google-Smtp-Source: ACcGV60euLD8YSrbOBC6ohckynvBU02BFLGLml8DTsaUOFQ6+RYUTFwwU6+hXydHXJV2Z5tQCcXdTw== X-Received: by 2002:a62:9ec7:: with SMTP id f68-v6mr23564320pfk.206.1538969163947; Sun, 07 Oct 2018 20:26:03 -0700 (PDT) Received: from surajjs2.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id o2-v6sm15516600pgp.65.2018.10.07.20.26.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 07 Oct 2018 20:26:03 -0700 (PDT) From: Suraj Jitindar Singh To: david@gibson.dropbear.id.au Date: Mon, 8 Oct 2018 14:25:38 +1100 Message-Id: <20181008032539.6437-3-sjitindarsingh@gmail.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20181008032539.6437-1-sjitindarsingh@gmail.com> References: <20181008032539.6437-1-sjitindarsingh@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::542 Subject: [Qemu-devel] [QEMU-PPC] [PATCH V2 2/3] target/ppc: Add one reg id for ptcr X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: paulus@ozlabs.org, qemu-ppc@nongnu.org, qemu-devel@nongnu.org, sjitindarsingh@gmail.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The ptcr (partition table control register) is used to store the address and size of the partition table. For nested kvm-hv we have a level 1 guest register the location of it's partition table with the hypervisor. Thus to support migration we need to be able to read this out of kvm and restore it post migration. Add the one reg id for the ptcr. Signed-off-by: Suraj Jitindar Singh Reviewed-by: David Gibson --- target/ppc/translate_init.inc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/target/ppc/translate_init.inc.c b/target/ppc/translate_init.inc.c index 263e63cb03..487196800b 100644 --- a/target/ppc/translate_init.inc.c +++ b/target/ppc/translate_init.inc.c @@ -8197,11 +8197,11 @@ static void gen_spr_power9_mmu(CPUPPCState *env) { #if !defined(CONFIG_USER_ONLY) /* Partition Table Control */ - spr_register_hv(env, SPR_PTCR, "PTCR", - SPR_NOACCESS, SPR_NOACCESS, - SPR_NOACCESS, SPR_NOACCESS, - &spr_read_generic, &spr_write_ptcr, - 0x00000000); + spr_register_kvm_hv(env, SPR_PTCR, "PTCR", + SPR_NOACCESS, SPR_NOACCESS, + SPR_NOACCESS, SPR_NOACCESS, + &spr_read_generic, &spr_write_ptcr, + KVM_REG_PPC_PTCR, 0x00000000); #endif }