From nobody Mon Feb 9 11:06:34 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1587475372; cv=none; d=zohomail.com; s=zohoarc; b=X69WFHvZP0Nxgopi2zIiCILgpyk1b3jYY6ZnjpXMKG8Ft0wb/6A+3RBRHWAJG0ME8/LUlPq6wEyrg0zzTYrlGYgMffG4e0UGQQpCDMD7dvDIWawiKqImuCzN5SA4YvzafXsSZmNmams7xqc7z+H91mkbMAzL3WnxwnkOX0eCtas= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587475372; h=Content-Type:Content-Transfer-Encoding:Cc: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; bh=uMFN46GGJRGQBe/rYYHHm3lwuDss4tLS+w7l4aZddpQ=; b=laDGXErkPij3H5EEOwTvqeXiagTjwPOpcT1L1QZZ/CgOmgFEDE17q1MgFF5ZQ5oL+cpuhVF1iAr9HXHM0CrJ3UcLo5gYNRcx6Qzwf2TwIdogFFdTI/n4B11uqgfEBHv2kpi1JTq8/FjFdvabPHBWY/DVL2AzlM5/2HWRXo6DZzk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) 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 (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1587475372173386.3360668062254; Tue, 21 Apr 2020 06:22:52 -0700 (PDT) Received: from localhost ([::1]:58316 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQsrS-0005ND-RH for importer@patchew.org; Tue, 21 Apr 2020 09:22:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48378) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQsoO-0000wD-3T for qemu-devel@nongnu.org; Tue, 21 Apr 2020 09:19:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jQsoN-0007NK-GP for qemu-devel@nongnu.org; Tue, 21 Apr 2020 09:19:39 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:58837 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jQsoN-0007LR-3X for qemu-devel@nongnu.org; Tue, 21 Apr 2020 09:19:39 -0400 Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-466-QbP3bM4lOXm6WTdX5T33ow-1; Tue, 21 Apr 2020 09:19:35 -0400 Received: by mail-wr1-f71.google.com with SMTP id p16so7470949wro.16 for ; Tue, 21 Apr 2020 06:19:35 -0700 (PDT) Received: from x1w.redhat.com (116.red-83-42-57.dynamicip.rima-tde.net. [83.42.57.116]) by smtp.gmail.com with ESMTPSA id t16sm4307074wrb.8.2020.04.21.06.19.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2020 06:19:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587475178; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uMFN46GGJRGQBe/rYYHHm3lwuDss4tLS+w7l4aZddpQ=; b=Ob69b3JNJIcAnudEgSWXy2wp9EPlceo+q9763wIYBcks0f9Q/EMhXTzGomztgVbS+DynLv T+ADxmsEf9v/EVP6/Z264aCEqQA6R2Q6H1EIGmbnJBJje5iYYX2wP1fKsntmx0qinaUPBf Opl0dAqCd3QjFPKJDYU3rhzdCvRaUnk= X-MC-Unique: QbP3bM4lOXm6WTdX5T33ow-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ae/4+1sN6db4JUzTalWSGb//t3m1oKTsE7xQyTnypSQ=; b=MzEIGQbfxbT2SfQ22eMLX+F92EsUmStTfq42Icx4kRg6TDSHrPRsL4tBWQWCnhz9aF UYCDy6hGtv0KG2EyNaD4S7T4HpvrWIJEXOoOsiEhF+yKVmovZUXZom4vZX5MW1Tq5+BG nzmgwDaeoAgYxxcIPLbRakg4VNSevch/1/KXwWlux7oKj/G1k61Awlz1561r8RVwesa0 ZKAsjWkxq4IfDp9rTUgwzMQalVo5CvFK+pYeSGBGlPEkh2kOkC6v/u41rOiKeYZdAgiz U61saXgz9GVyvdVaJqCuWDookqoZWmhPkydGWylfSpx5Sy4zoPoJEH2GGtlt7lnHUKEs HBLw== X-Gm-Message-State: AGi0PubiSyG9wq22C/pDQRBYXW8pbHFiqxq+Zh8oRoBFH/MRkyvTmuvx F/CF93sqzu/pI4RTgcMckCjvvkM0JA6uFJWqweqisrnguStB8ePAQaGm6lKDHetGSP1HbRiYkS5 pcVBOZgOvv8sYroI= X-Received: by 2002:a1c:154:: with SMTP id 81mr4819469wmb.48.1587475173853; Tue, 21 Apr 2020 06:19:33 -0700 (PDT) X-Google-Smtp-Source: APiQypLHPuElbADy4mspBGKtfKCwZM91kYTJTe3uodBw9u/qXg53Z5lnxWy+W/ZDj504BwBLoLYMkQ== X-Received: by 2002:a1c:154:: with SMTP id 81mr4819454wmb.48.1587475173622; Tue, 21 Apr 2020 06:19:33 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 1/6] target/arm: Restric the Address Translate write operation to TCG accel Date: Tue, 21 Apr 2020 15:19:21 +0200 Message-Id: <20200421131926.12116-2-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200421131926.12116-1-philmd@redhat.com> References: <20200421131926.12116-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.120; envelope-from=philmd@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/21 03:31:23 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.120 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: Peter Maydell , qemu-arm@nongnu.org, Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Under KVM these registers are written by the hardware. Restrict the writefn handlers to TCG to avoid when building without TCG: LINK aarch64-softmmu/qemu-system-aarch64 target/arm/helper.o: In function `do_ats_write': target/arm/helper.c:3524: undefined reference to `raise_exception' Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- Better explanation: https://www.mail-archive.com/qemu-devel@nongnu.org/msg689388.html --- target/arm/helper.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/target/arm/helper.c b/target/arm/helper.c index 7e9ea5d20f..dfefb9b3d9 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -3442,6 +3442,7 @@ static CPAccessResult ats_access(CPUARMState *env, co= nst ARMCPRegInfo *ri, return CP_ACCESS_OK; } =20 +#ifdef CONFIG_TCG static uint64_t do_ats_write(CPUARMState *env, uint64_t value, MMUAccessType access_type, ARMMMUIdx mmu_idx) { @@ -3602,9 +3603,11 @@ static uint64_t do_ats_write(CPUARMState *env, uint6= 4_t value, } return par64; } +#endif /* CONFIG_TCG */ =20 static void ats_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t v= alue) { +#ifdef CONFIG_TCG MMUAccessType access_type =3D ri->opc2 & 1 ? MMU_DATA_STORE : MMU_DATA= _LOAD; uint64_t par64; ARMMMUIdx mmu_idx; @@ -3664,17 +3667,26 @@ static void ats_write(CPUARMState *env, const ARMCP= RegInfo *ri, uint64_t value) par64 =3D do_ats_write(env, value, access_type, mmu_idx); =20 A32_BANKED_CURRENT_REG_SET(env, par, par64); +#else + /* Handled by hardware accelerator. */ + g_assert_not_reached(); +#endif /* CONFIG_TCG */ } =20 static void ats1h_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) { +#ifdef CONFIG_TCG MMUAccessType access_type =3D ri->opc2 & 1 ? MMU_DATA_STORE : MMU_DATA= _LOAD; uint64_t par64; =20 par64 =3D do_ats_write(env, value, access_type, ARMMMUIdx_E2); =20 A32_BANKED_CURRENT_REG_SET(env, par, par64); +#else + /* Handled by hardware accelerator. */ + g_assert_not_reached(); +#endif /* CONFIG_TCG */ } =20 static CPAccessResult at_s1e2_access(CPUARMState *env, const ARMCPRegInfo = *ri, @@ -3689,6 +3701,7 @@ static CPAccessResult at_s1e2_access(CPUARMState *env= , const ARMCPRegInfo *ri, static void ats_write64(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) { +#ifdef CONFIG_TCG MMUAccessType access_type =3D ri->opc2 & 1 ? MMU_DATA_STORE : MMU_DATA= _LOAD; ARMMMUIdx mmu_idx; int secure =3D arm_is_secure_below_el3(env); @@ -3728,6 +3741,10 @@ static void ats_write64(CPUARMState *env, const ARMC= PRegInfo *ri, } =20 env->cp15.par_el[1] =3D do_ats_write(env, value, access_type, mmu_idx); +#else + /* Handled by hardware accelerator. */ + g_assert_not_reached(); +#endif /* CONFIG_TCG */ } #endif =20 --=20 2.21.1