From patchwork Fri Jun 20 13:06:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 898304 Delivered-To: patch@linaro.org Received: by 2002:a5d:5f54:0:b0:3a4:ee3f:8f15 with SMTP id cm20csp1322862wrb; Fri, 20 Jun 2025 06:11:18 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXAq8xvXRxghMpUo+PoQgULDSvvcNAgIfVjUnb8qELVbWT/FRQSSJ43KkeSNp/rQdgwbowo5A==@linaro.org X-Google-Smtp-Source: AGHT+IGHj75nioOVIB8yLt/sh6bcJhFPL7iz/lkiCNR2GLIan/1kWjoOLSeYJcktGcMWfLGmuy3S X-Received: by 2002:a05:6214:4b0a:b0:6fa:ff96:2496 with SMTP id 6a1803df08f44-6fd0a4ad289mr46244626d6.11.1750425078429; Fri, 20 Jun 2025 06:11:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1750425078; cv=none; d=google.com; s=arc-20240605; b=Gt45i3gPo6i9p65Vl6+Sjnl0rXjsSb3v49kIdbjJasCVzH/RMPbs3HWRzVUCkqZJtp WVYl8YucVlAn26yLEbAByqRf+IB1RV1yq84qu0B3sI5GEZAJpFR9xo2rZFQF2pX4ptLz fkEfZTIL3GbXyNAIK5SSKWKmIgzMx+lBufetvfF9CQ6dAdTcFA/1YRSqvgL0C8dhSxnW bIyRxY9x4FvCDrE4TLHOe3dy1Gagjdv9l3TBVC4q/mQtyevZWdGL6F1+fXuddpkW+KFe 3J58wutdZSU1H+25UGXUMiIDBLj47QIZgTWcAXPXThtYjlbVurpzzNprDyOKg/cf7aRS wl2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=fZYVTt5RemOQGhErk/wxiT1GRcR8x45vVeqGw/eKctk=; fh=rvFFfFUeajrBSZUZbNRiqOinI+1sct87Q5T4lCmXKcc=; b=ZYbuBx2e4AN7ly4k+pk25XhI1CVY4s/Mvqt4/uPF4bZz49oe7uPCqoXXXYmG87zMby 8N4GCJ/g2w1EHyrzFNimDcNpeQowO7sUCagzhR89CmLML89oKQFLk+BNOwJWmWYRQFaW mev6mYmxjNWst0DRkyVA7uER+afoOIgjgerKs/ndoUURh9UOg9CVz707dIWBYNq6n7BG /Dn8t5goQBZcWLNsGbKuB070SCb3hpxXm6m7tgpGx0T2/am/JAWaZVyPKm0e1nuHVfLR cdo0AbqE/JyygTNAZJHPrJUQPs/d7E4LS+4gXMrxxeAqGMH+FDqGK/5r8LlF8W/V6qCq ha5A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NwF6LY1g; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6fd095957e1si20595016d6.364.2025.06.20.06.11.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Jun 2025 06:11:18 -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=NwF6LY1g; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uSbTk-00038Y-3E; Fri, 20 Jun 2025 09:08:24 -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 1uSbTi-00037m-2X for qemu-devel@nongnu.org; Fri, 20 Jun 2025 09:08:22 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uSbTc-0004dY-PW for qemu-devel@nongnu.org; Fri, 20 Jun 2025 09:08:21 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-450cf214200so17544345e9.1 for ; Fri, 20 Jun 2025 06:08:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1750424895; x=1751029695; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fZYVTt5RemOQGhErk/wxiT1GRcR8x45vVeqGw/eKctk=; b=NwF6LY1gkY0jTrfmu8pocegTrmHtCD0rHvvz7dh65JpW0BOgmBQE44lv5wvOZn5NMO pPb1cN1/x/G7j4GgCyVgvpuY7xZn1A3aG2+oRoAGU96rbJTa9VAm+Fr7YwYl//cdrmjR 2Cx1eMzjaWP7nx+laOt1teHHXqCIwdKG1F6d4DYLwnc2UdPwBSof9k9Q+lYqgKQIhx0z TuD5ayVUvjfRgGRR6T0UVDYpK36pqNTZmpbdsGE4hT+R/p+V28H2URxRzz0VDUwaoYdB aJ0rfbr+AnLtGoVwL+z8+B0xrFpp3lV1FpVrMW/zeqqmht2ewodUukDpYWfq4oHkFLHT 7tFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750424895; x=1751029695; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fZYVTt5RemOQGhErk/wxiT1GRcR8x45vVeqGw/eKctk=; b=lc5PzNdlbLUexF0iuSnC0ycHUQk10Vp5lIdf9WGZiLRck0Dbv46DxnK9DBxtAgPAC1 YRZf9fB+7T3W0smpULLrbdZ1Hk6BxEh49Lwi6FwBUnV8yYVxZyuuZhp5ybVSh6o8kRTt ZjPjXHC4SfH2XvLwMW1uB5//JJq7kRRU3H+0BU2fTHQBFfek8Mll8ugEgO7rE5pERxGc dsQRsbA/9uIr7pfmzpFhLczuffUSOFfd/csuw+aSiEzjFgXlCIURFuQ0Z7c4XH4X0Pa7 0MfflqhzI+0kaBXVHJKQ5Z3JsYtEaKiJnmt6IihtCI4nNt0lBE8Hd2676+GD0s+c/DYT X/UQ== X-Gm-Message-State: AOJu0YwjxZeli3BeVQiYWtPiR/8djR0HEkA010TE7xyRY6JQ7w/XLUiE z9aAEMgFKlzvgreaA4NkQGBQJHlLh5pRTguvui/uPLq2c1xu232BVTVbF9DoW1nyQa4Df1BfGJ4 pRnvOR14= X-Gm-Gg: ASbGncsvPzyoOSVCm0MyMPAQq0K7BvsgJ7ceanr5OizPBZjgtHyma47gNsvdk2m708H bdnYqW8bQdj0FWTX/WIw0ibvu3Co1UysEFOAPdNy328PcvsDfFjE1qMicjgR66SMcxQRBvtEvHo fot1YrGYKH6DSRMqGPao6kV3H0RHpoQkUhUtM9xN+eutE+4cIKHxE3x+F69F+dVCtkByq6Edld1 ww3EArRo9mjrUvgm/ZRpQ+7Gi0dshioHOHjVM5KF+3EXwrkG5zgwFCGuylbP9v2nSvVIhY4zDVc gsDGE/H21phR/gVuFzERHEvPscuTPaEqBhKNX4bpSFQPnmipQ4EsoeuhO8MYSCBNfsl3bq9eWgA HWF+6+Sdn0oJlvbEQgxUQ49ZMMWDDJxzelsYt4Bt2i6SjBgc= X-Received: by 2002:a05:600c:1f94:b0:439:9424:1b70 with SMTP id 5b1f17b1804b1-45365a05192mr27153005e9.30.1750424894423; Fri, 20 Jun 2025 06:08:14 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a6d117c663sm2084326f8f.64.2025.06.20.06.08.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Jun 2025 06:08:13 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Leif Lindholm , Richard Henderson , Radoslaw Biernacki , Alexander Graf , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Phil Dennis-Jordan , =?utf-8?q?Alex_Benn=C3=A9e?= , Bernhard Beschow , Cleber Rosa , Peter Maydell , Cameron Esfahani , kvm@vger.kernel.org, qemu-arm@nongnu.org, Eric Auger , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Thomas Huth , Roman Bolshakov , John Snow Subject: [PATCH v2 11/26] target/arm/hvf: Pass @target_el argument to hvf_raise_exception() Date: Fri, 20 Jun 2025 15:06:54 +0200 Message-ID: <20250620130709.31073-12-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250620130709.31073-1-philmd@linaro.org> References: <20250620130709.31073-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org In preparation of raising exceptions at EL2, add the 'target_el' argument to hvf_raise_exception(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/arm/hvf/hvf.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index 5169bf6e23c..b932134a833 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -1089,13 +1089,13 @@ void hvf_kick_vcpu_thread(CPUState *cpu) } static void hvf_raise_exception(CPUState *cpu, uint32_t excp, - uint32_t syndrome) + uint32_t syndrome, int target_el) { ARMCPU *arm_cpu = ARM_CPU(cpu); CPUARMState *env = &arm_cpu->env; cpu->exception_index = excp; - env->exception.target_el = 1; + env->exception.target_el = target_el; env->exception.syndrome = syndrome; arm_cpu_do_interrupt(cpu); @@ -1454,7 +1454,7 @@ static int hvf_sysreg_read(CPUState *cpu, uint32_t reg, uint64_t *val) SYSREG_CRN(reg), SYSREG_CRM(reg), SYSREG_OP2(reg)); - hvf_raise_exception(cpu, EXCP_UDEF, syn_uncategorized()); + hvf_raise_exception(cpu, EXCP_UDEF, syn_uncategorized(), 1); return 1; } @@ -1760,7 +1760,7 @@ static int hvf_sysreg_write(CPUState *cpu, uint32_t reg, uint64_t val) SYSREG_CRN(reg), SYSREG_CRM(reg), SYSREG_OP2(reg)); - hvf_raise_exception(cpu, EXCP_UDEF, syn_uncategorized()); + hvf_raise_exception(cpu, EXCP_UDEF, syn_uncategorized(), 1); return 1; } @@ -1963,7 +1963,7 @@ int hvf_vcpu_exec(CPUState *cpu) if (!hvf_find_sw_breakpoint(cpu, env->pc)) { /* Re-inject into the guest */ ret = 0; - hvf_raise_exception(cpu, EXCP_BKPT, syn_aa64_bkpt(0)); + hvf_raise_exception(cpu, EXCP_BKPT, syn_aa64_bkpt(0), 1); } break; } @@ -2074,7 +2074,7 @@ int hvf_vcpu_exec(CPUState *cpu) } } else { trace_hvf_unknown_hvc(env->pc, env->xregs[0]); - hvf_raise_exception(cpu, EXCP_UDEF, syn_uncategorized()); + hvf_raise_exception(cpu, EXCP_UDEF, syn_uncategorized(), 1); } break; case EC_AA64_SMC: @@ -2089,7 +2089,7 @@ int hvf_vcpu_exec(CPUState *cpu) } } else { trace_hvf_unknown_smc(env->xregs[0]); - hvf_raise_exception(cpu, EXCP_UDEF, syn_uncategorized()); + hvf_raise_exception(cpu, EXCP_UDEF, syn_uncategorized(), 1); } break; default: