From patchwork Wed Jun 25 11:55:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 32473 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f71.google.com (mail-oa0-f71.google.com [209.85.219.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 94A8420C88 for ; Wed, 25 Jun 2014 11:57:42 +0000 (UTC) Received: by mail-oa0-f71.google.com with SMTP id n16sf9947586oag.6 for ; Wed, 25 Jun 2014 04:57:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:date:from:user-agent :mime-version:to:references:in-reply-to:cc:subject:precedence :list-id:list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=84Wl+eoGNF18CIImKfZvAp2GHkd4U8QdQ8UyDuaKL7k=; b=lZdhqUAQIprCr++j/09+9/yagDHQIn1oYAkwHZm7LnGxgnDicVXdQYM2Ho9UXHLtV3 9KzN/eW5CmYfuPs9zZQTE7u9zPYD05mTPtgANxrzkNydJi6oQJV1ReUAg6TJ8rXcE3kj 0lGg8o8CuKcrUdF0+iNKYqq8zN7ClnirPY9ZcMbY8a15MYKsqiE0wWQRsLpi67YeqaUF EefsNYN0cK9PillVAGFv59Tu9WMmEtPpYwAZSpUCZXqCuD2vk2zA/3ufQXcOCRT/Nz72 PWt99BG0KPPw+l5yrIBbyXHOSJwgqjWlDrbHRHYoexu4bzBDI7MSrhooLYcx49+V1XQn krRA== X-Gm-Message-State: ALoCoQn1gYKey7GpN6wzafbzedtBSmEid8nEAHRo2720SXL5TSIErobGDEtkR/YozEzvMu69FFwP X-Received: by 10.182.95.40 with SMTP id dh8mr4180022obb.5.1403697462206; Wed, 25 Jun 2014 04:57:42 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.89.104 with SMTP id u95ls2834185qgd.5.gmail; Wed, 25 Jun 2014 04:57:42 -0700 (PDT) X-Received: by 10.52.137.109 with SMTP id qh13mr175118vdb.63.1403697462084; Wed, 25 Jun 2014 04:57:42 -0700 (PDT) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by mx.google.com with ESMTPS id s5si2094409vcu.2.2014.06.25.04.57.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 25 Jun 2014 04:57:41 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.177 as permitted sender) client-ip=209.85.128.177; Received: by mail-ve0-f177.google.com with SMTP id i13so1819326veh.36 for ; Wed, 25 Jun 2014 04:57:41 -0700 (PDT) X-Received: by 10.58.220.230 with SMTP id pz6mr6482036vec.9.1403697461765; Wed, 25 Jun 2014 04:57:41 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp283284vcb; Wed, 25 Jun 2014 04:57:41 -0700 (PDT) X-Received: by 10.50.77.34 with SMTP id p2mr2920871igw.31.1403697461158; Wed, 25 Jun 2014 04:57:41 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id a13si3127501igm.21.2014.06.25.04.57.40 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 25 Jun 2014 04:57:41 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WzlnR-0000ne-He; Wed, 25 Jun 2014 11:55:25 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WzlnP-0000nZ-Et for xen-devel@lists.xenproject.org; Wed, 25 Jun 2014 11:55:23 +0000 Received: from [85.158.143.35:34781] by server-1.bemta-4.messagelabs.com id E9/6B-09496-AA8BAA35; Wed, 25 Jun 2014 11:55:22 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-8.tower-21.messagelabs.com!1403697321!13744875!1 X-Originating-IP: [209.85.212.173] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 32162 invoked from network); 25 Jun 2014 11:55:21 -0000 Received: from mail-wi0-f173.google.com (HELO mail-wi0-f173.google.com) (209.85.212.173) by server-8.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 25 Jun 2014 11:55:21 -0000 Received: by mail-wi0-f173.google.com with SMTP id cc10so7625393wib.6 for ; Wed, 25 Jun 2014 04:55:21 -0700 (PDT) X-Received: by 10.194.189.230 with SMTP id gl6mr3148007wjc.118.1403697320934; Wed, 25 Jun 2014 04:55:20 -0700 (PDT) Received: from [10.80.2.139] ([185.25.64.249]) by mx.google.com with ESMTPSA id hs8sm52986963wib.10.2014.06.25.04.55.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 25 Jun 2014 04:55:20 -0700 (PDT) Message-ID: <53AAB8A5.1040205@linaro.org> Date: Wed, 25 Jun 2014 12:55:17 +0100 From: Julien Grall User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Icedove/24.5.0 MIME-Version: 1.0 To: Ian Campbell References: <1403684892.3875.10.camel@kazak.uk.xensource.com> <53AAB535.6040705@linaro.org> <1403696700.13396.6.camel@kazak.uk.xensource.com> In-Reply-To: <1403696700.13396.6.camel@kazak.uk.xensource.com> Cc: John McDermott , xen-devel@lists.xenproject.org Subject: Re: [Xen-devel] Can't clone static arm64 binary from https://github.com/susematz/qemu/tree/aarch64-1.6 X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.177 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: On 06/25/2014 12:45 PM, Ian Campbell wrote: > On Wed, 2014-06-25 at 12:40 +0100, Julien Grall wrote: >> On 06/25/2014 09:28 AM, Ian Campbell wrote: >>> On Tue, 2014-06-24 at 13:57 -0400, John McDermott wrote: >>>> Xen Developers, >>>> >>>> Trying to build arm64 on x86_64 following the guidance on the wiki; >>>> everything ok 'till I have to run qemu static for arm64. It fails >>>> because there is no arm64 specific binary installed in Ubuntu 13.10, >>>> even though the wiki procedure says it should work. >>> >>> Which wiki page? >>> >>>> Not to worry; get the source and build it, I think. >>>> >>>> However, I cannot clone the git repo for the source, no matter which system I clone from. I even tried it from a Mac and get the same "fatal repo not found" error. >>>> >>>> The repo is 'https://github.com/susematz/qemu/tree/aarch64-1.6/' and I can see it in my browser just fine. >>>> >>>> Is there an alternative source for this code? >>> >>> IIRC it's all in mainline qemu these days. >> >> Last time I tried mainline QEMU (it was about a month ago), I was not >> able to build the different package with an opensuse rootfs. >> >> It was because of the threading issue. I don't think it has been fixed yet. > > The threading issue affects the Xen tools build? Or were you building > something else? Actually it was affecting the package manager zypper: sh-4.2# zypper install gcc Retrieving repository 'openSUSE-13.1-repo-update' metadata -----------------------------------------------------------------------------------------------------------------------------------------------------[|] *** Error in `/usr/bin/zypper': malloc(): memory corruption: 0x0000004004000fc0 *** Segmentation fault (core dumped) sh-4.2# zypper install gcc Retrieving repository 'openSUSE-13.1-repo-update' metadata -----------------------------------------------------------------------------------------------------------------------------------------------------[\] /home/xentest/works/qemu/tcg/tcg.c:1693: tcg fatal error I had a chat with Alexander Graf and Alex Bennée. IIRC they were looking to a nice way to handle it in qemu upstream. In meantime, if you want to use QEMU mainline with the opensuse rootfs, you can add this patch (copied from the suse tree): commit ca45f1d446ca88675e85bf80f133d3d8d955dbf0 Author: Alexander Graf Date: Tue Jul 10 20:40:55 2012 +0200 linux-user: Run multi-threaded code on a single core Running multi-threaded code can easily expose some of the fundamental breakages in QEMU's design. It's just not a well supported scenario. So if we pin the whole process to a single host CPU, we guarantee that we will never have concurrent memory access actually happen. We can still get scheduled away at any time, so it's no complete guarantee, but apparently it reduces the odds well enough to get my test cases to pass. This gets Java 1.7 working for me again on my test box. Signed-off-by: Alexander Graf diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 4823aa0..ff5ed06 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -4334,6 +4334,15 @@ static int do_fork(CPUArchState *env, unsigned int flags, abi_ulong newsp, if (nptl_flags & CLONE_SETTLS) cpu_set_tls (new_env, newtls); + /* agraf: Pin ourselves to a single CPU when running multi-threaded. + This turned out to improve stability for me. */ + { + cpu_set_t mask; + CPU_ZERO(&mask); + CPU_SET(0, &mask); + sched_setaffinity(0, sizeof(mask), &mask); + } + /* Grab a mutex so that thread setup appears atomic. */ pthread_mutex_lock(&clone_lock);