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=-12.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 37333C433ED for ; Tue, 20 Apr 2021 12:50:52 +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 C3DF5613C5 for ; Tue, 20 Apr 2021 12:50:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C3DF5613C5 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.113647.216580 (Exim 4.92) (envelope-from ) id 1lYppx-0001FF-1t; Tue, 20 Apr 2021 12:50:41 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 113647.216580; Tue, 20 Apr 2021 12:50:41 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lYppw-0001F7-V8; Tue, 20 Apr 2021 12:50:40 +0000 Received: by outflank-mailman (input) for mailman id 113647; Tue, 20 Apr 2021 12:50:40 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lYppw-0001F2-Ga for xen-devel@lists.xenproject.org; Tue, 20 Apr 2021 12:50:40 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 1a1b04ee-39e7-4fa7-ac8a-b14055eadd04; Tue, 20 Apr 2021 12:50:39 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 59673B4A9; Tue, 20 Apr 2021 12:50:38 +0000 (UTC) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 1a1b04ee-39e7-4fa7-ac8a-b14055eadd04 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1618923038; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=f+ZBd6/3UtSNkoI0op6ss7oC9lHSiQednDpiUmZJGJc=; b=LIIXFMhkrCeE0aULq4rZXuJm5jsKOK3nPthhbtv6mh4P5Uv7rrVdOqUIJVN1TxNBKyGKLX EDhJRXwk+HvAlD/vLuWWMXMnLYhJGz04IhI56s9SbYbYplnUdtLGTs/WZnpyFVl0yR2yU+ EP9/QBN2lIjgRgd6NUOvtqrinRgPO+k= Subject: Re: [PATCH v2] VT-d: Don't assume register-based invalidation is always supported To: Julien Grall Cc: Andrew Cooper , George Dunlap , Ian Jackson , Stefano Stabellini , Wei Liu , Kevin Tian , xen-devel@lists.xenproject.org, Chao Gao References: <20200401200606.48752-1-chao.gao@intel.com> <148ad77f-d447-0800-d48b-9ba8c758b905@xen.org> <98da1bbb-8860-0728-a438-a4f12719d4e2@xen.org> From: Jan Beulich Message-ID: <525fa57c-b036-7c2b-3a6d-ede7f4ce6d36@suse.com> Date: Tue, 20 Apr 2021 14:50:37 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: <98da1bbb-8860-0728-a438-a4f12719d4e2@xen.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 20.04.2021 14:39, Julien Grall wrote: > On 20/04/2021 13:25, Jan Beulich wrote: >> On 20.04.2021 14:14, Julien Grall wrote: >>> It is not really my area of expertise but I wanted to jump on one >>> comment below... >>> >>> On 20/04/2021 12:38, Jan Beulich wrote: >>>> On 01.04.2020 22:06, Chao Gao wrote: >>>>> --- >>>>> Changes in v2: >>>>> - verify system suspension and resumption with this patch applied >>>>> - don't fall back to register-based interface if enabling qinval failed. >>>>> see the change in init_vtd_hw(). >>>>> - remove unnecessary "queued_inval_supported" variable >>>>> - constify the "struct vtd_iommu *" of has_register_based_invalidation() >>>>> - coding-style changes >>>> >>>> ... while this suggests this is v2 of a recently sent patch, the >>>> submission is dated a little over a year ago. This is confusing. >>>> It is additionally confusing that there were two copies of it in >>>> my inbox, despite mails coming from a list normally getting >>>> de-duplicated somewhere at our end (I believe). >>>> >>>>> --- a/xen/drivers/passthrough/vtd/iommu.c >>>>> +++ b/xen/drivers/passthrough/vtd/iommu.c >>>>> @@ -1193,6 +1193,14 @@ int __init iommu_alloc(struct acpi_drhd_unit *drhd) >>>>> >>>>> iommu->cap = dmar_readq(iommu->reg, DMAR_CAP_REG); >>>>> iommu->ecap = dmar_readq(iommu->reg, DMAR_ECAP_REG); >>>>> + iommu->version = dmar_readl(iommu->reg, DMAR_VER_REG); >>>>> + >>>>> + if ( !iommu_qinval && !has_register_based_invalidation(iommu) ) >>>>> + { >>>>> + printk(XENLOG_WARNING VTDPREFIX "IOMMU %d: cannot disable Queued Invalidation.\n", >>>>> + iommu->index); >>>> >>>> Here (and at least once more yet further down): We don't normally end >>>> log messages with a full stop. Easily addressable while committing, of >>>> course. >>> >>> I can find a large number of cases where log messages are ended with a >>> full stop... Actually it looks more natural to me than your suggestion. >> >> Interesting. From purely a language perspective it indeed looks more >> natural, I agree. But when considering (serial) console bandwidth, we >> ought to try to eliminate _any_ output that's there without conveying >> information or making the conveyed information understandable. In fact >> I recall a number of cases (without having commit hashes to hand) >> where we deliberately dropped full stops. (The messages here aren't at >> risk of causing bandwidth issues, but as with any such generic item I >> think the goal ought to be consistency, and hence either full stops >> everywhere, or nowhere. If bandwidth was an issue here, I might also >> have suggested to shorten "Queued Invalidation" to just "QI".) > I wasn't aware of such requirement in Xen... Although, I can see how > this can be a concern. If you really want to enforce it, then it should > be written in the CODING_STYLE. Agreed, but since I've had no success with prior adjustments to that file (not even worth a reply to tell me why a change might be a bad one, in at least some of the cases), I'm afraid I've given up making attempts to get adjustments into there. > Alternatively, you could be a bit more > verbose in your request so the other understand the reasoning behind it. Well, yes, perhaps. But then there's the desire to not repeat oneself all the time. Jan