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=-5.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 DFEE0C433DB for ; Mon, 22 Mar 2021 16:39:02 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 5F3F561983 for ; Mon, 22 Mar 2021 16:39:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5F3F561983 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:CC:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=bgtS+VaHlOmglPJrDzyi7D0XeCr046rB9zJJQOLBQjo=; b=fy5X966/bHWblc9MZZfUS2vwl 2GesP6rTR5JHTInFU5acuFWFGnzE/175tF4rmOxNdC+bMQ/f0VFMGrBWlUVaCH3zu6L+ws7VcOS3I FhAXW7RoE1VoqiPF5EIFPc04pDcUFEkxvFcFyHpgDGd1mfddDxcPg7wenUYb0+dREs1353CG6lHuS Bp1vAXDRNs1L9bsrTYvZIB3Re2jFW9F6rZz8bCkSXy4syWJFaCBUkZeCYMCXvO9qA17G1/RICweKd biZdOhzEcteXEUxpy9YUL/wzPz8LwT2Ikun+R3W5tYMVWeTfapCJg/6q/JUO9HOV/GzxVyd5w9p0s AOGgREC5w==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lONY8-00C3Xe-V8; Mon, 22 Mar 2021 16:37:05 +0000 Received: from frasgout.his.huawei.com ([185.176.79.56]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lONY1-00C3Vo-Ew for linux-arm-kernel@lists.infradead.org; Mon, 22 Mar 2021 16:37:00 +0000 Received: from fraeml709-chm.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4F40NH1yb1z681SV; Tue, 23 Mar 2021 00:30:23 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml709-chm.china.huawei.com (10.206.15.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Mon, 22 Mar 2021 17:36:48 +0100 Received: from [10.210.167.192] (10.210.167.192) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Mon, 22 Mar 2021 16:36:46 +0000 Subject: Re: arm64 syzbot instances To: Arnd Bergmann , Peter Maydell CC: Dmitry Vyukov , Mark Rutland , Marc Zyngier , Will Deacon , Ard Biesheuvel , Linux ARM , syzkaller , LKML , =?UTF-8?Q?Alex_Benn=c3=a9e?= References: From: John Garry Message-ID: <771d89a8-b7e0-6095-b101-e7ae91bcdc85@huawei.com> Date: Mon, 22 Mar 2021 16:34:33 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Originating-IP: [10.210.167.192] X-ClientProxiedBy: lhreml718-chm.china.huawei.com (10.201.108.69) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210322_163657_616894_D7B15CE5 X-CRM114-Status: GOOD ( 26.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org >> >> There's apparently a bit in the PCI spec that reads: >> The host bus bridge, in PC compatible systems, must return all >> 1's on a read transaction and discard data on a write transaction >> when terminated with Master-Abort. >> >> which obviously applies only to "PC compatible systems". > > Right. As far as I can tell, all ARMv8 and most ARMv7 based SoCs > do this to be more compatible with PC style operating systems like > Linux, but you are right that the specification here does not > mandate that, and the older ARMv5 SoCs seem to be compliant > as well based on this. > >>> Linux has a driver for DPC, which apparently configures it to >>> cause an interrupt to log the event, but it does not hook up the >>> CPU exception handler to this. I don't see an implementation of DPC >>> in qemu, which I take as an indication that it should use the >>> default behavior and cause neither an interrupt nor a CPU exception. >> >> Hmm, maybe. We should probably also implement -1/discard just because >> we're not intending to have 'surprising' behaviour. >> >> TBH I'm having difficulty seeing why the kernel should be doing >> this at all, though. The device tree tells you you have a PCI >> controller; PCI supports enumeration of devices; you know exactly >> where everything is mapped because the BARs tell you that. >> I don't see anything that justifies the kernel in randomly >> dereferencing areas of the IO or memory windows where it hasn't >> mapped anything. BIOS has described a CPU-addressable PIO region in the PCI hostbridge, and the kernel has mapped it: [ 3.974309][ T1] pci-host-generic 4010000000.pcie: IO 0x003eff0000..0x003effffff -> 0x0000000000 So I don't see why any accesses there should fault. >> You shouldn't be probing for legacy ISA-port >> devices unless you're on a system which might actually have them >> (eg an x86 PC). > > It only happened in this case because there is also a bug in > the 8250 serial port driver that is configured to assume four ports > exist at port zero. On real arm64 hardware, this is apparently > harmless because the driver has coped with this for 30 years ;-) > > There are a few other drivers that assume hardware is accessible > at the legacy addresses, and applications can also still open /dev/ioport > (if that is enabled at compile time) for the same purpose. Examples > could be PC-style mouse/keyboard (emulated by a server BMC), > PATA/SATA controllers in pre-AHCI mode, VGA console, and a > couple of industrial I/O drivers that have ISA devices behind a > PCI bridge. > > Most other actual ISA add-on card drivers can only be enabled > on kernels that support machines with real slots, so you could > get them on an i386 kernel running a virtualized x86_64 machine, > but not on ARMv6 or later kernels, and you can't run pre-ARMv7 > kernels on ARMv8 hardware. > There are also lots of the hwmon drivers which use super IO, and probe a fixed PIO addresses for HW detection. These may be enabled on any architecture (apart from PPC, who explicitly disabled them to avoid issues like this). Thanks, John _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel