From patchwork Fri Oct 1 17:11:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515075 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp1012519jaf; Fri, 1 Oct 2021 10:32:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIHyJzwR4PuJ/sJcUDQSdT2VQcos59mLC19MSrd68gseNeml13SD3jkltJOa+bVJh7S64f X-Received: by 2002:a1c:2209:: with SMTP id i9mr5936287wmi.67.1633109554747; Fri, 01 Oct 2021 10:32:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633109554; cv=none; d=google.com; s=arc-20160816; b=COvYsquqjmQChUYINW8D8FXYV3niN8DygE9hkcOlBd1rAxAV2zzbcDTh5egk0Xnx+O 1xUjnVwj9X8VEwTb8QAPoEHPQYDYwjb/GhgBNGVEn2ZqJRyfMeeu5t9akL+wWMd5Vjgy nVWEZtG7DS/oONTy8S6SXrqRxgoIlNaGonF1NN33bIkHNRRD77ejz3o7Gx6nqG6960R1 mLcCrs54kjElTKykEGvf6zcaQsdfZchNOPDnZPL21iPheK8scgr0noVsusM5ii7pyawN EfrHG+SgIZMqyFJBNbAsAvuaQrXxhfJYkZl4a3JVm2+QTdh546MoZSbTxfV2jnzneVME LYLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=A8ETRQBRZXwQK5lj7iW4qTnPhlNs9ObgZ0AlK9jyPww=; b=IuRu/t4ujEYTrofI7OHWGT6eR0VbNCf1H0DKT48v8YU8mAaGmcr3s4zTulD+RfrWLm iQwLy2S9yim84jOrTpfsN4bxSSBc7T5bA03JOQZA22uB0g/bRUAqobGeuPHkUjTto6P2 xdAWuKNa9RyTtNc4qBG8gja7ht8iCLtyNPRhDgeKaWfOxhjwI0y0gxcznJRxgPHnRnll 9D8iBWQ5vkM8A1KZhcn7SuERKqSt/hu2c8LGJzXDQmtkR3hkwnPUK7+G5dxti2cokL+r 39B2IpVLBgGhIArxriAm0Cw62KIMYDXU+CpZc373grE5YxD4jpKmqx/pVQDt+TdGsu6S dTHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=vFuynkTV; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f15si8452320wri.413.2021.10.01.10.32.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Oct 2021 10:32:34 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=vFuynkTV; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:39808 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWMOf-0003PB-MP for patch@linaro.org; Fri, 01 Oct 2021 13:32:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55718) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWM8B-000220-Mn for qemu-devel@nongnu.org; Fri, 01 Oct 2021 13:15:31 -0400 Received: from mail-qt1-x833.google.com ([2607:f8b0:4864:20::833]:34318) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWM89-0007mi-O6 for qemu-devel@nongnu.org; Fri, 01 Oct 2021 13:15:31 -0400 Received: by mail-qt1-x833.google.com with SMTP id m26so9655797qtn.1 for ; Fri, 01 Oct 2021 10:15:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=A8ETRQBRZXwQK5lj7iW4qTnPhlNs9ObgZ0AlK9jyPww=; b=vFuynkTVLmhgEsICW00TbB9HI3WxeIqySmsz7K+3vlRNUSkU3U3nOJHP2Hi4uY9vet oqyxTXHO8B7vfYnL6FE4dE4becBZzBFDx+CSL6HMQ2iKGqYUPYlOts3ccW2WRnUlfOHr 2td1Ae7Wf932SSPpmyajOVBOjk2GYIvTCOI6zDI8VlYFgR0kdsPyNRmfnT71MsbppZd2 CvBHBE/27FlaXjpnE3Z4Jc1qpF60hefcFxx5l0CMx8mMciTmPiKOYI5fTV8bIWFZd0Mm p1z4JVeQgu0QinDSVqk7i5hiGQteTPSaEZNGiyJ78Utz+dOHjXhwsTKKFZZ3OC+Kweb8 J6bA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=A8ETRQBRZXwQK5lj7iW4qTnPhlNs9ObgZ0AlK9jyPww=; b=KcPfj9PMW+so+7LJNBPAncd+mYAycZjdTZt6Cfb+zr7Id983518Tp/CxW5EZZgQeSY hvtgn7lYexPoYJCQPpAKz5sgU1Lor3ORO18/E+7eV4Y474DJzw/PpxLxs52XuMdSPSF5 gL2ou2gpbAr1PtqS/cTQeqv3ALVR4jY+87jA2s2JGpNOJoRgOREdFIDpgf/06yyld2kh ljnZjmRYmvozw/WC/RDouaz1LTfc4lCo3oROM5iL/wDS2kM3FGTczJW1P8WKeMYc9XHQ 79/QleVcO6vj+5+5vRjZjKb2gEgRxtIs+mq+ZhmwhcCiPSzMY5NthiUs8bsOmQSKqPHZ BJzQ== X-Gm-Message-State: AOAM530ia7Qf73tZwU07+oIxRgq5ih2O5kFmHhOs7wXGkqXjDLGPs0oH 1zKTP/rW2+fL8lREuqWktBKxXpBF3djDcA== X-Received: by 2002:a05:622a:147:: with SMTP id v7mr14435760qtw.212.1633108528818; Fri, 01 Oct 2021 10:15:28 -0700 (PDT) Received: from localhost.localdomain (c-67-174-166-185.hsd1.ga.comcast.net. [67.174.166.185]) by smtp.gmail.com with ESMTPSA id l5sm3697516qtq.4.2021.10.01.10.15.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 10:15:28 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 40/41] target/xtensa: Make xtensa_cpu_tlb_fill sysemu only Date: Fri, 1 Oct 2021 13:11:50 -0400 Message-Id: <20211001171151.1739472-41-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211001171151.1739472-1-richard.henderson@linaro.org> References: <20211001171151.1739472-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::833; envelope-from=richard.henderson@linaro.org; helo=mail-qt1-x833.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no 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: Max Filippov , alex.bennee@linaro.org, laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The fallback code in raise_sigsegv is sufficient for xtensa. Remove the code from cpu_loop that raised SIGSEGV. Cc: Max Filippov Signed-off-by: Richard Henderson --- target/xtensa/cpu.h | 2 +- linux-user/xtensa/cpu_loop.c | 9 --------- target/xtensa/cpu.c | 2 +- target/xtensa/helper.c | 22 +--------------------- 4 files changed, 3 insertions(+), 32 deletions(-) -- 2.25.1 Acked-by: Max Filippov Reviewed-by: Philippe Mathieu-Daudé diff --git a/target/xtensa/cpu.h b/target/xtensa/cpu.h index f9a510ca46..02143f2f77 100644 --- a/target/xtensa/cpu.h +++ b/target/xtensa/cpu.h @@ -563,10 +563,10 @@ struct XtensaCPU { }; +#ifndef CONFIG_USER_ONLY bool xtensa_cpu_tlb_fill(CPUState *cs, vaddr address, int size, MMUAccessType access_type, int mmu_idx, bool probe, uintptr_t retaddr); -#ifndef CONFIG_USER_ONLY void xtensa_cpu_do_interrupt(CPUState *cpu); bool xtensa_cpu_exec_interrupt(CPUState *cpu, int interrupt_request); void xtensa_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr, vaddr addr, diff --git a/linux-user/xtensa/cpu_loop.c b/linux-user/xtensa/cpu_loop.c index 622afbcd34..a83490ab35 100644 --- a/linux-user/xtensa/cpu_loop.c +++ b/linux-user/xtensa/cpu_loop.c @@ -226,15 +226,6 @@ void cpu_loop(CPUXtensaState *env) queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); break; - case LOAD_PROHIBITED_CAUSE: - case STORE_PROHIBITED_CAUSE: - info.si_signo = TARGET_SIGSEGV; - info.si_errno = 0; - info.si_code = TARGET_SEGV_ACCERR; - info._sifields._sigfault._addr = env->sregs[EXCVADDR]; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); - break; - default: fprintf(stderr, "exccause = %d\n", env->sregs[EXCCAUSE]); g_assert_not_reached(); diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index c1cbd03595..224f723236 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -192,10 +192,10 @@ static const struct SysemuCPUOps xtensa_sysemu_ops = { static const struct TCGCPUOps xtensa_tcg_ops = { .initialize = xtensa_translate_init, - .tlb_fill = xtensa_cpu_tlb_fill, .debug_excp_handler = xtensa_breakpoint_handler, #ifndef CONFIG_USER_ONLY + .tlb_fill = xtensa_cpu_tlb_fill, .cpu_exec_interrupt = xtensa_cpu_exec_interrupt, .do_interrupt = xtensa_cpu_do_interrupt, .do_transaction_failed = xtensa_cpu_do_transaction_failed, diff --git a/target/xtensa/helper.c b/target/xtensa/helper.c index f18ab383fd..29d216ec1b 100644 --- a/target/xtensa/helper.c +++ b/target/xtensa/helper.c @@ -242,27 +242,7 @@ void xtensa_cpu_list(void) } } -#ifdef CONFIG_USER_ONLY - -bool xtensa_cpu_tlb_fill(CPUState *cs, vaddr address, int size, - MMUAccessType access_type, int mmu_idx, - bool probe, uintptr_t retaddr) -{ - XtensaCPU *cpu = XTENSA_CPU(cs); - CPUXtensaState *env = &cpu->env; - - qemu_log_mask(CPU_LOG_INT, - "%s: rw = %d, address = 0x%08" VADDR_PRIx ", size = %d\n", - __func__, access_type, address, size); - env->sregs[EXCVADDR] = address; - env->sregs[EXCCAUSE] = (access_type == MMU_DATA_STORE ? - STORE_PROHIBITED_CAUSE : LOAD_PROHIBITED_CAUSE); - cs->exception_index = EXC_USER; - cpu_loop_exit_restore(cs, retaddr); -} - -#else /* !CONFIG_USER_ONLY */ - +#ifndef CONFIG_USER_ONLY void xtensa_cpu_do_unaligned_access(CPUState *cs, vaddr addr, MMUAccessType access_type, int mmu_idx, uintptr_t retaddr)