From patchwork Sat Oct 5 15:25:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 1993072 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=WaYS7GWA; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XLTsR3G2Rz1xtH for ; Sun, 6 Oct 2024 01:31:23 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sx6fO-0001xf-Tf; Sat, 05 Oct 2024 11:25:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sx6fM-0001wI-ET for qemu-devel@nongnu.org; Sat, 05 Oct 2024 11:25:56 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sx6fK-0002K6-Ho for qemu-devel@nongnu.org; Sat, 05 Oct 2024 11:25:56 -0400 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-20ba6b39a78so22639445ad.3 for ; Sat, 05 Oct 2024 08:25:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728141953; x=1728746753; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=wpFwx2+B2oxOHc6b6hBqiIP5nn07TpsAOahnQ7H73ek=; b=WaYS7GWABBpJCmL2badTB3X8oDCApJytvJ1k5qNwlUHCdtt8Qg+X6ooMdnVw548zWi f/Txq6XoKy+4rVopvf7rOpbCS0wqPInL96sRicrjzB+/1emcv6YPT9UzKWXaqzUymRrC JhTTHch+43uP8LtefNAgNrHCDLcOrGW5J954Sj8ytAVdZh3/TNQnmuK44JxLPwBCRvS9 Bsm3JOuhsnQqOOzMXuShzsFhSavSWGArsSaex3o+f2dYeICYNLyzailA6uV4Ea0xc3/r DZvd+BBfz/on65T89bhnI4HOwgdsxS9+kGaKi7EseoJEgznd1/LFqxlmNsT13/S4qtWs mjiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728141953; x=1728746753; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wpFwx2+B2oxOHc6b6hBqiIP5nn07TpsAOahnQ7H73ek=; b=C1rN9anu+adGAIAruYazIeehkTxN2o37YK5Gy3IRzmneyb5IYqiJ1aDSR5LHNqLI40 C882jDQJpbJ0HTAnT/m8tJEmhCeOJJiJBZEtKt0ziDYEGSM8pSn5OoIuRJMFcv0OYyDN VA4cxEp9STAANIupJ+/KLNHpOwo9WoM4CgVNV4zDo4X4S1NZe8JgUSyOwa0YtVRGf2uJ TB9SmtKTuwRlhxWPULsHwA5dfnqHufHb1h306Nu8i7p8YhWDGRzb22U26v4024b3K6k+ UyEILd87X6kh1x6K2gUO85dcZw2SsTLM79n+Imx4I94g7SbzrfbEASirehnXEaNejZ5n oZsg== X-Gm-Message-State: AOJu0YzbLOnEwOthi9JhpWZ8IFZDHs+ijVTttghIc1k+0vI4K/vSDy6Z IkNCoS1p9E8iaVmjPDOAQ48MQkLgos2HxHcQDqnQmQ6ww+ge0GP31f37nE0qeZ1TpQ/mJak0KU8 1 X-Google-Smtp-Source: AGHT+IHPXsFE7R6jjgtrThFRIybCkI51Eu2ER9DX0AbZAMTqrYQ1cs+3WLCHNSwkVb8nGfrYpNWUSg== X-Received: by 2002:a17:902:f548:b0:20b:96e:8e65 with SMTP id d9443c01a7336-20bff1a8b43mr85517295ad.42.1728141952853; Sat, 05 Oct 2024 08:25:52 -0700 (PDT) Received: from stoup.. (174-21-81-121.tukw.qwest.net. [174.21.81.121]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20c1396948dsm14351765ad.225.2024.10.05.08.25.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 08:25:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@kernel.org, peter.maydell@linaro.org, alex.bennee@linaro.org, linux-parisc@vger.kernel.org, qemu-arm@nongnu.org Subject: [PATCH 00/20] accel/tcg: Introduce tlb_fill_align hook Date: Sat, 5 Oct 2024 08:25:31 -0700 Message-ID: <20241005152551.307923-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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=unavailable 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: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This new hook will allow targets to recognize an alignment fault with the correct priority with respect to other faults that can be raised by paging. This should fix several hppa fault priority issues, most importantly that access permissions come before alignment. This should fix the documented error in the Arm alignment fault due to memory type. r~ Richard Henderson (20): accel/tcg: Assert noreturn from write-only page for atomics accel/tcg: Expand tlb_fill for 3 callers include/exec/memop: Move get_alignment_bits from tcg.h include/exec/memop: Rename get_alignment_bits include/exec/memop: Introduce memop_atomicity_bits hw/core/tcg-cpu-ops: Introduce tlb_fill_align hook accel/tcg: Use the tlb_fill_align hook target/hppa: Add MemOp argument to hppa_get_physical_address target/hppa: Perform access rights before protection id check target/hppa: Fix priority of T, D, and B page faults target/hppa: Handle alignment faults in hppa_get_physical_address target/hppa: Add hppa_cpu_tlb_fill_align target/arm: Pass MemOp to get_phys_addr target/arm: Pass MemOp to get_phys_addr_with_space_nogpc target/arm: Pass MemOp to get_phys_addr_gpc target/arm: Pass MemOp to get_phys_addr_nogpc target/arm: Pass MemOp through get_phys_addr_twostage target/arm: Pass MemOp to get_phys_addr_lpae target/arm: Move device detection earlier in get_phys_addr_lpae target/arm: Fix alignment fault priority in get_phys_addr_lpae include/exec/memop.h | 47 +++++++++++ include/hw/core/tcg-cpu-ops.h | 25 ++++++ include/tcg/tcg.h | 23 ------ target/arm/internals.h | 6 +- target/hppa/cpu.h | 5 +- accel/tcg/cputlb.c | 142 +++++++++++++++++---------------- accel/tcg/user-exec.c | 4 +- target/alpha/cpu.c | 1 + target/arm/cpu.c | 1 + target/arm/helper.c | 4 +- target/arm/ptw.c | 139 ++++++++++++++++++-------------- target/arm/tcg/cpu-v7m.c | 1 + target/arm/tcg/m_helper.c | 8 +- target/arm/tcg/tlb_helper.c | 2 +- target/arm/tcg/translate-a64.c | 4 +- target/avr/cpu.c | 1 + target/hppa/cpu.c | 1 + target/hppa/int_helper.c | 2 +- target/hppa/mem_helper.c | 50 ++++++++---- target/hppa/op_helper.c | 2 +- target/i386/tcg/tcg-cpu.c | 1 + target/loongarch/cpu.c | 1 + target/m68k/cpu.c | 1 + target/microblaze/cpu.c | 1 + target/mips/cpu.c | 1 + target/openrisc/cpu.c | 1 + target/ppc/cpu_init.c | 1 + target/riscv/tcg/tcg-cpu.c | 1 + target/rx/cpu.c | 1 + target/s390x/cpu.c | 1 + target/sh4/cpu.c | 1 + target/sparc/cpu.c | 1 + target/tricore/cpu.c | 1 + target/xtensa/cpu.c | 1 + target/xtensa/translate.c | 2 +- tcg/tcg-op-ldst.c | 6 +- tcg/tcg.c | 2 +- tcg/arm/tcg-target.c.inc | 4 +- tcg/sparc64/tcg-target.c.inc | 2 +- 39 files changed, 302 insertions(+), 196 deletions(-)