From nobody Mon Feb 9 23:01:14 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1511497519677204.01326631862526; Thu, 23 Nov 2017 20:25:19 -0800 (PST) Received: from localhost ([::1]:47196 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eI5Y5-00034T-CQ for importer@patchew.org; Thu, 23 Nov 2017 23:25:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33281) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eI5Wf-0002Pg-7h for qemu-devel@nongnu.org; Thu, 23 Nov 2017 23:23:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eI5We-0005W4-B6 for qemu-devel@nongnu.org; Thu, 23 Nov 2017 23:23:41 -0500 Received: from mail-pl0-x241.google.com ([2607:f8b0:400e:c01::241]:38533) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eI5Wc-0005U4-BR; Thu, 23 Nov 2017 23:23:38 -0500 Received: by mail-pl0-x241.google.com with SMTP id s10so3741531plj.5; Thu, 23 Nov 2017 20:23:38 -0800 (PST) Received: from surajjs1.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id f70sm40214287pfc.84.2017.11.23.20.23.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Nov 2017 20:23:36 -0800 (PST) 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=eJ84sSP2qWTkfMjT64yvlDis7nQK9Yz9PIPQxV3MYu4=; b=uMuab5fVlYD1+rRn/vA82htEcAH+WSqMZn8wXf0zzyNbsjarK1fti3H1yNDF6ePLYd ML1sueUCqt5PzQYWvSApLMhjUs03BdyVhsGYkNUC5pu1FSwu6wUXR/lGhOie3ic+KulD cW+fB+ZikbjTMNR6KcbT2aY6MdMI/P4UgSvIROvpYYSPc6NSBb7kbkNId9gjoDhSqjEa dmY2bQVnZZK+GSl2JAgq68docCkNCpwcPg0r4o1RAyBIcTxeTOHBArJ7KJTx66OlQRGG iIuAVPZGPLhOS+NKeheDsw0uDl6cPndUwA0e+HojjV7S2EfUqk8aZeVz8cXD7LCsQ50o E90A== 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=eJ84sSP2qWTkfMjT64yvlDis7nQK9Yz9PIPQxV3MYu4=; b=PMe/z//XsERtqOixTF4LY2rsYW0ltwQwsZ9Xge62jatTgMxicH85nmxNr6sGMhDte6 1CeIEXEVOO+HBVbPG06OvaX5W774ry3RO7qf9xY7okld2Ssm5ZoPKHVSg2sAE+kitrml GD7ilASzJspIHKN7dmpkheHN/AyA8FhWA80f9w5uCJgJBye1UrX4z/+85r8DOjKRvpfH azh5xxovRLpe7/LG7uV0sMfkXpTXF5+xPOFMcAyf3KdgxcaTd1SzugoHcGjrlOuLUsVv MxvbTSu9VtsPU49IrqenqdIjfCfmoMASVme4FQTW8Zf/vU1dN9e3axmZsgj+yGE5lPYj 4TXw== X-Gm-Message-State: AJaThX6mdM1gvVpEal/CvYEvKmS70KgOIoHKIf49gGz5DG4kN9xQmPg5 3sW38dMELrazv+RJODHqIljYd1he X-Google-Smtp-Source: AGs4zMbixTWq8GY6E5usmPlgLbWFOO7IUUL/XN74g5EeIOvAdKh/9iFwVI25ek7eJ2nb9L4eSRUX9A== X-Received: by 10.84.133.15 with SMTP id 15mr26907393plf.367.1511497417284; Thu, 23 Nov 2017 20:23:37 -0800 (PST) From: Suraj Jitindar Singh To: qemu-ppc@nongnu.org Date: Fri, 24 Nov 2017 15:23:24 +1100 Message-Id: <20171124042325.28012-2-sjitindarsingh@gmail.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171124042325.28012-1-sjitindarsingh@gmail.com> References: <20171124042325.28012-1-sjitindarsingh@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::241 Subject: [Qemu-devel] [QEMU-PPC] [PATCH 1/2] target/ppc: Move setting of patb_entry on hash table init 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: groug@kaod.org, qemu-devel@nongnu.org, sjitindarsingh@gmail.com, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The patb_entry is used to store the location of the process table in guest memory. The msb is also used to indicate the mmu mode of the guest, that is patb_entry & 1 << 63 ? radix_mode : hash_mode. Currently we set this to zero in spapr_setup_hpt_and_vrma() since if this function gets called then we know we're hash. However some code paths, such as setting up the hpt on incoming migration of a hash guest, call spapr_reallocate_hpt() directly bypassing this higher level function. Since we assume radix if the host is capable this results in the msb in patb_entry being left set so in spapr_post_load() we call kvmppc_configure_v3_mmu() and tell the host we're radix which as expected means addresses cannot be translated once we actually run the cpu. To fix this move the zeroing of patb_entry into spapr_reallocate_hpt(). Signed-off-by: Suraj Jitindar Singh Reviewed-by: Greg Kurz --- hw/ppc/spapr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 6841bd294b..e7af47bab0 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1373,6 +1373,8 @@ void spapr_reallocate_hpt(sPAPRMachineState *spapr, i= nt shift, DIRTY_HPTE(HPTE(spapr->htab, i)); } } + /* We're setting up a hash table, so that means we're not radix */ + spapr->patb_entry =3D 0; } =20 void spapr_setup_hpt_and_vrma(sPAPRMachineState *spapr) @@ -1392,8 +1394,6 @@ void spapr_setup_hpt_and_vrma(sPAPRMachineState *spap= r) spapr->rma_size =3D kvmppc_rma_size(spapr_node0_size(MACHINE(spapr= )), spapr->htab_shift); } - /* We're setting up a hash table, so that means we're not radix */ - spapr->patb_entry =3D 0; } =20 static void find_unknown_sysbus_device(SysBusDevice *sbdev, void *opaque) --=20 2.13.6