From patchwork Wed Oct 2 18:00:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 175030 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1091059ill; Wed, 2 Oct 2019 11:02:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqyankkvrvIxk1CTauR20vL2cOIq43hEJ+LinJbcijO7vdCmTbH66sj0M4JGvqCrgBrqh2N/ X-Received: by 2002:a05:6602:2241:: with SMTP id o1mr4200665ioo.129.1570039356653; Wed, 02 Oct 2019 11:02:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570039356; cv=none; d=google.com; s=arc-20160816; b=pkAnb9ONYvpeeqadpG0bnb09czfnfD173VadR+EO7tenYgictebrViUAX2Vjp0iqu7 qwXKeq0fXqLoXhtwu78Xx3b9PZyogZ1tMgwLhZxPhHBiKpdBwPboPfL/l8pWoHcwXaKm Bu9Uk38oNIKuWNgvOhjlcb4aOTKtk+AssE1fCETqQ5oB2iDt2LZZT1/VMi0bdOhihQcA jYZVYUdbXN/frTBdvq8TwdDwOxpe+72vs52w1i6abnBPChfkdz2y8RW/rFfiMFgkijxc 05cMblDjqYajBzqf++HkvbH8Qxqc96nadD3BwuhalEycg5f6oNLZkXbACb48ziDT0WDY HwXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from; bh=KVZmn7SDfQQdhwQQQ2O/cqdFiWbqxjIISULSRoRRFt8=; b=eW1redgjVDQXuylvP4E/Lc38FcYSdo2aCWddoCNfypkKR3MtDa7zoPrTzt3Mcnb8vV 22mF36oFK/oZLEjs2lALCXBguYk5coSkOwAteH+nbmhxa4eXpu9SELwEN5fPqgYM562F 0Es63u/NAhWJkgEnKQmvrhPeO6F0wnkN7r9QFsMlQAEpd0ceMTsrzr+9nOTizhxsb42u Q0le3v+3uRpK5B9EZlhgrq9GCWjv1XC8PS8QiwoeDxQVI4KtNGUXUeElQ5paQFDOXcNP jGgLWW4Sk/UJmRe6FLLSn/yeGR6OR/rCmloXl0jsuBJFOMIBQK2ovqSaF0ClPBuoSXd/ AY2A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id k16si15590942ior.3.2019.10.02.11.02.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 02 Oct 2019 11:02:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) 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 1iFivw-0005JZ-D5; Wed, 02 Oct 2019 18:01:04 +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 1iFivv-0005JI-4i for xen-devel@lists.xenproject.org; Wed, 02 Oct 2019 18:01:03 +0000 X-Inumbo-ID: 949eefe6-e53e-11e9-971c-12813bfff9fa Received: from foss.arm.com (unknown [217.140.110.172]) by localhost (Halon) with ESMTP id 949eefe6-e53e-11e9-971c-12813bfff9fa; Wed, 02 Oct 2019 18:00:55 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 68F3E15A2; Wed, 2 Oct 2019 11:00:55 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7F5693F706; Wed, 2 Oct 2019 11:00:54 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Wed, 2 Oct 2019 19:00:44 +0100 Message-Id: <20191002180047.17144-4-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20191002180047.17144-1-julien.grall@arm.com> References: <20191002180047.17144-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH for-4.13 3/6] xen/arm: cpuerrata: Match register size with value size in check_workaround_* 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: Artem_Mygaiev@epam.com, Volodymyr Babchuk , Julien Grall , Stefano Stabellini , Julien Grall MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Clang is pickier than GCC for the register size in asm statement. It expects the register size to match the value size. The asm statement expects a 32-bit (resp. 64-bit) value on Arm32 (resp. Arm64) whereas the value is a boolean (Clang consider to be 32-bit). It would be possible to impose 32-bit register for both architecture but this require the code to use __OP32. However, it does not really improve the assembly generated. Instead, replace switch the variable to use register_t. Signed-off-by: Julien Grall --- Changes in v2: - Use !! per Stefano's request --- xen/include/asm-arm/cpuerrata.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/include/asm-arm/cpuerrata.h b/xen/include/asm-arm/cpuerrata.h index 55ddfda272..0896fe6e25 100644 --- a/xen/include/asm-arm/cpuerrata.h +++ b/xen/include/asm-arm/cpuerrata.h @@ -14,14 +14,14 @@ static inline bool check_workaround_##erratum(void) \ return false; \ else \ { \ - bool ret; \ + register_t ret; \ \ asm volatile (ALTERNATIVE("mov %0, #0", \ "mov %0, #1", \ feature) \ : "=r" (ret)); \ \ - return unlikely(ret); \ + return unlikely(!!ret); \ } \ }