Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1593094imu; Wed, 28 Nov 2018 11:53:41 -0800 (PST) X-Google-Smtp-Source: AFSGD/VsxIy4GPtINLA2oMRDDAzEJTfH82NsWEm0Daw6EMTewVi5BXK2FXdR1pdgvScJWNFxYF3C X-Received: by 2002:a17:902:e08b:: with SMTP id cb11mr38614250plb.263.1543434821282; Wed, 28 Nov 2018 11:53:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543434821; cv=none; d=google.com; s=arc-20160816; b=n4GZh/Eg3JsnvseaCwYdhwYr1hg/c1pJBWzeeiauwhz7PVBj5k2NrTd27+Q3tAIUIB 4omZ345j8/zqI5dIRArIX62yi7lEA5FVooLyZmHbk6afaIwBKv1Jm6kVzEcIG5OgbEAB TBoPLAqP0ywG2ZoDv1rPLI7kHIm1n7VUZSIILBAjzQgwtfeuZswQ8rUfweK9Ygxa6mRw XasEkaq/fcFalMQZp8zCh2R0yUTV+x4thTDD6Qlwf0P/kWEz/z1NVzDfZd0wSHxgIcJ+ uRtvcXyNb8Gfq9x4FfqHvtdwdFs2h2UGJ//ueqfJXfrWGw/oB730sCyZtrn1Cki4Z9hz 8l7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=QROS1yiJSUYof65aiiz9210zSbQoZ5sq4J31UJOz19A=; b=nuI/pC9bYS0nt7EyID5TgECdoMfD4d8ULfYkt7rbNAizOUxcZk//aE2pcb6BqwRCUd sY/IcFzuwYIVqV2p6NGjmUJYAZLAsplfEjuuFQLcYOwiFPG3YbNKbvEEKpdyMJrxBa8z peQj5xYEzY1uo7Iwrwi0ROA4IDI7IBa6a2UedidcQIIiWVug8RXsa1ZtxDvHiJ3ORXhD 9OwO7h/sbAm504lzENDscbs+yn8WzztuAi2GpA6bxMBNtFXPH4AySRs3xrmjz1S0Kz/W HWPPVhW63Ws/XGInGENsDTf26qA0K/K2li+y+tU0WVK/zsHC+MV35gTwfTG14h7WLIgp GmVA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n7si5400584plp.147.2018.11.28.11.53.25; Wed, 28 Nov 2018 11:53:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727508AbeK2Gzf (ORCPT + 99 others); Thu, 29 Nov 2018 01:55:35 -0500 Received: from foss.arm.com ([217.140.101.70]:49586 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725994AbeK2Gzf (ORCPT ); Thu, 29 Nov 2018 01:55:35 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 281B0A78; Wed, 28 Nov 2018 11:52:48 -0800 (PST) Received: from [10.1.196.75] (e110467-lin.cambridge.arm.com [10.1.196.75]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 353883F59C; Wed, 28 Nov 2018 11:52:46 -0800 (PST) Subject: Re: [PATCH] pci: imx6: support kernels built in Thumb-2 mode To: Trent Piepho , "stefan@agner.ch" , "hongxing.zhu@nxp.com" , "l.stach@pengutronix.de" Cc: "lorenzo.pieralisi@arm.com" , "andrew.smirnov@gmail.com" , "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bhelgaas@google.com" , "leonard.crestez@nxp.com" , "festevam@gmail.com" , "linux-arm-kernel@lists.infradead.org" References: <20181128132554.28139-1-stefan@agner.ch> <1543431377.18519.94.camel@impinj.com> From: Robin Murphy Message-ID: Date: Wed, 28 Nov 2018 19:52:44 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <1543431377.18519.94.camel@impinj.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28/11/2018 18:56, Trent Piepho wrote: > On Wed, 2018-11-28 at 16:16 +0000, Robin Murphy wrote: >> >>> >>> +static int imx6q_pcie_abort_handler_thumb2(unsigned long addr, >>> + unsigned int fsr, struct pt_regs *regs) >>> +{ >>> + unsigned long pc = instruction_pointer(regs); >>> + unsigned long instr = *(unsigned long *)pc; >>> + unsigned long thumb2_instr = __mem_to_opcode_thumb16(instr); >>> + int reg = thumb2_instr & 7; >>> + >>> + if (!__opcode_is_thumb16(instr & 0x0000ffffUL)) >>> + return 1; >> >> There are plenty of 32-bit Thumb encodings of various LDR/STR variants, >> and I doubt we can guarantee that the offset, target register, and/or >> addressing mode for a config space access will *always* suit the >> (relatively limited) 16-bit ones. > > It might be the case that PLD/PLI, 32-bit thumb2 instructions, could > trigger an abort too. Preload instructions shouldn't cause a *synchronous* abort, which is what we're trapping here, and they could only result in an asynchronous abort coming back later if the address is mapped as Normal memory, which it really shouldn't be in this case. Frankly either way, anyone even thinking about trying to pull PCI config space into data caches, let alone instruction caches, probably deserves everything they get ;) Robin.