From patchwork Tue Nov 2 11:07:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 516664 Delivered-To: patch@linaro.org Received: by 2002:ad5:5208:0:0:0:0:0 with SMTP id p8csp4425892iml; Tue, 2 Nov 2021 04:43:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxz7gP2IDlQvxydNlSYWsGVeKJN3o8ElTEMfeqLD4d1TVH1QXWyq2aoLySmdPMBo/l7lP/G X-Received: by 2002:a05:6830:18d:: with SMTP id q13mr26150139ota.264.1635853416914; Tue, 02 Nov 2021 04:43:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635853416; cv=none; d=google.com; s=arc-20160816; b=RLiPKD/tmZEtUg9XXmX9OkdkjSNINC8KwTnfKyiYxYo+FHJFkXTllS09RVd5Esp15B iFzQKdSWDNT/sVaqeP+yFbUQHOMumk4+ssbOad1SWzAEFOkS80OIbL+K2VhL9XPRPPAB LUyxziL9IvUQPifMqNEhIsiH84kZRkA47LGamc56XujVTZVVMIQZ5mId+0+8+LgrAXqG sDEB8MkXUiSqTmm60ciPqcp6YJ50uMu6krAG1dR/llB5HLq8hTVagUYEejOGva/WBLmA g4Kc+twNETVXYhSZU1mL9mNQtB1MGo3rSlENdMsMwd4In8DpwUxAR6gkEGyduX046ipx K5TA== 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=kAcqfrBKLTctf7S2SRnWlKvQ84+gE9eIlExzwRxWIv4=; b=UcOsGkuxuoVb0NYf6NkOMob3Kp3WtIiMBGVwrKg3O6W7jfbd5a2jupKxbM/Eo3NQhQ sWw8uhIhzFQqHUDX3L1XEpT02gp5ui6IOHaccK5nshsvQ8Pr+PIjEWBy7KwCMpXFbPOk /KFS+IvlMW16QTRflCWIW77HUVG5joomui6W8biZ9cs5uR/86/SlOHuqKX3wL6e0YuUK vPWsFJlF37O1MBCphQjOejI+9dNo2LXJ4EswivwJFRTmf/gprDXj5jx7RxdauAmFMR/D BZvPXQMtlpfKydcHlFM5T8ULlaE2jHRX1qlelQ1QrJcVO7X7YPP/1T31eV5Zu9rXcBz+ qv7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vQL3GNIm; 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=pass (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 w25si726703otq.23.2021.11.02.04.43.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 02 Nov 2021 04:43:36 -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=pass header.i=@linaro.org header.s=google header.b=vQL3GNIm; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:52074 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mhsCW-00073b-2g for patch@linaro.org; Tue, 02 Nov 2021 07:43:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44456) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhrh8-0001CA-0g for qemu-devel@nongnu.org; Tue, 02 Nov 2021 07:11:10 -0400 Received: from mail-qk1-x732.google.com ([2607:f8b0:4864:20::732]:34346) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mhrh5-0001uA-Sj for qemu-devel@nongnu.org; Tue, 02 Nov 2021 07:11:09 -0400 Received: by mail-qk1-x732.google.com with SMTP id bq14so7754940qkb.1 for ; Tue, 02 Nov 2021 04:11:06 -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=kAcqfrBKLTctf7S2SRnWlKvQ84+gE9eIlExzwRxWIv4=; b=vQL3GNImmjm6ZYIT/J4mlwVLm4keuGkZF/RH6BBGw8Cg7obNQsqj97ScwVW5GjaUtG pmNRd3b01f78YlZ84RzM9EbkcXtCbjF1ulBHQEvlBtrZyrnqoEq5Qzbx5W/8rnseBKDB qqjnS51kFi0Dm57baaScz66oBccPRk5IDlT6Xd6HvBjJVBJdPbFUlRMV6vIosdmiwJOW qdLk/uhIcw56TJSnfddkMDeU0y85Zbs9sEwOPNx41BX60gitNK75tq2Yf4EfxeD4rfAW we73O+Eenk48GWQaswbbRSShh2htaWUyV8ipKW0C0kj1nOiGra2HH0QIhF3L+rebj6wP /oHA== 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=kAcqfrBKLTctf7S2SRnWlKvQ84+gE9eIlExzwRxWIv4=; b=Xfr9NsX6/wr19CZ3OiYx73oE99zmirQSXrNg+gr0B7PFdOD98Lv2LAOWlHxnU7wvsL 09hIEK6qbehgUr0WX/woATb9EFkstJURZugZ8nL1oT+7FslapcX2HBYYXYAoe4Agtt/2 moyvQyKexMvsK+3NcqjEkuN1BT/dmYEIXcLFpyxhtyS5u6xcA/AHNi0eRJbRqaHKKyHY KIFOiwfHz0Entcgywh8ogP1jHXgRniZXp6VJtYHHi3/VPGE9PHIYBbj7r93pnkZ5Fpx+ 48UYlllrIIuUvOXiePVVcRYzAa9cjNArfNM0UZl5Tvb7+FLCoFCumL+uRBoiWOaNVHid ynlw== X-Gm-Message-State: AOAM533WSh3tY1qomaOtjDzimmAGFjpyBPlKPOKlU1ZPbVVE9uRgvKDW HEhc4ZL1Rz3POY5vwT9IyPp34GN/+tWQHw== X-Received: by 2002:a37:f60c:: with SMTP id y12mr14098419qkj.407.1635851465581; Tue, 02 Nov 2021 04:11:05 -0700 (PDT) Received: from localhost.localdomain (rrcs-172-254-253-57.nyc.biz.rr.com. [172.254.253.57]) by smtp.gmail.com with ESMTPSA id bm25sm12730854qkb.4.2021.11.02.04.11.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 04:11:05 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 40/60] target/xtensa: Make xtensa_cpu_tlb_fill sysemu only Date: Tue, 2 Nov 2021 07:07:20 -0400 Message-Id: <20211102110740.215699-41-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211102110740.215699-1-richard.henderson@linaro.org> References: <20211102110740.215699-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::732; envelope-from=richard.henderson@linaro.org; helo=mail-qk1-x732.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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Filippov , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The fallback code in cpu_loop_exit_sigsegv is sufficient for xtensa linux-user. Remove the code from cpu_loop that raised SIGSEGV. Acked-by: Max Filippov Reviewed-by: Philippe Mathieu-Daudé 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 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)