From patchwork Fri Jun 7 18:56:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Hibbits X-Patchwork-Id: 1112247 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="F9HPRoQn"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45LFDt2D5Tz9s7h for ; Sat, 8 Jun 2019 06:56:12 +1000 (AEST) Received: from localhost ([::1]:53130 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZLuC-0005wx-E6 for incoming@patchwork.ozlabs.org; Fri, 07 Jun 2019 16:56:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58692) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZK4B-0003wG-Ic for qemu-devel@nongnu.org; Fri, 07 Jun 2019 14:58:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hZK4A-0000Jb-6r for qemu-devel@nongnu.org; Fri, 07 Jun 2019 14:58:19 -0400 Received: from mail-io1-xd2e.google.com ([2607:f8b0:4864:20::d2e]:46990) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hZK47-0000Cp-Vg; Fri, 07 Jun 2019 14:58:17 -0400 Received: by mail-io1-xd2e.google.com with SMTP id i10so2198068iol.13; Fri, 07 Jun 2019 11:58:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version; bh=pTlDTBeN6Va+KeL8S/f6Vzv4kGmmDInyghUhYEIvcFo=; b=F9HPRoQnsDq8IF4Tfova7/C+SiiGrd6lDA3sfMoIFpUdlCZKg/WroEOZA4RarKoDrG g7kaVol0MWFMbS48Kix8q7QiVJQU3LAbk/U86t2KFqe2etzix5a5w+RuVVnEo9tO3cem Atv4MGR0eMLgb/ByEvVcQe2X3CD7LUs0zTosyDFsnjFO+LgO8hl7hPTNAmDDMBAyXtiJ RmLJJQ3zDkLaP8BQ46WsOf2hYcXw6b50SCdJxa/isekiTm7mM3+SvruhW88VW6bs3tRb a2cSfLCNBYxwEdblVICHsru9zPaBn9WJ9WpiHteCBdNHhKqiDTxuuHLsd4VsSaNvcpZD YKHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version; bh=pTlDTBeN6Va+KeL8S/f6Vzv4kGmmDInyghUhYEIvcFo=; b=LrEGfCYcU6v75qYub9bI9oCftBXUe2LUltVJQmzYX72IKdLsL/mHPWW4TtpS6wb3E1 kbSqFB54mB9CZxEM8P+I5Vmbui8uwIm/OMZenFCohVkPtj9r0LZ+3cE/DpT+aEwN7yfK GdHQ+OlAPkD2RKrXEFPuOeCl778QBiWtuFeJldW2EHmOz1bPnOiz3mXuY8QjZHAYNbbV gp+O+aLgRu4bT1T7J1QtjJ2bt8K96iQAsJmf5UFaEqo6DadJtHJ0rhNunMTQX32JaLN1 poy2NOlri71dWuWwfCM3VIIeB9vFKMZf+vq7ixarraFwAh3Jnm+A9Il8EyuoZEL7Wo2j 1d3w== X-Gm-Message-State: APjAAAUAEnpCCjRJBVrr0wU7hqYueMH3brYh/0IGcGPUUKHxAnio9YoK l0CJBY8j7VNt7Hy7k4vv62w4dyqZPF0= X-Google-Smtp-Source: APXvYqxb32ur/zR/Z+NnuP4JL/F9kKJuT9TGVMuJHLjWwoa8oEVg8NqJqVk0gXi0v2Eo3Iyn832FlQ== X-Received: by 2002:a5d:9d97:: with SMTP id 23mr33942975ion.204.1559933892615; Fri, 07 Jun 2019 11:58:12 -0700 (PDT) Received: from titan.knownspace (173-25-245-129.client.mchsi.com. [173.25.245.129]) by smtp.gmail.com with ESMTPSA id d75sm1250814itd.10.2019.06.07.11.58.10 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 07 Jun 2019 11:58:12 -0700 (PDT) Date: Fri, 7 Jun 2019 13:56:53 -0500 From: Justin Hibbits To: qemu-devel@nongnu.org Message-ID: <20190607135653.6ece685d@titan.knownspace> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; powerpc64-portbld-freebsd13.0) MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::d2e X-Mailman-Approved-At: Fri, 07 Jun 2019 16:55:30 -0400 Subject: [Qemu-devel] Fix cacheline size retrieval on FreeBSD/PowerPC(64) 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: qemu-trivial@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The attached very trivial patch fixes a startup bug that prevents at least Qemu 3.1 and later from working on FreeBSD/powerpc64. - Justin Reviewed-by: Laurent Vivier From 74a70fdcfa5347e7637aa36276c55781f19de72a Mon Sep 17 00:00:00 2001 From: Justin Hibbits Date: Fri, 7 Jun 2019 13:44:51 -0500 Subject: [PATCH] Fix cacheline detection on FreeBSD/powerpc. machdep.cacheline_size is an integer, not a long. Since PowerPC is big-endian this causes sysctlbyname() to fill in the upper bits of the argument, rather than the correct 'lower bits' of the word. Specify the correct type to fix this. Signed-off-by: Justin Hibbits --- util/cacheinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/cacheinfo.c b/util/cacheinfo.c index eebe1ce9c5..516f837748 100644 --- a/util/cacheinfo.c +++ b/util/cacheinfo.c @@ -77,7 +77,7 @@ static void sys_cache_info(int *isize, int *dsize) static void sys_cache_info(int *isize, int *dsize) { /* There's only a single sysctl for both I/D cache line sizes. */ - long size; + int size; size_t len = sizeof(size); if (!sysctlbyname(SYSCTL_CACHELINE_NAME, &size, &len, NULL, 0)) { *isize = *dsize = size; -- 2.21.0