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=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,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 ECAF3C3815B for ; Tue, 14 Apr 2020 14:14:00 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 C513A20578 for ; Tue, 14 Apr 2020 14:14:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C513A20578 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jOMJx-0005Wh-Fc; Tue, 14 Apr 2020 14:13:49 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jOMJw-0005Wc-RY for xen-devel@lists.xenproject.org; Tue, 14 Apr 2020 14:13:48 +0000 X-Inumbo-ID: 281d2530-7e5a-11ea-8942-12813bfff9fa Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 281d2530-7e5a-11ea-8942-12813bfff9fa; Tue, 14 Apr 2020 14:13:47 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 095CAAC46; Tue, 14 Apr 2020 14:13:45 +0000 (UTC) Subject: Re: [XEN PATCH v2] hvmloader: Enable MMIO and I/O decode, after all resource allocation To: paul@xen.org References: <612892f2fed5cb02cbec289589e437d9badb8cc1.camel@amazon.com> <6e3732e8-01d0-e9de-e89a-cd1b5833e5a1@suse.com> <000001d6124c$0aced570$206c8050$@xen.org> <90fd6e75-32b6-a140-1d20-083947bf1681@suse.com> <000001d61254$020b0dc0$06212940$@xen.org> <7c9ba731-bde1-96d7-6d93-9d33160f749c@suse.com> <001901d61263$dc9d58d0$95d80a70$@xen.org> From: Jan Beulich Message-ID: <8f7d5857-7e40-4fa4-7a62-970f0af548d4@suse.com> Date: Tue, 14 Apr 2020 16:13:47 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <001901d61263$dc9d58d0$95d80a70$@xen.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: wl@xen.org, andrew.cooper3@citrix.com, ian.jackson@eu.citrix.com, "'Shamsundara Havanur, Harsha'" , xen-devel@lists.xenproject.org, roger.pau@citrix.com Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" On 14.04.2020 15:51, Paul Durrant wrote: >> -----Original Message----- >> From: Jan Beulich >> Sent: 14 April 2020 14:43 >> To: paul@xen.org >> Cc: 'Shamsundara Havanur, Harsha' ; xen-devel@lists.xenproject.org; >> andrew.cooper3@citrix.com; ian.jackson@eu.citrix.com; wl@xen.org; roger.pau@citrix.com >> Subject: Re: [XEN PATCH v2] hvmloader: Enable MMIO and I/O decode, after all resource allocation >> >> On 14.04.2020 13:58, Paul Durrant wrote: >>>> -----Original Message----- >>>> From: Jan Beulich >>>> Sent: 14 April 2020 12:40 >>>> To: paul@xen.org >>>> Cc: 'Shamsundara Havanur, Harsha' ; xen-devel@lists.xenproject.org; >>>> andrew.cooper3@citrix.com; ian.jackson@eu.citrix.com; wl@xen.org; roger.pau@citrix.com >>>> Subject: Re: [XEN PATCH v2] hvmloader: Enable MMIO and I/O decode, after all resource allocation >>>> >>>> On 14.04.2020 13:01, Paul Durrant wrote: >>>>>> -----Original Message----- >>>>>>> >>>>>>> Previous commit enabled MASTER for all functions. I am bit confused >>>>>>> here on the consensus on enabling/disabling/retaining BME. >>>>>>> Should we even care about MASTER? >>>>>> >>>>>> With the commit introducing its universal setting, I'm afraid to >>>>>> avoid regressions we can't sensibly alter the behavior unless it >>>>>> can be explained clearly why the original change must have been >>>>>> outright wrong. >>>>>> >>>>> >>>>> Well the original code IIRC had no justification for setting BME >>>>> and doing it unconditionally does seem dangerous. >>>> >>>> I'm not viewing this as dangerous, merely as (typically) pointless. >>>> A well behaved device won't start issuing DMA requests merely >>>> because it had its bus mastering capability enabled. (And in the >>>> context of some IOMMU work of yours you actually stated there are >>>> devices where clearing of this bit won't stop them from doing so.) >>>> >>> >>> It's a line of defence against some devices at least, >> >> What defence? Once we're past hvmloader, the guest can do whatever it >> wants anyway. >> > > My observation is that it is typically the device function driver > that will enable BME, and that may come after a device-specific > reset has been done. So, the chances of the VM surviving in the > face of buggy h/w is higher if we don't blindly enable BME early > on. Well, I'd agree if only we knew the reason for the introduction of this, many years ago. Jan