From patchwork Thu Oct 11 06:16:08 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: 10636123 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 6591017E3 for ; Thu, 11 Oct 2018 06:18:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4761D2B064 for ; Thu, 11 Oct 2018 06:18:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3B8792B067; Thu, 11 Oct 2018 06:18:09 +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 A1AC72B064 for ; Thu, 11 Oct 2018 06:18:08 +0000 (UTC) Received: from localhost ([::1]:60734 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gAUIR-0003wE-1G for patchwork-qemu-devel@patchwork.kernel.org; Thu, 11 Oct 2018 02:18:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36036) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gAUGy-0002vc-P1 for qemu-devel@nongnu.org; Thu, 11 Oct 2018 02:16:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gAUGw-00066q-K4 for qemu-devel@nongnu.org; Thu, 11 Oct 2018 02:16:36 -0400 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]:40916) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gAUGw-00064g-8A; Thu, 11 Oct 2018 02:16:34 -0400 Received: by mail-pf1-x443.google.com with SMTP id s5-v6so3850678pfj.7; Wed, 10 Oct 2018 23:16:27 -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=8DvEWBr3raUmeMqztewRolsc0gaRb6C8z/Qj+BYp3wg=; b=JLbunTSdu6scFKIOAEVNp0XNhAY0eYlarpHdmIIPKHxi4M/Hz0u2zdZawufmnmf5/3 OTJWCAMgqO6JQHP/n/kHTN9uDGAWbEv1zxIFbqSsY7FTGOeyG8AfYFfjIau2VdzL9ptA /JAXdJQuhRLhELOQo84WucdCvOHW/FWnoWkZcY/+9X3A/2s3R9QVdlSbbHC5iwMGNtFJ psj+qEXgjsLOxl/GqQF7Uw6fJ3Nsw9NTKag5M6wbnVK8Q1FJQgsiiEByZkMGAGllwCst 2DtmeGvNR+tl/ojieB/7dswCDl73ZC1Q0iGp/fMRhMoenSVgGffl0Lmzw6XIfkuXiFRx aHyQ== 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=8DvEWBr3raUmeMqztewRolsc0gaRb6C8z/Qj+BYp3wg=; b=FIJDNjUL8h5HY5KC6zSfoZqOVmkuPkHtwqp0tFg6N9IEGzjNYXjAUONUpMzjEM671I wKW8BI8c7lvygXoZh2JYz5OHATR+0NDjje1sOgABjcVErxya+smy4AcG8VCBynnA1I38 +UBW80u98XLssnJjI+oIOqz9Dp7nksPecQAxjFli/sfPNmtwBidqsFG0MNMypqc/gX/h hrR2oeuZJoTT4rXkspGxWoptdQ3+OQX1y6TmRj0PmdLry6HLwnkzS+10ly/M1XSIxIWH KvpoMhzdBXZAisrcQ7DI+iyOAd8L8Qfrzb2OnrXZXZ4K1v+93Zw5PGW5wYRg2pb1A0s8 i7kg== X-Gm-Message-State: ABuFfojuDeDFWPAwmPxm9fK1Ll21xAM3+1R6mYUTPZoCohpT8qJD67dc qpR6WOE4diOl2QoIYMAUn6ssh96C X-Google-Smtp-Source: ACcGV63j9+XUAuBGm3VjE0m/H9ueyDgmzL1ngxRm/xfjuypqIWhal9JcBxTseLrmrar2gQ9fMZzbxQ== X-Received: by 2002:a63:fd58:: with SMTP id m24-v6mr250760pgj.132.1539238586765; Wed, 10 Oct 2018 23:16:26 -0700 (PDT) Received: from localhost.home.majoof.com ([221.121.149.195]) by smtp.gmail.com with ESMTPSA id q24-v6sm35836189pfi.165.2018.10.10.23.16.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Oct 2018 23:16:26 -0700 (PDT) From: Suraj Jitindar Singh To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Date: Thu, 11 Oct 2018 17:16:08 +1100 Message-Id: <20181011061609.11423-3-sjitindarsingh@gmail.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20181011061609.11423-1-sjitindarsingh@gmail.com> References: <20181011061609.11423-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::443 Subject: [Qemu-devel] [QEMU-PPC] [PATCH V3 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, Suraj Jitindar Singh , david@gibson.dropbear.id.au 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 }