From nobody Sun Apr 28 08:53:42 2024 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.zoho.com; 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 (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1494274844422995.6433074006037; Mon, 8 May 2017 13:20:44 -0700 (PDT) Received: from localhost ([::1]:33301 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d7p99-0002TU-38 for importer@patchew.org; Mon, 08 May 2017 16:20:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38082) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d7p6P-0000Zb-A7 for qemu-devel@nongnu.org; Mon, 08 May 2017 16:17:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d7p6M-0003Pe-5n for qemu-devel@nongnu.org; Mon, 08 May 2017 16:17:53 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:33323 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d7p6L-0003PB-W6 for qemu-devel@nongnu.org; Mon, 08 May 2017 16:17:50 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v48KAkoe027341 for ; Mon, 8 May 2017 16:17:49 -0400 Received: from e24smtp01.br.ibm.com (e24smtp01.br.ibm.com [32.104.18.85]) by mx0b-001b2d01.pphosted.com with ESMTP id 2aawxnv45q-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 08 May 2017 16:17:49 -0400 Received: from localhost by e24smtp01.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 8 May 2017 17:17:47 -0300 Received: from d24relay03.br.ibm.com (9.18.232.225) by e24smtp01.br.ibm.com (10.172.0.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 8 May 2017 17:17:45 -0300 Received: from d24av01.br.ibm.com (d24av01.br.ibm.com [9.8.31.91]) by d24relay03.br.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v48KHjtU32309422; Mon, 8 May 2017 17:17:45 -0300 Received: from d24av01.br.ibm.com (localhost [127.0.0.1]) by d24av01.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v48KHikk020541; Mon, 8 May 2017 17:17:45 -0300 Received: from pacoca.ibm.com ([9.80.197.248]) by d24av01.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v48KHdct020520; Mon, 8 May 2017 17:17:41 -0300 From: Jose Ricardo Ziviani To: qemu-ppc@nongnu.org Date: Mon, 8 May 2017 17:17:15 -0300 X-Mailer: git-send-email 2.7.4 X-TM-AS-MML: disable x-cbid: 17050820-1523-0000-0000-0000029D086F X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17050820-1524-0000-0000-00002A336425 Message-Id: <1494274635-11029-1-git-send-email-joserz@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-05-08_14:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1705080108 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH] Revert "target-ppc/kvm: Enable in-kernel TCE acceleration for multi-tce" 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: rnsastry@linux.vnet.ibm.com, aik@ozlabs.ru, qemu-devel@nongnu.org, bharata@linux.vnet.ibm.com, sam.bobroff@au1.ibm.com, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This reverts commit 3dc410ae83e6cb76c81ea30a05d62596092b3165. Booting a radix guest in Power9 with that commit throws a host kernel oops: [17582052553.360178] Unable to handle kernel paging request for data at add= ress 0xe64bb17da64ab078 [17582052553.360420] Faulting instruction address: 0xc0000000002c3ddc [17582052553.360533] Oops: Kernel access of bad area, sig: 11 [#1] [17582052553.360643] SMP NR_CPUS=3D1024 [17582052553.360645] NUMA [17582052553.360712] PowerNV [17582052553.360804] Modules linked in: vhost_net vhost tap xt_CHECKSUM ipt= _MASQUERADE nf_nat_masquerade_ipv4 ip6t_rpfilter ip6t_REJECT nf_reject_ipv6= nf_conntrack_ipv6 nf_defrag_ipv6 xt_conntrack ip_set nfnetlink ebtable_nat= ebtable_broute bridge stp llc ip6table_mangle ip6table_security ip6table_r= aw iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_connt= rack libcrc32c iptable_mangle iptable_security iptable_raw ebtable_filter e= btables ip6table_filter ip6_tables ses enclosure scsi_transport_sas ipmi_po= wernv powernv_op_panel ipmi_devintf ipmi_msghandler nfsd kvm_hv auth_rpcgss= oid_registry nfs_acl lockd grace sunrpc kvm tg3 ptp pps_core [17582052553.361797] CPU: 5 PID: 4966 Comm: qemu-system-ppc Not tainted 4.1= 1.0-1.git4a6869a.el7.centos.ppc64le #1 [17582052553.361972] task: c0000003c5e90a80 task.stack: c0000003c5f6c000 [17582052553.362082] NIP: c0000000002c3ddc LR: c0000000002c3e80 CTR: c00000= 00000ce2e0 [17582052553.362214] REGS: c0000003c5f6f150 TRAP: 0380 Not tainted (4.11= .0-1.git4a6869a.el7.centos.ppc64le) [17582052553.362467] MSR: 9000000000001031 [17582052553.362480] CR: 44008024 XER: 20000000 [17582052553.362822] CFAR: c0000000002c3e7c SOFTE: 1 [17582052553.362822] GPR00: 000000000000018f c0000003c5f6f3d0 c00000000131f= d00 0000000000000000 [17582052553.362822] GPR04: 0000000000000005 00000000000001ff 0000000000000= 000 7db04aa67db14ba6 [17582052553.362822] GPR08: 264bb17da64ab000 e64bb17da64ab000 0000000000000= 078 0000000000000000 [17582052553.362822] GPR12: c0000003bdb98008 c00000000fdc2d00 c00000000000e= 148 0000000000000000 [17582052553.362822] GPR16: 0000000008000000 0000000020000000 0000000000000= 000 c0000003c5f6f4c0 [17582052553.362822] GPR20: c0000001ffff9440 c0000001fd033280 c0000001fd034= 2a0 c0000001f24efff8 [17582052553.362822] GPR24: 0000000000000200 00000001f24f0000 0000000000000= 010 0000000000020000 [17582052553.362822] GPR28: 0800000000000000 00000001f24f0000 000000007db04= aa6 00000000a64ab07d [17582052553.365148] NIP [c0000000002c3ddc] vmalloc_to_page+0x19c/0x220 [17582052553.365365] LR [c0000000002c3e80] vmalloc_to_pfn+0x20/0x50 [17582052553.365582] Call Trace: [17582052553.365720] [c0000003c5f6f3d0] [7265677368657265] 0x72656773686572= 65 (unreliable) [17582052553.365982] [c0000003c5f6f400] [c0000000002c3e80] vmalloc_to_pfn+0= x20/0x50 [17582052553.366245] [c0000003c5f6f420] [c0000000000637e8] vmalloc_to_phys+= 0x28/0x60 [17582052553.366508] [c0000003c5f6f450] [c0000000000ce480] kvmppc_rm_h_put_= tce_indirect+0x1a0/0x540 [17582052553.366812] [c0000003c5f6f590] [c0000000000d0314] hcall_try_real_m= ode+0x60/0x7c [17582052553.367074] [c0000003c5f6f600] [c0000000000cefac] kvmppc_call_hv_e= ntry+0x8/0x17c [17582052553.367346] [c0000003c5f6f670] [c00800000375a970] __kvmppc_vcore_e= ntry+0x13c/0x1ac [kvm_hv] [17582052553.367652] [c0000003c5f6f840] [c0080000037574a8] kvmppc_run_core+= 0x788/0x1650 [kvm_hv] [17582052553.367965] [c0000003c5f6fa00] [c0080000037590b8] kvmppc_vcpu_run_= hv+0x388/0x1200 [kvm_hv] [17582052553.368287] [c0000003c5f6fb30] [c008000003274684] kvmppc_vcpu_run+= 0x34/0x50 [kvm] [17582052553.368558] [c0000003c5f6fb50] [c008000003270b54] kvm_arch_vcpu_io= ctl_run+0x114/0x2a0 [kvm] [17582052553.368870] [c0000003c5f6fbd0] [c008000003263dd8] kvm_vcpu_ioctl+0= x5e8/0x7c0 [kvm] [17582052553.369132] [c0000003c5f6fd40] [c000000000350b50] do_vfs_ioctl+0xd= 0/0x8c0 [17582052553.369395] [c0000003c5f6fde0] [c000000000351414] SyS_ioctl+0xd4/0= xf0 [17582052553.369615] [c0000003c5f6fe30] [c00000000000b8e0] system_call+0x38= /0xfc [17582052553.369875] Instruction dump: [17582052553.370011] 53dfc42e 790807c6 394affff 7d08fb78 78638402 79081764 = 7d4a07b4 7c6a5038 [17582052553.370281] 7908f5e6 7d094b78 794a1f24 38600000 <7d2a482a> 7924cfe= 3 41820040 79260022 [17582052553.370599] ---[ end trace 9470442ed18ae727 ]--- As soon as we identify and fix the issue that's causing such problem I'll re-send the referred patch to re-enable TCE. Signed-off-by: Jose Ricardo Ziviani CC: Bharata B Rao --- hw/ppc/spapr.c | 4 +--- target/ppc/kvm.c | 14 -------------- target/ppc/kvm_ppc.h | 6 ------ 3 files changed, 1 insertion(+), 23 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index e2dc77c..362ee81 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -2340,12 +2340,10 @@ static void ppc_spapr_init(MachineState *machine) =20 qemu_register_boot_set(spapr_boot_set, spapr); =20 + /* to stop and start vmclock */ if (kvm_enabled()) { - /* to stop and start vmclock */ qemu_add_vm_change_state_handler(cpu_ppc_clock_vm_state_change, &spapr->tb); - - kvmppc_spapr_enable_inkernel_multitce(); } } =20 diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c index 8574c36..c959b90 100644 --- a/target/ppc/kvm.c +++ b/target/ppc/kvm.c @@ -2198,20 +2198,6 @@ bool kvmppc_spapr_use_multitce(void) return cap_spapr_multitce; } =20 -int kvmppc_spapr_enable_inkernel_multitce(void) -{ - int ret; - - ret =3D kvm_vm_enable_cap(kvm_state, KVM_CAP_PPC_ENABLE_HCALL, 0, - H_PUT_TCE_INDIRECT, 1); - if (!ret) { - ret =3D kvm_vm_enable_cap(kvm_state, KVM_CAP_PPC_ENABLE_HCALL, 0, - H_STUFF_TCE, 1); - } - - return ret; -} - void *kvmppc_create_spapr_tce(uint32_t liobn, uint32_t page_shift, uint64_t bus_offset, uint32_t nb_table, int *pfd, bool need_vfio) diff --git a/target/ppc/kvm_ppc.h b/target/ppc/kvm_ppc.h index f48243d..4b2fd9a 100644 --- a/target/ppc/kvm_ppc.h +++ b/target/ppc/kvm_ppc.h @@ -39,7 +39,6 @@ target_ulong kvmppc_configure_v3_mmu(PowerPCCPU *cpu, #ifndef CONFIG_USER_ONLY off_t kvmppc_alloc_rma(void **rma); bool kvmppc_spapr_use_multitce(void); -int kvmppc_spapr_enable_inkernel_multitce(void); void *kvmppc_create_spapr_tce(uint32_t liobn, uint32_t page_shift, uint64_t bus_offset, uint32_t nb_table, int *pfd, bool need_vfio); @@ -181,11 +180,6 @@ static inline bool kvmppc_spapr_use_multitce(void) return false; } =20 -static inline int kvmppc_spapr_enable_inkernel_multitce(void) -{ - return -1; -} - static inline void *kvmppc_create_spapr_tce(uint32_t liobn, uint32_t page_= shift, uint64_t bus_offset, uint32_t nb_table, --=20 2.7.4