From nobody Tue Feb 10 11:15:38 2026 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) 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; dkim=fail; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1557441494; cv=none; d=zoho.com; s=zohoarc; b=oIT8kEbRCqjWM7s8vEb0pVnTIa2zHZveWVF5YaRnKHHHPkckX9r6lXD9BZicOrhm0wundoK4PK9FOLvKQfEYyNSlSXuBzU0dhRApnJhvfgedMuhVE2BWnm/w3LvtYvdnpT1NDMv/5SQZCRJfiYxoU5/pFB/tFOk3OstiMIKvWiw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557441494; h=Content-Type:Content-Transfer-Encoding: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=w7l/Pbs/dkuyE6y60mYyZzngNGSZYjs+O6jEPehbb2U=; b=B5ZxMAZNxlZiPtoVmndiJo97GjT3L/12FZKYNWyB4kJo4YZyrCTcB8LLLbQyYO1domdDV55WtOQWw2fuxBkdwUNL9aYKhoJu6yNbJ5rx4RDCZOHNQQl9kS5Q8J3l5a7vFwWEyO5PGELYkD8LNssPUyfNwSVWrCNlZ3WT/dsqrBc= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557441494492443.87063332463015; Thu, 9 May 2019 15:38:14 -0700 (PDT) Received: from localhost ([127.0.0.1]:33587 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOrfr-0000oO-8r for importer@patchew.org; Thu, 09 May 2019 18:37:59 -0400 Received: from eggs.gnu.org ([209.51.188.92]:32885) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOrUx-0007aB-Bu for qemu-devel@nongnu.org; Thu, 09 May 2019 18:26:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hOrUw-0005Qr-1c for qemu-devel@nongnu.org; Thu, 09 May 2019 18:26:43 -0400 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:39155) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hOrUv-0005P2-RY for qemu-devel@nongnu.org; Thu, 09 May 2019 18:26:41 -0400 Received: by mail-pg1-x544.google.com with SMTP id w22so1921338pgi.6 for ; Thu, 09 May 2019 15:26:41 -0700 (PDT) Received: from localhost.localdomain (97-113-13-231.tukw.qwest.net. [97.113.13.231]) by smtp.gmail.com with ESMTPSA id m2sm4490521pfi.24.2019.05.09.15.26.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 May 2019 15:26:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=w7l/Pbs/dkuyE6y60mYyZzngNGSZYjs+O6jEPehbb2U=; b=TtW+NYNDOszgF0iWYwepmGwixWdz2R6GPuo/Te+ipyW7AK4r89WXiwtAc2KhtLrZip GTK1dCsyCdQouNJSChFf+8eYhk6o3NSxm+oR7saVWTUzAejQO+sSIrRfoJJYKQEwDOn4 qN0Fkp6dYvuUUMez+S8MT4EGDbYBT/nBFV62IIbA06UvVbNFQ3MJQQ7n3Z1rW9CAmGbT 5fX22i/wtDuSl0jJSnMD8az7oKpslmFQExc4n1cf9R2dduW2+N79qoZl7bTs3MbEeYPw 6TeChUd8As8VZyIS2jyfLO3IxOMoR2UImr0r3lEmXMU8OSO/v2gpL8oGK3fMn8nJ47IA FKgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=w7l/Pbs/dkuyE6y60mYyZzngNGSZYjs+O6jEPehbb2U=; b=rCj+jnxloqnpyfrWWeBuN+B6/K43krilAr5Ai1LZVXGFU0IR+K/9F45sp62vvHE8wS JLOzFshRH9tDyQBIFBAbb8o+fzc6OnqZL7540gzxymfe8xqSdCI1g/ZFuSWUWUJD+/ri Ws2o5a82P4dC5hkBI5Q6jrx10Ne/Q0Qi6sWdnmFlI1kkLGBoCEXTB7ISeYyJ1Enn87UH xsN+1kuPscTckBoumRbqyCagFMZb731Sj4tWnxhy1RMPcwBBcLYeTAZjt/eCImmZTztw DERuKk1z/Mf7c3bKqX1etpxk+TmL07cF80wOY45G3/RmSFAVwGx04CVRcnSyWwbA5tvb ZrAg== X-Gm-Message-State: APjAAAVmGtUwqcYZ5AdMWGMoLxERTjP7krZCO/tkueusK7MdUQaLeNgu 01NjpYz2bwhyH2obAluGQHk0ZB60fh4= X-Google-Smtp-Source: APXvYqyhhjn6Q5MO1NyJyKIPhkIM0CItcGpI8IDy6bO2GvgroKMBOlb9DjoIqn/C45JEjsnOjFbNSA== X-Received: by 2002:a63:2bc8:: with SMTP id r191mr8957557pgr.72.1557440800397; Thu, 09 May 2019 15:26:40 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 9 May 2019 15:26:09 -0700 Message-Id: <20190509222631.14271-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190509222631.14271-1-richard.henderson@linaro.org> References: <20190509222631.14271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::544 Subject: [Qemu-devel] [PATCH v3 05/27] target/hppa: Convert to CPUClass::tlb_fill 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/hppa/cpu.h | 8 ++++---- target/hppa/cpu.c | 5 ++--- target/hppa/mem_helper.c | 22 +++++++++++++++++----- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 923346adb6..c1e0215e66 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -360,10 +360,10 @@ int hppa_cpu_gdb_write_register(CPUState *cpu, uint8_= t *buf, int reg); void hppa_cpu_do_interrupt(CPUState *cpu); bool hppa_cpu_exec_interrupt(CPUState *cpu, int int_req); void hppa_cpu_dump_state(CPUState *cs, FILE *f, int); -#ifdef CONFIG_USER_ONLY -int hppa_cpu_handle_mmu_fault(CPUState *cpu, vaddr address, int size, - int rw, int midx); -#else +bool hppa_cpu_tlb_fill(CPUState *cs, vaddr address, int size, + MMUAccessType access_type, int mmu_idx, + bool probe, uintptr_t retaddr); +#ifndef CONFIG_USER_ONLY int hppa_get_physical_address(CPUHPPAState *env, vaddr addr, int mmu_idx, int type, hwaddr *pphys, int *pprot); extern const MemoryRegionOps hppa_io_eir_ops; diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index e64f48581e..9717ea1798 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -163,9 +163,8 @@ static void hppa_cpu_class_init(ObjectClass *oc, void *= data) cc->synchronize_from_tb =3D hppa_cpu_synchronize_from_tb; cc->gdb_read_register =3D hppa_cpu_gdb_read_register; cc->gdb_write_register =3D hppa_cpu_gdb_write_register; -#ifdef CONFIG_USER_ONLY - cc->handle_mmu_fault =3D hppa_cpu_handle_mmu_fault; -#else + cc->tlb_fill =3D hppa_cpu_tlb_fill; +#ifndef CONFIG_USER_ONLY cc->get_phys_page_debug =3D hppa_cpu_get_phys_page_debug; dc->vmsd =3D &vmstate_hppa_cpu; #endif diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index 77fb544838..5cee0c19b1 100644 --- a/target/hppa/mem_helper.c +++ b/target/hppa/mem_helper.c @@ -25,8 +25,9 @@ #include "trace.h" =20 #ifdef CONFIG_USER_ONLY -int hppa_cpu_handle_mmu_fault(CPUState *cs, vaddr address, - int size, int rw, int mmu_idx) +bool hppa_cpu_tlb_fill(CPUState *cs, vaddr address, int size, + MMUAccessType access_type, int mmu_idx, + bool probe, uintptr_t retaddr) { HPPACPU *cpu =3D HPPA_CPU(cs); =20 @@ -34,7 +35,7 @@ int hppa_cpu_handle_mmu_fault(CPUState *cs, vaddr address, which would affect si_code. */ cs->exception_index =3D EXCP_DMP; cpu->env.cr[CR_IOR] =3D address; - return 1; + cpu_loop_exit_restore(cs, retaddr); } #else static hppa_tlb_entry *hppa_find_tlb(CPUHPPAState *env, vaddr addr) @@ -213,8 +214,9 @@ hwaddr hppa_cpu_get_phys_page_debug(CPUState *cs, vaddr= addr) return excp =3D=3D EXCP_DTLB_MISS ? -1 : phys; } =20 -void tlb_fill(CPUState *cs, target_ulong addr, int size, - MMUAccessType type, int mmu_idx, uintptr_t retaddr) +bool hppa_cpu_tlb_fill(CPUState *cs, vaddr addr, int size, + MMUAccessType type, int mmu_idx, + bool probe, uintptr_t retaddr) { HPPACPU *cpu =3D HPPA_CPU(cs); CPUHPPAState *env =3D &cpu->env; @@ -236,6 +238,9 @@ void tlb_fill(CPUState *cs, target_ulong addr, int size, excp =3D hppa_get_physical_address(env, addr, mmu_idx, a_prot, &phys, &prot); if (unlikely(excp >=3D 0)) { + if (probe) { + return false; + } trace_hppa_tlb_fill_excp(env, addr, size, type, mmu_idx); /* Failure. Raise the indicated exception. */ cs->exception_index =3D excp; @@ -252,6 +257,13 @@ void tlb_fill(CPUState *cs, target_ulong addr, int siz= e, /* Success! Store the translation into the QEMU TLB. */ tlb_set_page(cs, addr & TARGET_PAGE_MASK, phys & TARGET_PAGE_MASK, prot, mmu_idx, TARGET_PAGE_SIZE); + return true; +} + +void tlb_fill(CPUState *cs, target_ulong addr, int size, + MMUAccessType type, int mmu_idx, uintptr_t retaddr) +{ + hppa_cpu_tlb_fill(cs, addr, size, type, mmu_idx, false, retaddr); } =20 /* Insert (Insn/Data) TLB Address. Note this is PA 1.1 only. */ --=20 2.17.1