From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6040CC4338F for ; Thu, 19 Aug 2021 16:52:12 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E7CF8610A6 for ; Thu, 19 Aug 2021 16:52:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E7CF8610A6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:57924 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mGlH1-00032H-2r for qemu-devel@archiver.kernel.org; Thu, 19 Aug 2021 12:52:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59382) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mGlFt-00023l-87 for qemu-devel@nongnu.org; Thu, 19 Aug 2021 12:51:01 -0400 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]:36398) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mGlFr-0000Hi-Mu for qemu-devel@nongnu.org; Thu, 19 Aug 2021 12:51:00 -0400 Received: by mail-pg1-x52f.google.com with SMTP id t1so6468931pgv.3 for ; Thu, 19 Aug 2021 09:50:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=DAy9K5Dk6cCjC8JMG7DbxZJASbH7spHP3sfgl78LUxk=; b=K/R/NKuG85OtmCXEVXW/aGrlt8WCvMOptDDuTY3nZpHftgZ4M6av9Wi/hUj8WeNp3a BRI2b/hAlcn/IimlK7zDyzRQETAe8i5Iy5OIeF5mPIIZdEfWqmXtRFcD7luJW73D/4pI XxNJKYOEjSbJlvs7p+jODWHp/Wq4eO3g94ciBE1IFWYZigNWMS6Cv+m53n6MxdQLuq97 mGCrl7aOyd3TjT61dFoK+E+5o3EeI1tObkvQfDof8rHHZ38rfVnW196zC7b+veLFHSXN D38Gb81IS2Pm/aZrlvyEpokyiVfqQt0+jFFDOxMeiONhS9ChCQIy/8bfV1ZMl4wCCE/4 HF7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=DAy9K5Dk6cCjC8JMG7DbxZJASbH7spHP3sfgl78LUxk=; b=h6btlb4GUtpk6D8L1p9g/u8SJlwiXe2TNiEPKQ3NRKn0Ogah866GU16FkqaJMUGosw Q3+8aIyBYW8cWIL9qlF6BlkoeDOr2PPRQJcEqWL/A2MMN3rXshgZK22kDtO82ExQg6cy /OR6rhGcPpWinljewwuvC6BMf/bKsSBwRMHUNS7EJ9xl8KjdUb1K2It2dGsiRN9D5izV yMLgK0wRHPuaEqToxmbl8xl2MsgkcBUnoGR2LGIntSjbfIyBxCh8T6mKyMpqvUqkt9Y3 rTDgFMtQQKJe+ZIrsBJXV1exULJ0EoJMw+gJuDUwpj7Cf3ODhEk7r5vYCj1tki78ayGZ xsuw== X-Gm-Message-State: AOAM5332oPu5MuT4iGJ0nj7y5T6IjtudOzxDIgCbjg3oBfaOI4iCQxHy nEPnHFD/+/+5A97x03U/tKmXWQ== X-Google-Smtp-Source: ABdhPJyVGcTSNFZIYNf8GV/W4Y8OONfH4lCxSEPeWBkYnLm4bQgxGzmuQK64IKqyD1TEmCrKNT9ioA== X-Received: by 2002:a63:595f:: with SMTP id j31mr14789519pgm.109.1629391857649; Thu, 19 Aug 2021 09:50:57 -0700 (PDT) Received: from [192.168.3.43] ([173.197.107.15]) by smtp.gmail.com with ESMTPSA id c2sm4115656pfp.138.2021.08.19.09.50.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 Aug 2021 09:50:57 -0700 (PDT) Subject: Re: [PATCH 3/4] target/arm: Take an exception if PC is misaligned To: Peter Maydell References: <20210818010041.337010-1-richard.henderson@linaro.org> <20210818010041.337010-4-richard.henderson@linaro.org> From: Richard Henderson Message-ID: Date: Thu, 19 Aug 2021 06:50:53 -1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2607:f8b0:4864:20::52f; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52f.google.com X-Spam_score_int: -46 X-Spam_score: -4.7 X-Spam_bar: ---- X-Spam_report: (-4.7 / 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, NICE_REPLY_A=-2.591, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-arm , QEMU Developers Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 8/19/21 3:40 AM, Peter Maydell wrote: >> uint32_t insn; >> bool is_16bit; >> >> - if (arm_pre_translate_insn(dc)) { >> + if (arm_check_ss_active(dc) || arm_check_kernelpage(dc)) { > > > Is it not possible to get a misaligned PC in the Thumb case ? No. The thumb bit is always removed, leaving all pc aligned mod 2. Both BXWritePC and BranchWritePC do this, as do we in gen_bx and store_reg. r~