From nobody Tue May 14 17:03:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1610697628; cv=none; d=zohomail.com; s=zohoarc; b=HmCYIjuy8p+Su4N7gQTzoY9/b5JGH1zURGTBiLcnIxz44yR/7cRu4ErFSeDZAeQu3W6+x2X2JC5RTke3/UYm82mLFwsWLqvROm370pYvlV+ED3nhOVmoCY7YLqY69InSqDPjLu+Ms/BttFPLvFjrrLrr7chsGNXiBiZ2vy9+o60= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610697628; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=KOgK2DBxm+lF6tlOWEXNTp7UOycgKQkK1ZNwQagARyE=; b=A6EX1zP+C8OoSLmFBmrVH78NTQ1gGl1jlf1JrTremKrcmWIps9WsgY8lZFW0IMtT7STTXXKjpe7JU/VqMu+BaZkz/i6EWuyyY7CkP2Z+Q08J9PbY0MSE5WS7O7AcTh4cflRV76sxZ6P0VBUhyEKaYpTB0al3jePqYljxmuabUtA= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1610697628778691.3465336306715; Fri, 15 Jan 2021 00:00:28 -0800 (PST) Received: from localhost ([::1]:46638 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0K1y-0004or-K3 for importer@patchew.org; Fri, 15 Jan 2021 03:00:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57828) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0K17-0003or-7C; Fri, 15 Jan 2021 02:59:33 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:2934) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0K14-00083c-Uz; Fri, 15 Jan 2021 02:59:32 -0500 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4DHD7f16nHzMK74; Fri, 15 Jan 2021 15:58:06 +0800 (CST) Received: from huawei.com (10.175.104.175) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.498.0; Fri, 15 Jan 2021 15:59:19 +0800 From: Gan Qixin To: , Subject: [PATCH] util/cacheflush: Fix error generated by clang Date: Fri, 15 Jan 2021 15:56:56 +0800 Message-ID: <20210115075656.717957-1-ganqixin@huawei.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.175.104.175] X-CFilter-Loop: Reflected Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=45.249.212.191; envelope-from=ganqixin@huawei.com; helo=szxga05-in.huawei.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: zhang.zhanghailiang@huawei.com, Euler Robot , Richard Henderson , Gan Qixin , Paolo Bonzini , kuhn.chenqun@huawei.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" When compiling qemu-fuzz-i386 on aarch64 host, clang reported the following error: ../util/cacheflush.c:38:44: error: value size does not match register size specified by the constraint and modifier [-Werror,-Wasm-operand-widths] asm volatile("mrs\t%0, ctr_el0" : "=3Dr"(save_ctr_el0)); ^ ../util/cacheflush.c:38:24: note: use constraint modifier "w" asm volatile("mrs\t%0, ctr_el0" : "=3Dr"(save_ctr_el0)); ^~ %w0 Modify the type of save_ctr_el0 to uint64_t to fix it. Reported-by: Euler Robot Signed-off-by: Gan Qixin Reviewed-by: Richard Henderson --- Cc: Richard Henderson Cc: Paolo Bonzini --- util/cacheflush.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/util/cacheflush.c b/util/cacheflush.c index 6a20723902..933355b0c9 100644 --- a/util/cacheflush.c +++ b/util/cacheflush.c @@ -32,7 +32,7 @@ void flush_idcache_range(uintptr_t rx, uintptr_t rw, size= _t len) * We want to save the whole contents of CTR_EL0, so that we * have more than the linesize, but also IDC and DIC. */ -static unsigned int save_ctr_el0; +static uint64_t save_ctr_el0; static void __attribute__((constructor)) init_ctr_el0(void) { asm volatile("mrs\t%0, ctr_el0" : "=3Dr"(save_ctr_el0)); @@ -46,9 +46,9 @@ void flush_idcache_range(uintptr_t rx, uintptr_t rw, size= _t len) { const unsigned CTR_IDC =3D 1u << 28; const unsigned CTR_DIC =3D 1u << 29; - const unsigned int ctr_el0 =3D save_ctr_el0; - const uintptr_t icache_lsize =3D 4 << extract32(ctr_el0, 0, 4); - const uintptr_t dcache_lsize =3D 4 << extract32(ctr_el0, 16, 4); + const uint64_t ctr_el0 =3D save_ctr_el0; + const uintptr_t icache_lsize =3D 4 << extract64(ctr_el0, 0, 4); + const uintptr_t dcache_lsize =3D 4 << extract64(ctr_el0, 16, 4); uintptr_t p; =20 /* --=20 2.27.0