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_CR_TRAILER, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, 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 EF793C43460 for ; Thu, 15 Apr 2021 17:17:24 +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 945E76117A for ; Thu, 15 Apr 2021 17:17:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 945E76117A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xen.org 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.111440.213152 (Exim 4.92) (envelope-from ) id 1lX5c4-0002Yk-CB; Thu, 15 Apr 2021 17:17:08 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 111440.213152; Thu, 15 Apr 2021 17:17:08 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lX5c4-0002Yd-8Y; Thu, 15 Apr 2021 17:17:08 +0000 Received: by outflank-mailman (input) for mailman id 111440; Thu, 15 Apr 2021 17:17:07 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lX5c3-0002YY-Pi for xen-devel@lists.xenproject.org; Thu, 15 Apr 2021 17:17:07 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lX5c3-0005Fh-Ee; Thu, 15 Apr 2021 17:17:07 +0000 Received: from [54.239.6.185] (helo=a483e7b01a66.ant.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lX5c3-0007ja-6U; Thu, 15 Apr 2021 17:17:07 +0000 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" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:Cc:To:Subject; bh=FtpiYvwaV35MTuaioH/zUPTNobvubeCSJAJbMaENIbk=; b=N849VEWRhGSAAOPLx2XIY11lEG FSCJjxr0lKhHtyVuyO7qUs04B6rbWfK+0ZUdT4pG6qQZuVUD/kNc2QRiSn8bdMyGPH/zrXm7iuLeC 9bJfMIy47NLFONk1zIFzfkYMdCKshScj33iytpLW8Fi8Uiy01n8B0HYy7g0tBCllDh6c=; Subject: Re: [PATCH v4 2/4] xen/arm: Handle cases when hardware_domain is NULL To: Stefano Stabellini , Luca Fancellu Cc: xen-devel@lists.xenproject.org, Bertrand Marquis , wei.chen@arm.com, Volodymyr Babchuk , Rahul Singh References: <20210414091404.14215-1-luca.fancellu@arm.com> <20210414091404.14215-3-luca.fancellu@arm.com> <3424d24f-b189-c125-7b84-96848bbdcfd7@xen.org> <04326BA4-6E73-44BA-AB19-8F2B99000D8B@arm.com> <269e20a7-9f2c-f989-0ea0-7ab6c6bb9c11@xen.org> From: Julien Grall Message-ID: Date: Thu, 15 Apr 2021 18:17:05 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Hi, On 14/04/2021 21:35, Stefano Stabellini wrote: > On Wed, 14 Apr 2021, Luca Fancellu wrote: >>> On 14 Apr 2021, at 14:45, Julien Grall wrote: >>> >>> Hi Luca, >>> >>> On 14/04/2021 12:29, Luca Fancellu wrote: >>>>> On 14 Apr 2021, at 12:16, Julien Grall wrote: >>>>> >>>>> Hi Luca, >>>>> >>>>> On 14/04/2021 10:14, Luca Fancellu wrote: >>>>>> Among the common and arm codebase there are few cases where >>>>>> the hardware_domain variable is checked to see if the current >>>>>> domain is equal to the hardware_domain, change this cases to >>>>>> use is_hardware_domain() function instead. > >>>>>> Signed-off-by: Luca Fancellu >>>>>> --- >>>>>> v4 changes: >>>>>> - removed unneeded check for domain NULL from is_hardware_domain >>>>>> introduced in v3 >>>>> >>>>> After this change, this patch is only avoid to open-code is_hardware_domain(). Although, it adds an extra speculation barrier. >>>>> >>>>> I am not against the change, however I think the commit message needs to updated to match what the patch is doing. >>>>> >>>>> Can you propose a new commit message? >>>> Hi Julien, >>>> Yes I agree, what about: >>>> xen/arm: Reinforce use of is_hardware_domain >>>> Among the common and arm codebase there are few cases where >>> >>> I would drop 'common' because you are only modifying the arm codebase. >>> >>>> the hardware_domain variable is checked to see if the current >>>> domain is equal to the hardware_domain, change this cases to >>>> use is_hardware_domain() function instead. >>> >>> >>>> In the eventuality that hardware_domain is NULL, is_hardware_domain >>>> will return false because an analysis of the common and arm codebase >>>> shows that is_hardware_domain is called always with a non NULL >>>> domain pointer. >>> >>> This paragraph seems to come out of the blue. I would drop it. >>> >>> How about: >>> >>> " >>> There are a few places on Arm where we use pretty much an open-coded version of is_hardware_domain(). The main difference, is the helper will also block speculation (not yet implemented on Arm). >>> >>> The existing users are not in hot path, so blocking speculation would not hurt when it is implemented. So remove the open-coded version within the arm codebase. >>> " >>> >>> If you are happy with the commit message, I will commit it the series tomorrow (to give an opportunity to Stefano to review). >>> >> >> Hi Julien, >> >> Yes your version is much better, thank you very much! > > It looks great, thanks for your work on this! I have committed the series. Thanks for the work! Cheers, -- Julien Grall