From patchwork Wed Jun 11 14:29:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 31768 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f199.google.com (mail-yk0-f199.google.com [209.85.160.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 647B52054B for ; Wed, 11 Jun 2014 14:33:01 +0000 (UTC) Received: by mail-yk0-f199.google.com with SMTP id q200sf4289928ykb.10 for ; Wed, 11 Jun 2014 07:33:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=9HJ7gayf45u3ZQ8rsVW1Pu1Li8iklBWGd71OOpPYlwQ=; b=LWXDNZGwwt/T1onyOVwvm9J/gw4OYvxMD7vuUZUhFrfbPgK07pWUEm2aQNqmSNK6+w di2WJ4Md1nHz0WZos+mI5LnryugXQikOiiEoxr3rGksyF07CwyjcZIlq5ZMAoazAE6Im c8RUmbB3XivQB93f0acF7lBVRVNnZqQt7Yxe23k0DwcMrQjvwf6HrDtdLKsN41mCcUNK PegWAGyMFYQmMKDiCRDt/VWNefj/s3Exm23U+fgIlvR5O3zFTWPzRD+4cuI87L5iwXwv aAB2d78WSrJLYnLLm/mHF/HpqVvpUhwHgB+jUHIjtIJ/X5tjzbEATy6Ow0ohGZvNb1O5 2cDQ== X-Gm-Message-State: ALoCoQk1QV55yho9rDagmJgS/g32nOQyGzjkgBd2l0aNakrDDwFbZyfu4Q6t4ngAfBZ4LrpaIEi6 X-Received: by 10.52.186.132 with SMTP id fk4mr6919000vdc.1.1402497181211; Wed, 11 Jun 2014 07:33:01 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.86.100 with SMTP id o91ls2746323qgd.30.gmail; Wed, 11 Jun 2014 07:33:01 -0700 (PDT) X-Received: by 10.52.233.9 with SMTP id ts9mr72622vdc.96.1402497181092; Wed, 11 Jun 2014 07:33:01 -0700 (PDT) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id em3si14283118veb.76.2014.06.11.07.33.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Jun 2014 07:33:01 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.182 as permitted sender) client-ip=209.85.128.182; Received: by mail-ve0-f182.google.com with SMTP id jx11so214711veb.13 for ; Wed, 11 Jun 2014 07:33:00 -0700 (PDT) X-Received: by 10.220.47.201 with SMTP id o9mr454608vcf.65.1402497180878; Wed, 11 Jun 2014 07:33:00 -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.54.6 with SMTP id vs6csp308555vcb; Wed, 11 Jun 2014 07:33:00 -0700 (PDT) X-Received: by 10.140.30.70 with SMTP id c64mr47930534qgc.13.1402497180110; Wed, 11 Jun 2014 07:33:00 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id q10si31620857qak.116.2014.06.11.07.33.00 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 11 Jun 2014 07:33:00 -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; Received: from localhost ([::1]:46829 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WujaF-0008Lk-Mz for patch@linaro.org; Wed, 11 Jun 2014 10:32:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38341) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WujXQ-0004o1-BH for qemu-devel@nongnu.org; Wed, 11 Jun 2014 10:30:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WujXP-0008J0-9l for qemu-devel@nongnu.org; Wed, 11 Jun 2014 10:30:04 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:48600) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WujXP-0008DN-3j for qemu-devel@nongnu.org; Wed, 11 Jun 2014 10:30:03 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1WujXF-00075i-Sz; Wed, 11 Jun 2014 15:29:53 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Wed, 11 Jun 2014 15:29:45 +0100 Message-Id: <1402496993-27206-8-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1402496993-27206-1-git-send-email-peter.maydell@linaro.org> References: <1402496993-27206-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Cc: Blue Swirl Subject: [Qemu-devel] [PULL 07/15] exec: replace ffsl with ctzl X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@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.182 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 From: Natanael Copa See commit fbeadf50 (bitops: unify bitops_ffsl with the one in host-utils.h, call it bitops_ctzl) on why ctzl should be used instead of ffsl. This is also needed for musl libc which does not implement ffsl. Signed-off-by: Natanael Copa Reviewed-by: Paolo Bonzini Signed-off-by: Peter Maydell --- include/exec/ram_addr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h index 2edfa96..b94de02 100644 --- a/include/exec/ram_addr.h +++ b/include/exec/ram_addr.h @@ -117,7 +117,7 @@ static inline void cpu_physical_memory_set_dirty_lebitmap(unsigned long *bitmap, if (bitmap[i] != 0) { c = leul_to_cpu(bitmap[i]); do { - j = ffsl(c) - 1; + j = ctzl(c); c &= ~(1ul << j); page_number = (i * HOST_LONG_BITS + j) * hpratio; addr = page_number * TARGET_PAGE_SIZE;