From patchwork Thu Aug 31 23:24:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 719046 Delivered-To: patch@linaro.org Received: by 2002:adf:e5c2:0:b0:31d:da82:a3b4 with SMTP id a2csp752673wrn; Thu, 31 Aug 2023 16:26:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHF1ZRKbB47A3XB/C1U2W8B/WvEACKx3GM9EvTDfBJ4NnQouNNhDGCscfnTrTge2GR4A++j X-Received: by 2002:a05:620a:2105:b0:76e:f272:1dd7 with SMTP id l5-20020a05620a210500b0076ef2721dd7mr853582qkl.24.1693524384694; Thu, 31 Aug 2023 16:26:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693524384; cv=none; d=google.com; s=arc-20160816; b=BwX7ySWDFnjT78lZ6teu3y9bJZzHuZH6dy/44qKKY22Yn43MD0JioSDk5hf9J5+Ltp b2WOhhIUT+0T61pumhwyLuDhSgbxkmVV+iQk3PvXxEHlFec/TGxvk4QQKG0nov8aPbQ6 imNaIgGKT3Gf/7ROnbsscsVQDULJY0RLAEXtzz98kPomk++Wz1Jp6VV9NoycMdeaXjAm tYuVO1+3fxw8PMIjtkyCZz9Op7ssdRMb6kSHl96qk8crfqlYwO7EDwci23mPKJD5fWPg qOIgA/67WeK2VaRvr1bGPhbOxMgBb8s2EjCW9YAbXSx2VTAbOgHC5knJ2ZRNkcckbebA HYcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=WknjyyvkUA5R2BgSlGNmVEJEpeTJCnFvoRCppP0P3KM=; fh=9Ev+QBUhk6P6vR3LT1wYeDLexozsz44nqjfoyPajZCc=; b=e6GjoNWm2vvXbTbKeUeLcCyS8cJ0g++HlygQXgAkJB3bqLJMiCmFzTUMPNoBNQksIR y+ADIcma/P0acqj7SE9TLB2zejVtcwW+Yi0D8Hb55fn1I1DXLhqfNctNVOGB/IH9eoqr MnvORCnA8R/kOE/sRvDPHEGQiNLz1NlES4YuMT940mN4ByDWCF2pShbYFh+gnNGAvqHD YMVVouw3sWMuf5FRve/0U3nsdU9tjeNvG99lDCxWcwgopUnT3PP+ot11vtRas3ct7IIp vW0twUQUt6sFafl5rhHUDdLXKmuGVyF+0l/6Fq7fC+vdNUEm0YEyrqkbTSnOKMPW0XlC tWFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ID9qTH1e; 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 ot11-20020a05620a818b00b0076734e5dc43si1526107qkn.199.2023.08.31.16.26.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 31 Aug 2023 16:26:24 -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=ID9qTH1e; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qbr22-0006ob-CK; Thu, 31 Aug 2023 19:24: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 1qbr20-0006nh-3k for qemu-devel@nongnu.org; Thu, 31 Aug 2023 19:24:56 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qbr1r-0002Ht-VZ for qemu-devel@nongnu.org; Thu, 31 Aug 2023 19:24:55 -0400 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-68c0d4cc3a4so1159383b3a.1 for ; Thu, 31 Aug 2023 16:24:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693524286; x=1694129086; 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=WknjyyvkUA5R2BgSlGNmVEJEpeTJCnFvoRCppP0P3KM=; b=ID9qTH1e8l70XOoWNZbmTClNjyiLUsqvM7NxEdhHgsY1mzvcMw4mtuJnYAMXnhwr7W 4jixWe8CQMs9vIJBWlRGnhq2Ra0T4kxUVSfASPt48xAQao8j9NwT09x4h9tR88cpzRzK mF3UB1YlDle7hgueVppK6ZL4HThyP6nc+skv+3I8Tzn0a7UmRb9jw8673DJWQ/kSxcgT UcXAbyv+LQHGSV2MiTzLupkVRKU4GAH2tWVC/rFz+/STpy4PS6yWs7QAH1OodedeYUwh s8xOzYPq6nU4asI5CeJ44+i+2RhGkTj3pHXk0HZCrHmRcGOPeGcVbdECjBFc6uucIIlt PmHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693524286; x=1694129086; 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=WknjyyvkUA5R2BgSlGNmVEJEpeTJCnFvoRCppP0P3KM=; b=Rgfizz4TDHgghKerx9UtWHgl6Dut1mKT16eduj4lnOrHKb1/mYyr7deId4GY8HhL98 2Rt7mTm+jDS2PoyhmJj0wVDI6aNrk47/h/2vPcGsF7a4iXhp1G2a4KcdAgIVfuX3vMZw 4EbhFOlHkp4e3WQPKBfwhJtlV2mnHroVicWT7f2pFBPjOr8LwMY8Goic7qMhRBl08pxZ 4XbhOWvuc9JxhdIcS5CX6QqU8OZFPzq5ivrspnqEguxHWMugA+/LhqVfg8tdVUPwAh+q pogA2eRuxcWa1y/EjV+v6rmKc8hcdq9eIiJGGyuHBRZQn0+6rLA1VvwE3OlqoEpkSx9B O7SA== X-Gm-Message-State: AOJu0YyIbGs7ib80MLFh3uQuigV9dmGbyGO1HqHmMv3VDdC7GOSCKr+V ii/05cEI+0FZHuTspZ/HAfDu8SQCv043i+QJlBc= X-Received: by 2002:a05:6a21:7742:b0:14d:f8a4:d0d1 with SMTP id bc2-20020a056a21774200b0014df8a4d0d1mr1171762pzc.35.1693524286590; Thu, 31 Aug 2023 16:24:46 -0700 (PDT) Received: from stoup.. ([71.212.131.115]) by smtp.gmail.com with ESMTPSA id jd5-20020a170903260500b001bb8895848bsm1732711plb.71.2023.08.31.16.24.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Aug 2023 16:24:46 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH v3 5/5] target/arm: Enable SCTLR_EL1.TIDCP for user-only Date: Thu, 31 Aug 2023 16:24:41 -0700 Message-Id: <20230831232441.66020-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230831232441.66020-1-richard.henderson@linaro.org> References: <20230831232441.66020-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42d.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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The linux kernel detects and enables this bit. Once trapped, EC_SYSTEMREGISTERTRAP is treated like EC_UNCATEGORIZED, so no changes required within linux-user/aarch64/cpu_loop.c. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- target/arm/cpu.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 0bb0585441..b9e09a702d 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -243,6 +243,10 @@ static void arm_cpu_reset_hold(Object *obj) SCTLR_EnDA | SCTLR_EnDB); /* Trap on btype=3 for PACIxSP. */ env->cp15.sctlr_el[1] |= SCTLR_BT0; + /* Trap on implementation defined registers. */ + if (cpu_isar_feature(aa64_tidcp1, cpu)) { + env->cp15.sctlr_el[1] |= SCTLR_TIDCP; + } /* and to the FP/Neon instructions */ env->cp15.cpacr_el1 = FIELD_DP64(env->cp15.cpacr_el1, CPACR_EL1, FPEN, 3);