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=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 8A0BAC433DB for ; Fri, 5 Feb 2021 09:52:55 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 2EB4064FBB for ; Fri, 5 Feb 2021 09:52:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2EB4064FBB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=WhbaBpAzMItG46Uiq6Na7RPEOwHtPDYp6GT5BEuY19g=; b=EgGgX6rG9XkY1VL/1TIbMGfCb 6E9TpWignFPTDwGxROCeoSjeolIjNbkB4c/pG9e4M/S5nogA3iMeSwH4q5h5MzuamqdccaXnxTQmE VKQBwz9njT4quwDXeV6/JmRloeYXH5cAjf00lPuPHQsS3L+opXpG9WkpyHoN8G5BmX1ez4/Nnimxf VVqVztkBHBqBqOGJtqSv7FwDysjDpC+/S8FkttUXGh9Tin6tIJ1DQLxf7UuhvqIdaDWWpSFGQ+b5g a0oDkYthbaqx36B41VJTTEJuBN0T2OzPWCgD1jc9VypEVa0uhC0d2lfndZuGGuu17VSDPThO3KqOb CCZO40X9g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l7xm8-0005oT-7o; Fri, 05 Feb 2021 09:51:40 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l7xm5-0005nr-BW for linux-arm-kernel@lists.infradead.org; Fri, 05 Feb 2021 09:51:38 +0000 Received: by mail-wm1-x32c.google.com with SMTP id m1so5402334wml.2 for ; Fri, 05 Feb 2021 01:51:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=VjKGmSN62P3b8Gz6m1qtw9F99Y61/6CwerUG3tU7MY4=; b=hWd/h67FoDG08zJsdEf7THf5fsb8v5CDM+WHa00/AqDgZTi/FJ+XGDpt9noS8j92eT c1yHqJWnhx8pzofgcTkG621MIs+ZYNlzfNozMBJ4JGCLPQtNYcZpfLKnYu5xL/x6BT71 aEdAxyGZOr6ngMqNl+eTVJ0vkLcZMUIAF37j+R6ukekbSONzz5ikB96WW1ggQpbmjh4e pzHSlO7VExl5U8GM7ducj2019BOduKzXoVXs1I8Eb0OZbXXoEFER+3Mi9BFjFmjfFpH9 0gGWV1VKYh/xeHfSCvsqZuEIO8leB844woCNQpyIv7/edOIt3pyLFA5cl+hc11LUi2l0 BUGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=VjKGmSN62P3b8Gz6m1qtw9F99Y61/6CwerUG3tU7MY4=; b=StkjKakAlOZJITe02sbSudg3qrmHi/kQ4kDttQqiL2/Tx36ii6F4QNt5xnDhAa9yHM CeWWiRuHXTZazE7pXHA8iCFUezv6hYROe93ZQvxRf0/jJao1Ogm7sC04yrdrYEi52PFE 6c2oiOa5n72dKNUhwoSZOiT19pJlVyVsu9yXQ/4mBNus7dDkerMEIpYkn1ut8Fkg2JS/ jqI9Q2X0Jfsrwgq9tnm32KMCRbcwwssBE96t+wAmcYakR47/cw/G317kSIzZNLC0mOT5 jek0LT2XXId7q8ZorF26Eix8YZ7G38sVlXD4o7cQM9pEu5nPapMrW0SG6QpDuDK94Y2a gGbg== X-Gm-Message-State: AOAM531fx+9tcoag7SsvDshOZvQSqbAx7zRsr8bGwhvXqSy973Bg3FI/ HHH1vZzM27shr/4zevkPT4p1GA== X-Google-Smtp-Source: ABdhPJyBpgLCQ/JhIkBboD0wFrqF+LmtaNQmOXy+bUTKCu4KXYd0D+Ym0BJGOgt45t7ajfN+ikeD0w== X-Received: by 2002:a1c:7d0c:: with SMTP id y12mr2849282wmc.184.1612518693792; Fri, 05 Feb 2021 01:51:33 -0800 (PST) Received: from myrica ([2001:1715:4e26:a7e0:116c:c27a:3e7f:5eaf]) by smtp.gmail.com with ESMTPSA id m18sm11669198wrx.17.2021.02.05.01.51.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 01:51:33 -0800 (PST) Date: Fri, 5 Feb 2021 10:51:14 +0100 From: Jean-Philippe Brucker To: Keqian Zhu Subject: Re: [RFC PATCH 01/11] iommu/arm-smmu-v3: Add feature detection for HTTU Message-ID: References: <20210128151742.18840-1-zhukeqian1@huawei.com> <20210128151742.18840-2-zhukeqian1@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210205_045137_510002_AE4EB78B X-CRM114-Status: GOOD ( 17.92 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , "Tian, Kevin" , Cornelia Huck , Alex Williamson , kvm@vger.kernel.org, Suzuki K Poulose , Will Deacon , jiangkunkun@huawei.com, lushenming@huawei.com, linux-kernel@vger.kernel.org, Kirti Wankhede , Catalin Marinas , iommu@lists.linux-foundation.org, James Morse , Marc Zyngier , wanghaibin.wang@huawei.com, Robin Murphy , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Keqian, On Fri, Feb 05, 2021 at 05:13:50PM +0800, Keqian Zhu wrote: > > We need to accommodate the firmware override as well if we need this to be meaningful. Jean-Philippe is already carrying a suitable patch in the SVA stack[1]. > Robin, Thanks for pointing it out. > > Jean, I see that the IORT HTTU flag overrides the hardware register info unconditionally. I have some concern about it: > > If the override flag has HTTU but hardware doesn't support it, then driver will use this feature but receive access fault or permission fault from SMMU unexpectedly. > 1) If IOPF is not supported, then kernel can not work normally. > 2) If IOPF is supported, kernel will perform useless actions, such as HTTU based dma dirty tracking (this series). > > As the IORT spec doesn't give an explicit explanation for HTTU override, can we comprehend it as a mask for HTTU related hardware register? To me "Overrides the value of SMMU_IDR0.HTTU" is clear enough: disregard the value of SMMU_IDR0.HTTU and use the one specified by IORT instead. And that's both ways, since there is no validity mask for the IORT value: if there is an IORT table, always ignore SMMU_IDR0.HTTU. That's how the SMMU driver implements the COHACC bit, which has the same wording in IORT. So I think we should implement HTTU the same way. One complication is that there is no equivalent override for device tree. I think it can be added later if necessary, because unlike IORT it can be tri state (property not present, overriden positive, overridden negative). Thanks, Jean _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel