From nobody Sun May 19 19:10:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1588872495; cv=none; d=zohomail.com; s=zohoarc; b=iIc/gBfwOVvteosAYACd+7O8A+bT/r5XTNgtyyMVCuxr4N34kp+wtb8VegTmyKmCQkk3e7NObZ42C36hCV5Ol8bx2Y/7dqDLcHR0376rOHVxMYWOMSWfl9v1TQDP4kUoflRBKPuLb+/vDynx9R//LwkrfwJ1VU0r5zAZ/wKP2dQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588872495; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=5bn7pEtWcKPFrGSvczTjoK7DEuCZxJwU5qqkK5SFmQc=; b=ii3qm19I00Grdaxj+zoUW6Yn0ZSHwGP27pPFVQ0PvAuMRFc8GVqjeV45t/1sjkapzLCPw0HyyfJFZNKkn2sXpNlb5hUCyouR6yiUyH0oe3Vt8hx06/grKgCNFZ4lBMQa89XFlDfkBg/tTjxJXEkfFB5ZaklyXmtKVYUBt3EAX+g= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1588872495090978.9052907452243; Thu, 7 May 2020 10:28:15 -0700 (PDT) Received: from localhost ([::1]:39214 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jWkJh-0000I8-IJ for importer@patchew.org; Thu, 07 May 2020 13:28:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57098) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWkIS-0006wZ-B3; Thu, 07 May 2020 13:26:56 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:23186 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWkIR-0007AI-K3; Thu, 07 May 2020 13:26:56 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 047H4jOs162823; Thu, 7 May 2020 13:26:43 -0400 Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0b-001b2d01.pphosted.com with ESMTP id 30vmqam5x0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 07 May 2020 13:26:42 -0400 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 047HPsxM004211; Thu, 7 May 2020 17:26:41 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma01fra.de.ibm.com with ESMTP id 30s0g5ctpb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 07 May 2020 17:26:41 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 047HPTfR66191868 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 7 May 2020 17:25:29 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 136E852052; Thu, 7 May 2020 17:26:39 +0000 (GMT) Received: from bahia.lan (unknown [9.145.160.63]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id CDFCA5204F; Thu, 7 May 2020 17:26:38 +0000 (GMT) Subject: [PATCH 1/6] target/ppc: Pass const pointer to ppc_radix64_get_prot_amr() From: Greg Kurz To: David Gibson Date: Thu, 07 May 2020 19:26:38 +0200 Message-ID: <158887239797.1564424.3582189238652147071.stgit@bahia.lan> In-Reply-To: <158887239173.1564424.16721638327458334129.stgit@bahia.lan> References: <158887239173.1564424.16721638327458334129.stgit@bahia.lan> User-Agent: StGit/unknown-version MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.676 definitions=2020-05-07_09:2020-05-07, 2020-05-07 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1034 priorityscore=1501 lowpriorityscore=0 phishscore=0 bulkscore=0 adultscore=0 malwarescore=0 spamscore=0 suspectscore=0 impostorscore=0 mlxscore=0 mlxlogscore=768 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2005070139 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: softfail client-ip=148.163.158.5; envelope-from=groug@kaod.org; helo=mx0a-001b2d01.pphosted.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/07 12:11:34 X-ACL-Warn: Detected OS = Linux 3.x [generic] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, KHOP_DYNAMIC=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_SOFTFAIL=0.665, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, =?utf-8?q?C=C3=A9dric?= Le Goater , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" This doesn't require write access to the CPU structure. Signed-off-by: Greg Kurz --- target/ppc/mmu-radix64.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/ppc/mmu-radix64.h b/target/ppc/mmu-radix64.h index 96228546aa85..f28c5794d071 100644 --- a/target/ppc/mmu-radix64.h +++ b/target/ppc/mmu-radix64.h @@ -55,9 +55,9 @@ static inline int ppc_radix64_get_prot_eaa(uint64_t pte) (pte & R_PTE_EAA_X ? PAGE_EXEC : 0); } =20 -static inline int ppc_radix64_get_prot_amr(PowerPCCPU *cpu) +static inline int ppc_radix64_get_prot_amr(const PowerPCCPU *cpu) { - CPUPPCState *env =3D &cpu->env; + const CPUPPCState *env =3D &cpu->env; int amr =3D env->spr[SPR_AMR] >> 62; /* We only care about key0 AMR63:= 62 */ int iamr =3D env->spr[SPR_IAMR] >> 62; /* We only care about key0 IAMR= 63:62 */ =20 From nobody Sun May 19 19:10:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1588872546; cv=none; d=zohomail.com; s=zohoarc; b=cd4l7RPjkf2AcHNFSS7OBBgXBqddzAQpqdql2j/ykcbaec8y460kZw76YrQ5vmzta7JMQuWM71wooM98k0qWMOzd9qqSlt1KUe6G55bAzJjoSd4+Z1HB1KqW1pTUSkW16w7CnwHprqTYhP08a5iJ91GlKs1QQVcR55cuOw5RbIo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588872546; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ftt+YVimYdxmUoyz+wt6ctaMDlwlRqTZ1iNrty3bCKU=; b=AlGESz3dij5W98qrtxjL8XDBpKHxVTkwwEqhNB56QlQ3HFDK/uZpnKvPj86mCJpcadsvkIblw049QtvMAGBtcYhvSdA0EEpUSBpqzV74Qi17+duCqlZSaUhjnSi13lJU7kMyei2/zCIclM3Cml343J57s/8nV0cXernKSVg1Wj8= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1588872546446741.5147129100299; Thu, 7 May 2020 10:29:06 -0700 (PDT) Received: from localhost ([::1]:41680 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jWkKX-0001Lx-55 for importer@patchew.org; Thu, 07 May 2020 13:29:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57124) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWkIY-00078d-0e; Thu, 07 May 2020 13:27:02 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:46236) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWkIX-0007CK-5w; Thu, 07 May 2020 13:27:01 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 047H2bdw131901; Thu, 7 May 2020 13:26:50 -0400 Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0a-001b2d01.pphosted.com with ESMTP id 30uf8kbngc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 07 May 2020 13:26:49 -0400 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 047HPsxN004211; Thu, 7 May 2020 17:26:47 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma01fra.de.ibm.com with ESMTP id 30s0g5ctpc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 07 May 2020 17:26:47 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 047HQjoG63111494 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 7 May 2020 17:26:45 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4ABB74C044; Thu, 7 May 2020 17:26:45 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 11E814C046; Thu, 7 May 2020 17:26:45 +0000 (GMT) Received: from bahia.lan (unknown [9.145.160.63]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 7 May 2020 17:26:44 +0000 (GMT) Subject: [PATCH 2/6] target/ppc: Pass const pointer to ppc_radix64_get_fully_qualified_addr() From: Greg Kurz To: David Gibson Date: Thu, 07 May 2020 19:26:44 +0200 Message-ID: <158887240409.1564424.12790243891531523570.stgit@bahia.lan> In-Reply-To: <158887239173.1564424.16721638327458334129.stgit@bahia.lan> References: <158887239173.1564424.16721638327458334129.stgit@bahia.lan> User-Agent: StGit/unknown-version MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.676 definitions=2020-05-07_10:2020-05-07, 2020-05-07 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 bulkscore=0 impostorscore=0 spamscore=0 priorityscore=1501 malwarescore=0 mlxscore=0 lowpriorityscore=0 adultscore=0 mlxlogscore=629 phishscore=0 clxscore=1034 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2005070135 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: softfail client-ip=148.163.156.1; envelope-from=groug@kaod.org; helo=mx0a-001b2d01.pphosted.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/07 13:26:52 X-ACL-Warn: Detected OS = Linux 3.x [generic] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, KHOP_DYNAMIC=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_SOFTFAIL=0.665, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, =?utf-8?q?C=C3=A9dric?= Le Goater , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" This doesn't require write access to the CPU registers. Signed-off-by: Greg Kurz --- target/ppc/mmu-radix64.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/ppc/mmu-radix64.c b/target/ppc/mmu-radix64.c index 1404e53deca8..c76879f65b78 100644 --- a/target/ppc/mmu-radix64.c +++ b/target/ppc/mmu-radix64.c @@ -28,7 +28,8 @@ #include "mmu-radix64.h" #include "mmu-book3s-v3.h" =20 -static bool ppc_radix64_get_fully_qualified_addr(CPUPPCState *env, vaddr e= addr, +static bool ppc_radix64_get_fully_qualified_addr(const CPUPPCState *env, + vaddr eaddr, uint64_t *lpid, uint64_t = *pid) { if (msr_hv) { /* MSR[HV] -> Hypervisor/bare metal */ From nobody Sun May 19 19:10:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1588872635; cv=none; d=zohomail.com; s=zohoarc; b=YuapBhUUknO+3v1ibjzkQaYIYV/oH3y3cr1JwHeh2X8Ylj2vvZJnkeFekYCsJpc9XdDDSTq3znJxjX89NqidCaDjsDuAGDFPt1LrAQUiZKYqekMxBrte44mFDCMBMNOM5dkD1KgF734R81/EdI++3N6bo2HKviFLRaL0Ed44LXM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588872635; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=DcNI8EdBT6va/+Y63U3VEAefHJN1qw//nf2TTmv9n2k=; b=cKW9NisdIowrUHyvwwFhjkHwo7ceJAa0vtjfKNdHXvEnwcaytza+80fEp3rezKx7GE3bs5jPrUbfqKwezNacLzdmWKE0mq/2sHlIuD0UBuk/u+99baFB3GZzgOjdUJ4RyjYz9Bl+D3jya2dsoxdlEn5Z+Wy6itciDgtHTlzD5nk= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1588872635364215.11066373877577; Thu, 7 May 2020 10:30:35 -0700 (PDT) Received: from localhost ([::1]:49150 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jWkLx-0004U6-Pr for importer@patchew.org; Thu, 07 May 2020 13:30:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57140) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWkIl-0007f6-7g; Thu, 07 May 2020 13:27:15 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:59658) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWkIk-0007DQ-E4; Thu, 07 May 2020 13:27:14 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 047H1oo9123955; Thu, 7 May 2020 13:27:02 -0400 Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 30twj0mb54-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 07 May 2020 13:27:02 -0400 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 047HPqIN009099; Thu, 7 May 2020 17:27:00 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma04fra.de.ibm.com with ESMTP id 30s0g64s6u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 07 May 2020 17:27:00 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 047HQvdS5636564 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 7 May 2020 17:26:57 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 74B77A405E; Thu, 7 May 2020 17:26:57 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 45B90A4040; Thu, 7 May 2020 17:26:57 +0000 (GMT) Received: from bahia.lan (unknown [9.145.160.63]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 7 May 2020 17:26:57 +0000 (GMT) Subject: [PATCH 3/6] target/ppc: Don't initialize some local variables in ppc_radix64_xlate() From: Greg Kurz To: David Gibson Date: Thu, 07 May 2020 19:26:50 +0200 Message-ID: <158887241032.1564424.1335205982073200922.stgit@bahia.lan> In-Reply-To: <158887239173.1564424.16721638327458334129.stgit@bahia.lan> References: <158887239173.1564424.16721638327458334129.stgit@bahia.lan> User-Agent: StGit/unknown-version MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.676 definitions=2020-05-07_10:2020-05-07, 2020-05-07 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=758 priorityscore=1501 lowpriorityscore=0 bulkscore=0 spamscore=0 phishscore=0 malwarescore=0 impostorscore=0 suspectscore=0 mlxscore=0 clxscore=1034 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2005070135 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: softfail client-ip=148.163.156.1; envelope-from=groug@kaod.org; helo=mx0a-001b2d01.pphosted.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/07 13:26:52 X-ACL-Warn: Detected OS = Linux 3.x [generic] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, KHOP_DYNAMIC=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_SOFTFAIL=0.665, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, =?utf-8?q?C=C3=A9dric?= Le Goater , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" It is the job of the ppc_radix64_get_fully_qualified_addr() function which is called at the beginning of ppc_radix64_xlate() to set both lpid *and* pid. It doesn't buy us anything to initialize them first. Worse, a bug in ppc_radix64_get_fully_qualified_addr(), eg. failing to set either lpid or pid, would be undetectable by static analysis tools like coverity. Signed-off-by: Greg Kurz --- target/ppc/mmu-radix64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/ppc/mmu-radix64.c b/target/ppc/mmu-radix64.c index c76879f65b78..5e2d912ee346 100644 --- a/target/ppc/mmu-radix64.c +++ b/target/ppc/mmu-radix64.c @@ -433,7 +433,7 @@ static int ppc_radix64_xlate(PowerPCCPU *cpu, vaddr ead= dr, int rwx, bool cause_excp) { CPUPPCState *env =3D &cpu->env; - uint64_t lpid =3D 0, pid =3D 0; + uint64_t lpid, pid; ppc_v3_pate_t pate; int psize, prot; hwaddr g_raddr; From nobody Sun May 19 19:10:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1588872804; cv=none; d=zohomail.com; s=zohoarc; b=JgaW3YeT8Q3TWc9kbQPslXEekYrMXjUjYhYSxmh3IGCCFI06SmiTstDUCaNt+1cb+63CvTzwQCsXLh7WJfcloZUCVdWkIG77i6CgI7GlbzaMZGaFyfp90GN3TSbgynEEdrCNCH1pzpxlhY5obUQgV9bi7q0zMtIkBFHEFb2PBPA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588872804; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=r1t1MMXi2S9uuOVJOV2UXDYYmgt55T5hQthYLBVVFRk=; b=iEfEMABy55obubk92/TvJFmjeFmWtlUrhCzXZmsQz61N9HydWbs0A7rB7Bd1wMxsfV4TBU1LAi8VO0PN7wDal91JgWkhGW7C9aDyJGJH7w2CgxaJfMbhcZ8cXWDRM4tYhErgPbIpdP04oUcySl2KT3Gui87LSMB4VE2JLQq+e9s= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1588872804191131.01979787505115; Thu, 7 May 2020 10:33:24 -0700 (PDT) Received: from localhost ([::1]:56784 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jWkOg-0008LC-TV for importer@patchew.org; Thu, 07 May 2020 13:33:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57144) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWkIl-0007fq-EY; Thu, 07 May 2020 13:27:15 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:54926) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWkIk-0007DU-KX; Thu, 07 May 2020 13:27:15 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 047H1oUI123979; Thu, 7 May 2020 13:27:09 -0400 Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 30twj0mb89-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 07 May 2020 13:27:08 -0400 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 047HPVTA013431; Thu, 7 May 2020 17:27:05 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma03ams.nl.ibm.com with ESMTP id 30s0g5utdm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 07 May 2020 17:27:05 +0000 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 047HR3Pl54919668 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 7 May 2020 17:27:03 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A90BD42047; Thu, 7 May 2020 17:27:03 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6E84142042; Thu, 7 May 2020 17:27:03 +0000 (GMT) Received: from bahia.lan (unknown [9.145.160.63]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 7 May 2020 17:27:03 +0000 (GMT) Subject: [PATCH 4/6] target/ppc: Add missing braces in ppc_radix64_partition_scoped_xlate() From: Greg Kurz To: David Gibson Date: Thu, 07 May 2020 19:27:02 +0200 Message-ID: <158887242253.1564424.10905940069629249156.stgit@bahia.lan> In-Reply-To: <158887239173.1564424.16721638327458334129.stgit@bahia.lan> References: <158887239173.1564424.16721638327458334129.stgit@bahia.lan> User-Agent: StGit/unknown-version MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.676 definitions=2020-05-07_10:2020-05-07, 2020-05-07 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=797 priorityscore=1501 lowpriorityscore=0 bulkscore=0 spamscore=0 phishscore=0 malwarescore=0 impostorscore=0 suspectscore=0 mlxscore=0 clxscore=1034 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2005070135 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: softfail client-ip=148.163.156.1; envelope-from=groug@kaod.org; helo=mx0a-001b2d01.pphosted.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/07 13:26:52 X-ACL-Warn: Detected OS = Linux 3.x [generic] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, KHOP_DYNAMIC=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_SOFTFAIL=0.665, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, =?utf-8?q?C=C3=A9dric?= Le Goater , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" As per CODING_STYLE. Fixes: d04ea940c597 "target/ppc: Add support for Radix partition-scoped tra= nslation" Signed-off-by: Greg Kurz --- target/ppc/mmu-radix64.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/ppc/mmu-radix64.c b/target/ppc/mmu-radix64.c index 5e2d912ee346..956519b3ad20 100644 --- a/target/ppc/mmu-radix64.c +++ b/target/ppc/mmu-radix64.c @@ -282,8 +282,9 @@ static int ppc_radix64_partition_scoped_xlate(PowerPCCP= U *cpu, int rwx, pate.dw0 & PRTBE_R_RPDS, h_raddr, h_page_siz= e, &pte, &fault_cause, &pte_addr) || ppc_radix64_check_prot(cpu, rwx, pte, &fault_cause, h_prot, true))= { - if (pde_addr) /* address being translated was that of a guest pde = */ + if (pde_addr) { /* address being translated was that of a guest pd= e */ fault_cause |=3D DSISR_PRTABLE_FAULT; + } if (cause_excp) { ppc_radix64_raise_hsi(cpu, rwx, eaddr, g_raddr, fault_cause); } From nobody Sun May 19 19:10:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1588872691; cv=none; d=zohomail.com; s=zohoarc; b=EX4nCxm5UiOLaJsisIP3DibKgTNW/HIXcNg8Rbm41G7y5bKiy1LRrtnjizOm5qeoRAGx9ApxlJuTvDafmdzbTG2es+jluzIYuU6wr0Q7Oi+2sDrWKurTmP2+NrIUuF/G27oe4Fd6Wua+DeEQ8xSaR2ndTamwSxd4IBH2aFqmoak= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588872691; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=anV0DpJgu+ZTNLwhLLntGJhPRkfX96Dj3aHeF/b6Gmo=; b=SZHiTApAJ2TBb1dhCnqpqsxO0QChkw0omLpj1crK02xFxvr7vRJdKpkeFGjjVWC+v3jS1gGnF5oxXJO9YYMG3Q9yoU358Vw6Gtuu2Jqp3bYtmmMjIUrlFajrZmPtZXU6dRL8pGIn+FDp2ul8ZJUQ726N8BzSpxg2oRnKEj/MlZA= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1588872691242341.30040340786957; Thu, 7 May 2020 10:31:31 -0700 (PDT) Received: from localhost ([::1]:50718 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jWkMr-0005Ds-Rf for importer@patchew.org; Thu, 07 May 2020 13:31:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57182) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWkIw-00088D-8x; Thu, 07 May 2020 13:27:26 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:2612 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWkIv-0007LR-Hx; Thu, 07 May 2020 13:27:25 -0400 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 047H4Rk4103561; Thu, 7 May 2020 13:27:14 -0400 Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0b-001b2d01.pphosted.com with ESMTP id 30s319x2ea-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 07 May 2020 13:27:13 -0400 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 047HPqjO013505; Thu, 7 May 2020 17:27:12 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma03ams.nl.ibm.com with ESMTP id 30s0g5utdr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 07 May 2020 17:27:11 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 047HR9Rf59048030 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 7 May 2020 17:27:10 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D296D11C054; Thu, 7 May 2020 17:27:09 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 989A511C052; Thu, 7 May 2020 17:27:09 +0000 (GMT) Received: from bahia.lan (unknown [9.145.160.63]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 7 May 2020 17:27:09 +0000 (GMT) Subject: [PATCH 5/6] target/ppc: Fix arguments to ppc_radix64_partition_scoped_xlate() From: Greg Kurz To: David Gibson Date: Thu, 07 May 2020 19:27:09 +0200 Message-ID: <158887242870.1564424.10406541101906348092.stgit@bahia.lan> In-Reply-To: <158887239173.1564424.16721638327458334129.stgit@bahia.lan> References: <158887239173.1564424.16721638327458334129.stgit@bahia.lan> User-Agent: StGit/unknown-version MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.676 definitions=2020-05-07_10:2020-05-07, 2020-05-07 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 phishscore=0 priorityscore=1501 lowpriorityscore=0 suspectscore=0 mlxscore=0 spamscore=0 malwarescore=0 mlxlogscore=744 adultscore=0 bulkscore=0 clxscore=1034 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2005070135 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: softfail client-ip=148.163.158.5; envelope-from=groug@kaod.org; helo=mx0a-001b2d01.pphosted.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/07 12:11:34 X-ACL-Warn: Detected OS = Linux 3.x [generic] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, KHOP_DYNAMIC=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_SOFTFAIL=0.665, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, =?utf-8?q?C=C3=A9dric?= Le Goater , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" The last two arguments have the bool type. Also, we shouldn't raise an exception when using gdbstub. This was found while reading the code. Since it only affects the powernv machine, I didn't dig further to find an actual bug. Fixes: d04ea940c597 "target/ppc: Add support for Radix partition-scoped tra= nslation" Signed-off-by: Greg Kurz --- target/ppc/mmu-radix64.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/ppc/mmu-radix64.c b/target/ppc/mmu-radix64.c index 956519b3ad20..ceeb3dfe2d49 100644 --- a/target/ppc/mmu-radix64.c +++ b/target/ppc/mmu-radix64.c @@ -335,7 +335,8 @@ static int ppc_radix64_process_scoped_xlate(PowerPCCPU = *cpu, int rwx, */ ret =3D ppc_radix64_partition_scoped_xlate(cpu, 0, eaddr, prtbe_ad= dr, pate, &h_raddr, &h_prot, - &h_page_size, 1, 1); + &h_page_size, true, + cause_excp); if (ret) { return ret; } @@ -374,7 +375,8 @@ static int ppc_radix64_process_scoped_xlate(PowerPCCPU = *cpu, int rwx, do { ret =3D ppc_radix64_partition_scoped_xlate(cpu, 0, eaddr, pte_= addr, pate, &h_raddr, &h_pr= ot, - &h_page_size, 1, 1); + &h_page_size, true, + cause_excp); if (ret) { return ret; } From nobody Sun May 19 19:10:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1588872657; cv=none; d=zohomail.com; s=zohoarc; b=CAuv7ITSyuJWGvMPQ1htbnSCcuqEgtK/ve3iu7nFCjuciVscjjrOMmPVxAiqeTHuyjMX0EANQs9SVqQSEYocAlnXqPc43+D3iI1ZCcWG/VNiSGzatEgApELuQY3hs7ysyAVhAm5RcryAsdtfkvl2MUnHHelOLJfIcIYFG3OTxDM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588872657; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=gKT6aKD7TDKmkveBtKEyjUlvAeucc23eAcVPYYOtLIk=; b=jz25qzuZ42gmzlk4SQUyD1Drcb7wSO0BwFGV9bQ0eRtmNCUqIetk3nOM7PXDlLuBh5MgmZwzps2A+D0HIQ9lNhK4/AXYGZEai3V9WbXo+8Wlc0XLe4rYycnyIbeTvJ6LD9fTGk81mx1fMsKxIpAEsGZNzEwmCsY0ZpFnj4cqX+U= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1588872657061872.7678020142556; Thu, 7 May 2020 10:30:57 -0700 (PDT) Received: from localhost ([::1]:49576 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jWkMI-0004fO-NK for importer@patchew.org; Thu, 07 May 2020 13:30:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57250) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWkJM-0000LX-HJ; Thu, 07 May 2020 13:27:54 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:6050 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWkJL-0007Qp-PS; Thu, 07 May 2020 13:27:52 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 047H1Jvx160249; Thu, 7 May 2020 13:27:39 -0400 Received: from ppma05fra.de.ibm.com (6c.4a.5195.ip4.static.sl-reverse.com [149.81.74.108]) by mx0b-001b2d01.pphosted.com with ESMTP id 30s2g5j4cv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 07 May 2020 13:27:39 -0400 Received: from pps.filterd (ppma05fra.de.ibm.com [127.0.0.1]) by ppma05fra.de.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 047HPYCb025012; Thu, 7 May 2020 17:27:37 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma05fra.de.ibm.com with ESMTP id 30s0g5ms7t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 07 May 2020 17:27:36 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 047HRYLL60489796 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 7 May 2020 17:27:34 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 558A9AE093; Thu, 7 May 2020 17:27:34 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C91F8AE05D; Thu, 7 May 2020 17:27:15 +0000 (GMT) Received: from bahia.lan (unknown [9.145.160.63]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 7 May 2020 17:27:15 +0000 (GMT) Subject: [PATCH 6/6] target/ppc: Don't update radix PTE R/C bits with gdbstub From: Greg Kurz To: David Gibson Date: Thu, 07 May 2020 19:27:15 +0200 Message-ID: <158887243487.1564424.7276382177976503972.stgit@bahia.lan> In-Reply-To: <158887239173.1564424.16721638327458334129.stgit@bahia.lan> References: <158887239173.1564424.16721638327458334129.stgit@bahia.lan> User-Agent: StGit/unknown-version MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.676 definitions=2020-05-07_10:2020-05-07, 2020-05-07 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 malwarescore=0 suspectscore=0 bulkscore=0 priorityscore=1501 spamscore=0 lowpriorityscore=0 adultscore=0 phishscore=0 mlxlogscore=912 clxscore=1034 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2005070135 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: softfail client-ip=148.163.158.5; envelope-from=groug@kaod.org; helo=mx0a-001b2d01.pphosted.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/07 12:11:34 X-ACL-Warn: Detected OS = Linux 3.x [generic] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, KHOP_DYNAMIC=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_SOFTFAIL=0.665, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, =?utf-8?q?C=C3=A9dric?= Le Goater , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" gdbstub shouldn't silently change guest visible state when doing address translation. While here drop a not very useful comment. This was found while reading the code. I could verify that this affects both powernv and pseries, but I failed to observe any actual bug. Fixes: d04ea940c597 "target/ppc: Add support for Radix partition-scoped tra= nslation" Signed-off-by: Greg Kurz --- target/ppc/mmu-radix64.c | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/target/ppc/mmu-radix64.c b/target/ppc/mmu-radix64.c index ceeb3dfe2d49..bc51cd89a079 100644 --- a/target/ppc/mmu-radix64.c +++ b/target/ppc/mmu-radix64.c @@ -270,7 +270,8 @@ static int ppc_radix64_partition_scoped_xlate(PowerPCCP= U *cpu, int rwx, ppc_v3_pate_t pate, hwaddr *h_raddr, int *h_prot, int *h_page_size, bool pde_a= ddr, - bool cause_excp) + bool cause_excp, + bool cause_rc_update) { int fault_cause =3D 0; hwaddr pte_addr; @@ -291,8 +292,9 @@ static int ppc_radix64_partition_scoped_xlate(PowerPCCP= U *cpu, int rwx, return 1; } =20 - /* Update Reference and Change Bits */ - ppc_radix64_set_rc(cpu, rwx, pte, pte_addr, h_prot); + if (cause_rc_update) { + ppc_radix64_set_rc(cpu, rwx, pte, pte_addr, h_prot); + } =20 return 0; } @@ -301,7 +303,8 @@ static int ppc_radix64_process_scoped_xlate(PowerPCCPU = *cpu, int rwx, vaddr eaddr, uint64_t pid, ppc_v3_pate_t pate, hwaddr *g_= raddr, int *g_prot, int *g_page_size, - bool cause_excp) + bool cause_excp, + bool cause_rc_update) { CPUState *cs =3D CPU(cpu); CPUPPCState *env =3D &cpu->env; @@ -336,7 +339,8 @@ static int ppc_radix64_process_scoped_xlate(PowerPCCPU = *cpu, int rwx, ret =3D ppc_radix64_partition_scoped_xlate(cpu, 0, eaddr, prtbe_ad= dr, pate, &h_raddr, &h_prot, &h_page_size, true, - cause_excp); + cause_excp, + cause_rc_update); if (ret) { return ret; } @@ -376,7 +380,8 @@ static int ppc_radix64_process_scoped_xlate(PowerPCCPU = *cpu, int rwx, ret =3D ppc_radix64_partition_scoped_xlate(cpu, 0, eaddr, pte_= addr, pate, &h_raddr, &h_pr= ot, &h_page_size, true, - cause_excp); + cause_excp, + cause_rc_update); if (ret) { return ret; } @@ -408,7 +413,9 @@ static int ppc_radix64_process_scoped_xlate(PowerPCCPU = *cpu, int rwx, return 1; } =20 - ppc_radix64_set_rc(cpu, rwx, pte, pte_addr, g_prot); + if (cause_rc_update) { + ppc_radix64_set_rc(cpu, rwx, pte, pte_addr, g_prot); + } =20 return 0; } @@ -433,7 +440,8 @@ static int ppc_radix64_process_scoped_xlate(PowerPCCPU = *cpu, int rwx, static int ppc_radix64_xlate(PowerPCCPU *cpu, vaddr eaddr, int rwx, bool relocation, hwaddr *raddr, int *psizep, int *protp, - bool cause_excp) + bool cause_excp, + bool cause_rc_update) { CPUPPCState *env =3D &cpu->env; uint64_t lpid, pid; @@ -483,7 +491,9 @@ static int ppc_radix64_xlate(PowerPCCPU *cpu, vaddr ead= dr, int rwx, if (relocation) { int ret =3D ppc_radix64_process_scoped_xlate(cpu, rwx, eaddr, pid, pate, &g_raddr, &prot, - &psize, cause_excp); + &psize, + cause_excp, + cause_rc_update); if (ret) { return ret; } @@ -506,7 +516,9 @@ static int ppc_radix64_xlate(PowerPCCPU *cpu, vaddr ead= dr, int rwx, =20 ret =3D ppc_radix64_partition_scoped_xlate(cpu, rwx, eaddr, g_= raddr, pate, raddr, &prot, &= psize, - 0, cause_excp); + 0, + cause_excp, + cause_rc_update); if (ret) { return ret; } @@ -562,7 +574,7 @@ int ppc_radix64_handle_mmu_fault(PowerPCCPU *cpu, vaddr= eaddr, int rwx, =20 /* Translate eaddr to raddr (where raddr is addr qemu needs for access= ) */ if (ppc_radix64_xlate(cpu, eaddr, rwx, relocation, &raddr, - &page_size, &prot, true)) { + &page_size, &prot, true, true)) { return 1; } =20 @@ -584,7 +596,7 @@ hwaddr ppc_radix64_get_phys_page_debug(PowerPCCPU *cpu,= target_ulong eaddr) } =20 if (ppc_radix64_xlate(cpu, eaddr, 0, msr_dr, &raddr, &psize, - &prot, false)) { + &prot, false, false)) { return -1; } =20