From patchwork Sun Sep 17 15:05:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 112845 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp2741220qgf; Sun, 17 Sep 2017 08:06:25 -0700 (PDT) X-Received: by 10.200.43.123 with SMTP id 56mr43967337qtv.15.1505660785401; Sun, 17 Sep 2017 08:06:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505660785; cv=none; d=google.com; s=arc-20160816; b=TMbNAIm4X8jRVtic/w/TEb7Ux+ytg0P9yoCAeFC5eBtbkqc5DPZoAXQd/UHTmLcpGV W3P0i0hMM512VuzOWi/UzivHyyZoj1SwKkek4u0Js6rO8RJA+HrNp28LK/7VS1XB01Ve E4oMlhL0ky6nB9VtvZj4Av9pNcUvVZbUcWRkq+M9B+PAgHo+itJj4Xz/hHoZMqGrEVtR 37y/ErXgTK/tb/CtjYCJKjfAfOZn3RSnvlDnUZ0qhtOIf6VP/lYEOpBaM6BPzrj9eKKs 5QYBBdfywxbY0iXAqRGPU29BI/ukktgm8nAerLB36YnYqTuX2zLuDzO3Rwbj5r2oavnK V9Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=QV5B316/IOrstIT9t3pNiRPzpl6AzfL69aribZ1H694=; b=DMZ5BaJzwr6r74QqbprMkBuW2AWHuvCVzJNGZv4wN0HOFuOwrXECrp0Cqdrf01Ehsx akFD8jKub1Eb68sEikAX9XqUx/fRXrGf92RGi52F7fsCHAc2FB4dBOf6vwPnjRdXTNbs 0jwE7p/JVshOZ3ZGr5Ia4yGtaFBcwYlqpsboNw3aMwrcS879hTNWSBjg7xsE0qCsnxzV jUTz6CdLdbWM36myop6ZLowldGqqfNINhqRWyaVyjNtIfFs0ngSeCX6YBiqnzU9zzi80 DqscfRqDVwngbgflBuJ9bijS1dXkrx8qIIsLWCbsmrEkOq6rwLLJwnjE8u1TMQMLs6xU vPLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=XVOApbY2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id n16si5306398qtf.26.2017.09.17.08.06.25 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 17 Sep 2017 08:06:25 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=XVOApbY2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:60908 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dtb9L-0007zO-5h for patch@linaro.org; Sun, 17 Sep 2017 11:06:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52396) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dtb8o-0007yf-DY for qemu-devel@nongnu.org; Sun, 17 Sep 2017 11:05:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dtb8j-00086j-GY for qemu-devel@nongnu.org; Sun, 17 Sep 2017 11:05:50 -0400 Received: from mail-oi0-x22b.google.com ([2607:f8b0:4003:c06::22b]:56901) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dtb8j-00085s-A1 for qemu-devel@nongnu.org; Sun, 17 Sep 2017 11:05:45 -0400 Received: by mail-oi0-x22b.google.com with SMTP id y195so3686575oia.13 for ; Sun, 17 Sep 2017 08:05:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QV5B316/IOrstIT9t3pNiRPzpl6AzfL69aribZ1H694=; b=XVOApbY2xUP+UmpU0IYSQu4sJdYF1TZLLX2/SY+AqrP8G0wy3ZeL9ICzeI8dxodM79 rcmn2GDZp+A3r+70NIycQPtkvWsUA8oc2OD2VSQI26OYshRiKHBFdxX7PO17qq9bsbNJ byzpNId56X+Q6EX7u/Vdmff3O2CIXpzO9cqJU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QV5B316/IOrstIT9t3pNiRPzpl6AzfL69aribZ1H694=; b=dXpMFDXNi7ENj5sU8Zf5tQQRYM1AnksgyvSZ4ll6N0VHrHdu/XpKEU4r2yllV/HrGA +oWfv452w3WJktgXpwuZAry6xCIh5+0o4kftTd4QgbXL7QtuXBQMNCumAZZp4OCYEttN TSfDNh9j3dU1Sv0/bUhj0xadxReFdzxdj29dyYpbD2S9EgFTimtLHm3MISCTnio7rwyP 54qUsIeAnM6SbdNgwa1a2kFJ9d8fd/4+tuN5MDKVpb/Sh/1/jv6At9hAV2nPXhzbi/GF 0crnBgCoTOGb6xR1yq5ScFytfIwN525OgIKPj5Ub6eaw2dbv2GTPSo46YwLgIj90hqXs enVw== X-Gm-Message-State: AHPjjUi5ZN9VRDpqJEcDIKG1TDMJs3Pm45v2/Z9A896SO1NqAoI4nQt6 4ELytU5FCbItKB+wQm1KrA== X-Google-Smtp-Source: AOwi7QD1mfRilSSmjI9ZsRjChrR1SvKvnWbaBWg0clW28ShVUNjV52yuNbBBhKptK+LpmOoUkBo7TA== X-Received: by 10.202.180.84 with SMTP id d81mr33900785oif.15.1505660744345; Sun, 17 Sep 2017 08:05:44 -0700 (PDT) Received: from bigtime.twiddle.net (162.189-204-159.bestel.com.mx. [189.204.159.162]) by smtp.gmail.com with ESMTPSA id j2sm5348789oia.20.2017.09.17.08.05.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 17 Sep 2017 08:05:43 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sun, 17 Sep 2017 08:05:19 -0700 Message-Id: <20170917150535.8284-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170917150535.8284-1-richard.henderson@linaro.org> References: <20170917150535.8284-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c06::22b Subject: [Qemu-devel] [PULL 01/17] tcg/ppc: disable atomic write check on ppc32 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé This fixes building for ppc64 on ppc32 (changed in 5964fca8a12c): tcg/ppc/tcg-target.inc.c: In function 'tb_target_set_jmp_target': include/qemu/compiler.h:86:30: error: static assertion failed: \ "not expecting: sizeof(*(uint64_t *)jmp_addr) > ATOMIC_REG_SIZE" QEMU_BUILD_BUG_ON(sizeof(*ptr) > ATOMIC_REG_SIZE); \ ^ tcg/ppc/tcg-target.inc.c:1377:9: note: in expansion of macro 'atomic_set' atomic_set((uint64_t *)jmp_addr, pair); ^ Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20170911204936.5020-1-f4bug@amsat.org> [rth: Added commentary requested by pmm.] Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.inc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.13.5 diff --git a/tcg/ppc/tcg-target.inc.c b/tcg/ppc/tcg-target.inc.c index 21d764c102..3c9355844a 100644 --- a/tcg/ppc/tcg-target.inc.c +++ b/tcg/ppc/tcg-target.inc.c @@ -1374,7 +1374,9 @@ void tb_target_set_jmp_target(uintptr_t tc_ptr, uintptr_t jmp_addr, pair = (uint64_t)i2 << 32 | i1; #endif - atomic_set((uint64_t *)jmp_addr, pair); + /* As per the enclosing if, this is ppc64. Avoid the _Static_assert + within atomic_set that would fail to build a ppc32 host. */ + atomic_set__nocheck((uint64_t *)jmp_addr, pair); flush_icache_range(jmp_addr, jmp_addr + 8); } else { intptr_t diff = addr - jmp_addr;