From nobody Wed Feb 11 00:56:01 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.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=1560511501; cv=none; d=zoho.com; s=zohoarc; b=djElz5WsmXHDTu+CHEXNoi3zkZdNpFKl/31sHkYAfwXRJ8njvA0vz+F2gZiJ1j/FJHuK5XogBgkSc43ycirnU8JAGNkaso86nJeIzzICB/5kCT8JVRzWQYBgt8JJBDv54l3V8KrLlt35SJdzw2FdQ5Dac0Brs820ip1LAayBR/k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560511501; 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:ARC-Authentication-Results; bh=beqxLIi47HLrW/mkRorBbbaVExik13+UCPKMQTCxF6A=; b=NjsscPPGarG8rx/0bO/p5jlz+PP3jZlkRkTs45n8Q2Aw3GqpHSfgaXprtjf2hxUrMHTRAv7+GTxJQMwQnREgbAOh+SCjsaDRnBVRYi7Gt/O61CJqKirZzXcQ5TaMRTuoBq3n+rOMSaTV2g8PxaZiPLtEcSpYjo6NDJl2zgPgzSE= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.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 (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1560511501990599.6609111277813; Fri, 14 Jun 2019 04:25:01 -0700 (PDT) Received: from localhost ([::1]:50272 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbkKA-0000j0-T5 for importer@patchew.org; Fri, 14 Jun 2019 07:24:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35890) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbkCS-0002RV-Fz for qemu-devel@nongnu.org; Fri, 14 Jun 2019 07:16:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hbk5R-0003N1-AS for qemu-devel@nongnu.org; Fri, 14 Jun 2019 07:09:38 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:44720) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hbk5Q-0003Lo-Us for qemu-devel@nongnu.org; Fri, 14 Jun 2019 07:09:37 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5EB73WC136449 for ; Fri, 14 Jun 2019 07:09:35 -0400 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 2t48cudctq-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 14 Jun 2019 07:09:34 -0400 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 14 Jun 2019 12:09:20 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 14 Jun 2019 12:09:18 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x5EB9Hwo61538540 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 14 Jun 2019 11:09:18 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DA0AC11C054; Fri, 14 Jun 2019 11:09:17 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B0DC011C050; Fri, 14 Jun 2019 11:09:17 +0000 (GMT) Received: from bahia.lan (unknown [9.145.152.28]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 14 Jun 2019 11:09:17 +0000 (GMT) From: Greg Kurz To: David Gibson Date: Fri, 14 Jun 2019 13:09:17 +0200 In-Reply-To: <156051052402.224162.13664250996245267046.stgit@bahia.lan> References: <156051052402.224162.13664250996245267046.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-cbid: 19061411-0012-0000-0000-000003291A3B X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19061411-0013-0000-0000-000021622A10 Message-Id: <156051055736.224162.11641594431517798715.stgit@bahia.lan> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-06-14_05:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1034 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906140093 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH 6/7] ppc: Introduce kvmppc_set_reg_tb_offset() helper 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, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Introduce a KVM helper and its stub instead of guarding the code with CONFIG_KVM. Signed-off-by: Greg Kurz --- hw/ppc/ppc.c | 5 +---- target/ppc/kvm.c | 9 +++++++++ target/ppc/kvm_ppc.h | 5 +++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c index 288196dfa67a..a9e508c496de 100644 --- a/hw/ppc/ppc.c +++ b/hw/ppc/ppc.c @@ -1034,10 +1034,7 @@ static void timebase_load(PPCTimebase *tb) CPU_FOREACH(cpu) { PowerPCCPU *pcpu =3D POWERPC_CPU(cpu); pcpu->env.tb_env->tb_offset =3D tb_off_adj; -#if defined(CONFIG_KVM) - kvm_set_one_reg(cpu, KVM_REG_PPC_TB_OFFSET, - &pcpu->env.tb_env->tb_offset); -#endif + kvmppc_set_reg_tb_offset(pcpu, pcpu->env.tb_env->tb_offset); } } =20 diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c index d4107dd70d21..cde39904510a 100644 --- a/target/ppc/kvm.c +++ b/target/ppc/kvm.c @@ -2939,3 +2939,12 @@ void kvmppc_set_reg_ppc_online(PowerPCCPU *cpu, unsi= gned int online) kvm_set_one_reg(cs, KVM_REG_PPC_ONLINE, &online); } } + +void kvmppc_set_reg_tb_offset(PowerPCCPU *cpu, int64_t tb_offset) +{ + CPUState *cs =3D CPU(cpu); + + if (kvm_enabled()) { + kvm_set_one_reg(cs, KVM_REG_PPC_TB_OFFSET, &tb_offset); + } +} diff --git a/target/ppc/kvm_ppc.h b/target/ppc/kvm_ppc.h index 45776cad79d9..e642aaaf9226 100644 --- a/target/ppc/kvm_ppc.h +++ b/target/ppc/kvm_ppc.h @@ -80,6 +80,7 @@ bool kvmppc_pvr_workaround_required(PowerPCCPU *cpu); bool kvmppc_hpt_needs_host_contiguous_pages(void); void kvm_check_mmu(PowerPCCPU *cpu, Error **errp); void kvmppc_set_reg_ppc_online(PowerPCCPU *cpu, unsigned int online); +void kvmppc_set_reg_tb_offset(PowerPCCPU *cpu, int64_t tb_offset); =20 #else =20 @@ -206,6 +207,10 @@ static inline void kvmppc_set_reg_ppc_online(PowerPCCP= U *cpu, return; } =20 +static inline void kvmppc_set_reg_tb_offset(PowerPCCPU *cpu, int64_t tb_of= fset) +{ +} + #ifndef CONFIG_USER_ONLY static inline bool kvmppc_spapr_use_multitce(void) {