From patchwork Mon Jun 25 12:41:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934241 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="pL6KtTs4"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41Dpl400pLz9rvt for ; Mon, 25 Jun 2018 22:43:58 +1000 (AEST) Received: from localhost ([::1]:46595 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQqY-0000rO-HY for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 08:43:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53406) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQpm-0000r7-1G for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:43:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQpk-0007Pn-U7 for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:43:06 -0400 Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]:44057) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQpk-0007PX-PI; Mon, 25 Jun 2018 08:43:04 -0400 Received: by mail-qt0-x243.google.com with SMTP id 92-v6so7286011qta.11; Mon, 25 Jun 2018 05:43:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=j6CqAxNTNqVw81Wnn61HPIr4uVr6dhnmtty1+UveJNg=; b=pL6KtTs45tQA7NU0xE4CWBokUISslrZQZE9ubE8rXU8xINe3SbYKQL2rZum3ZvCiOu /niXL9uz6cTek/s/feZ6yHbxzugj+Wo8ZHOYh9ErXEQZchiupESGmdIr2lnpssxM17qv SpprxqMAcPsdNGObPJssOYBvNr8GPnDwytObwJ5T4vjd+D+yB+xw4hhWLxSgTvU1Zj2g HVg1G94m199edng43ejwnTtynz8EumLx5NGlFqQKikvKsLkZUIge5C7cwNvtFb3QIyPi 7TWMAJYe55p/DXrwGTWWkkAWaVhhuIVZ/O2JcEnlWKG0tKasxa5EOrWCVqov9llX+TaK SfOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=j6CqAxNTNqVw81Wnn61HPIr4uVr6dhnmtty1+UveJNg=; b=CU68uim5ftBiV1WbCRGsU5a16iNYZM8F8ER1W6L4OfSrn7T3LkrzpnADTLBpQKHKRK w8inn7tRtNnxSEMNWdHbyMuMFP1KG8R4sjW3CJkdPsSlCm9feN25YhNFWVqYB3Lgylkn K8teqBTujcoAS0gs4bvA9FXf0K2eCOInlghU29Kgg1HiXRuI/s9nk6u9Yf6L56w8qtre Gy2vQDFHUCpXuUaUTuYtu/57NYu5i8c8M7164xX82Xw2OwusyAmGdbu+iFV9nuydBeLa aoK6nB24Uj4lr5/bNqEBR/dFwh6dLzW/YtgtdoIiPpz4EAi0zzFy82zw3AoCkO/sBUhS MbXA== X-Gm-Message-State: APt69E1AkjmD5uPt5MtUC3fMPybOSC5FxRxkueRPhxs6UlqBTtDAQeNE K1Z7rEzKYctbhpm2sDzxqcA= X-Google-Smtp-Source: ADUXVKIolTAG3wMZSonZH13ZaKn0viO8RkTwyYtGmW8tSMQwHCvwJezHs+KN+hPIuEv0YvgLoT1Cqg== X-Received: by 2002:ac8:5393:: with SMTP id x19-v6mr10343274qtp.402.1529930584224; Mon, 25 Jun 2018 05:43:04 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.43.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:43:03 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil Date: Mon, 25 Jun 2018 09:41:53 -0300 Message-Id: <20180625124238.25339-2-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::243 Subject: [Qemu-devel] [PATCH v5 01/46] include: Add IEC binary prefixes in "qemu/units.h" 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: qemu-trivial@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Loosely based on 076b35b5a56. Suggested-by: Stefan Weil Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- include/qemu/units.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 include/qemu/units.h diff --git a/include/qemu/units.h b/include/qemu/units.h new file mode 100644 index 0000000000..692db3fbb2 --- /dev/null +++ b/include/qemu/units.h @@ -0,0 +1,20 @@ +/* + * IEC binary prefixes definitions + * + * Copyright (C) 2015 Nikunj A Dadhania, IBM Corporation + * Copyright (C) 2018 Philippe Mathieu-Daudé + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef QEMU_UNITS_H +#define QEMU_UNITS_H + +#define KiB (INT64_C(1) << 10) +#define MiB (INT64_C(1) << 20) +#define GiB (INT64_C(1) << 30) +#define TiB (INT64_C(1) << 40) +#define PiB (INT64_C(1) << 50) +#define EiB (INT64_C(1) << 60) + +#endif From patchwork Mon Jun 25 12:41:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934246 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="gQuOxpQg"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41Dppl4BLkz9rvt for ; Mon, 25 Jun 2018 22:47:11 +1000 (AEST) Received: from localhost ([::1]:46622 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQth-0003hN-5y for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 08:47:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53479) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQpr-0000tt-8R for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:43:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQpq-0007Rp-H3 for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:43:11 -0400 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]:44056) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQpq-0007Rb-EL; Mon, 25 Jun 2018 08:43:10 -0400 Received: by mail-qt0-x241.google.com with SMTP id 92-v6so7286272qta.11; Mon, 25 Jun 2018 05:43:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=feBaDpy6a9bjLAF7fPXliaXcD/sYBNQfY1bgHLYC8nQ=; b=gQuOxpQg2mYhuNUBQCPq0CNa3O8OHWXEhgbEs5Mwl1NcJ7SwwVPx0ESafRPe9cKsim N1oKQ3UkCuECAftBI5qtAV+7ApKqg1ssWzT9Ty5UUgmHZ8jZ/mjmEEXsSZGqIFvntjJr 6F9a6s3M0wnHjo5g3QkGEz7CbKuSUXzJuievXS/HvmMpK+vfkqxr6Q5ALOSfqvt0aC0U VlxQ1ARTmasUWkvyOEts/f010Q8rWmWebRDWG7TLf11/VWIVuSexDoFB8kMYohiexfWC jWugS17sWrpJdgH6NBBPEqEVHnHR3mTPtIAr1fbfeI1+x1fkFM2fcsr2Hie6gKg3ErBj L8ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=feBaDpy6a9bjLAF7fPXliaXcD/sYBNQfY1bgHLYC8nQ=; b=JZ4jH+bIKCKYekEmp5vwUWsCjyxWIyCcnCdKFoZnVcBLk1vIybm82YLUGwhlSE9K9g UmfiGTfSEQmO6CZrLWFpVPcGxRlFzMlLBs8TXyBLEQ7ASq/ooNrUg6iL2aPcV07jQ0l1 WybHgL2hkB1H97ARVP0HaD21uxsZUmyT2o+YA8MXoZkMrjfCKaaoR545DR08FWY55Fo/ QDrU+d3hMI32UXkSjAmaKPuh70dWc0gNvlF45PuQwgUs0f+ml2EIBkrc+jvoKOX/T/A+ 6uy86AUIWfA6NgFU8knIlVJc5XRyPyuQyI6Rcpso+e4dZ+kPof2sGAr2FGxMdyROe/1y 46KQ== X-Gm-Message-State: APt69E2F1dUm2ULWANCGQzBXvJP6OaYsqpCEsWYQptpne5WKNWTfSdR3 C8/gLegKF4LK8UmNEmJJboQ= X-Google-Smtp-Source: AAOMgpcPocCM+YqWW6gWtVLwJ9a/L86LLxj/z/eVasS09GkUDdr51+KnQHPaUnYlhju33PmLTcdT4w== X-Received: by 2002:a0c:e087:: with SMTP id l7-v6mr10819471qvk.217.1529930589956; Mon, 25 Jun 2018 05:43:09 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.43.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:43:09 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil Date: Mon, 25 Jun 2018 09:41:55 -0300 Message-Id: <20180625124238.25339-4-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::241 Subject: [Qemu-devel] [PATCH v5 03/46] x86/cpu: Use definitions from "qemu/units.h" 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: Eduardo Habkost , qemu-trivial@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Paolo Bonzini , Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé Acked-by: Eduardo Habkost Reviewed-by: Richard Henderson --- target/i386/cpu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 1e69e68f25..a5c9200788 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -18,6 +18,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qemu/cutils.h" #include "cpu.h" @@ -64,9 +65,6 @@ struct CPUID2CacheDescriptorInfo { int associativity; }; -#define KiB 1024 -#define MiB (1024 * 1024) - /* * Known CPUID 2 cache descriptors. * From Intel SDM Volume 2A, CPUID instruction From patchwork Mon Jun 25 12:41:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934243 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="sYP0lrUJ"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41Dplg1qxdz9rvt for ; Mon, 25 Jun 2018 22:44:31 +1000 (AEST) Received: from localhost ([::1]:46600 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQr6-0001HQ-TM for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 08:44:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53558) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQpv-0000yd-A0 for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:43:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQpu-0007To-8q for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:43:15 -0400 Received: from mail-qk0-x236.google.com ([2607:f8b0:400d:c09::236]:44499) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQpu-0007Tg-4z for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:43:14 -0400 Received: by mail-qk0-x236.google.com with SMTP id 185-v6so7357488qkk.11 for ; Mon, 25 Jun 2018 05:43:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3Cl8LjIJOGCfgmQB2Oe6rnPuQFvSoFWOVhEKHvi8grs=; b=sYP0lrUJV7d4n5KKvPDPmLY/yjjpcjiZBfNksj9YcP1BztEun2IkMGyvi8TzmvJH++ coLHVsyA+0A91LXzfmLAFB5bWsT2dN6j9gCpngNkoXCujuKMXRjXyQiakvyt0W9OSwEs xtGdOR2RXzSeCEXEw46Yr9rC4WGDEn4tq8oNlGS3SugqKfvN500DDLS9o6PD5hR9Mmot 8rKINEDGaIC6uwiSmswCXD8+T+M+QyJ6dCYsBm/rZrcj0O9N++KActJxEN8mLnfhlww2 R3hMDXYAabh2fRqJwvWj5nsKeZ4ouIkIYIt2YexBy4N3wO83BI5DfyzUJM9MwBOomeP5 L92A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=3Cl8LjIJOGCfgmQB2Oe6rnPuQFvSoFWOVhEKHvi8grs=; b=rrQXF+8A8hXIX/bno2/UkN4fn5urSIMj4difxjjq571OOltE6WRq9JxK0j92SLGfdm p6rZydl1DYuGQUNJ+Lfaq+dj1ST1I+ODZsruYnlwVMFuRKyor+Nn9rsBlrRy8nNsYMW8 FDfRjiJBiWcn1q8lzfYQuGnFsVMGzi8ghi/KxpoaxhnF8FBqeAj7pGylo6uloy1ulftZ vXkVZOPvj5c7Dj49C7KDS0o7Nc79IfnAw08JytqKD66g5siY809DrLlqi50ZPUwCXobW vsa8Tn+eYDE6216R57Yo1DcBQOj7WDjUAKltPaJmOcfq2vHnTFoHGzyQfcJGQ2xZs10O +xfg== X-Gm-Message-State: APt69E3LJKx+gnoTGpN0DZb1SckKrBL0QqG3pu65kozoQo57h/IDY4av 3tPr8cjphzBwOEDDOax58xs= X-Google-Smtp-Source: ADUXVKI/ftVMfSlpaPt3NuHqKxq50Xh4D35nBlXf28Qlm1OumLkm636zevEW9YOHgg6IcQdn4jtFiw== X-Received: by 2002:a37:21a0:: with SMTP id f32-v6mr10360375qki.45.1529930593574; Mon, 25 Jun 2018 05:43:13 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.43.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:43:13 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , "Daniel P . Berrange" , Paolo Bonzini , Su Hang , Pasi Savanainen , =?utf-8?q?Llu=C3=ADs_Vilanova?= , Vladimir Sementsov-Ogievskiy , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Mon, 25 Jun 2018 09:41:56 -0300 Message-Id: <20180625124238.25339-5-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::236 Subject: [Qemu-devel] [PATCH v5 04/46] checkpatch: Recognize IEC binary prefix definitions 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: Joe Perches , Stefan Weil , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Do not match the IEC binary prefix as camelcase typedefs. This fixes: ERROR: "foo * bar" should be "foo *bar" #310: FILE: hw/ppc/ppc440_uc.c:564: + size = 8 * MiB * sh; total: 1 errors, 0 warnings, 433 lines checked Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Eric Blake --- scripts/checkpatch.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index e3d8c2cdfc..223681bfd0 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -242,6 +242,7 @@ our $UTF8 = qr{ # There are still some false positives, but this catches most # common cases. our $typeTypedefs = qr{(?x: + (?![KMGTPE]iB) # IEC binary prefix (do not match) [A-Z][A-Z\d_]*[a-z][A-Za-z\d_]* # camelcase | [A-Z][A-Z\d_]*AIOCB # all uppercase | [A-Z][A-Z\d_]*CPU # all uppercase From patchwork Mon Jun 25 12:41:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934248 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="s7UVLYGy"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41Dpq80sCCz9rvt for ; Mon, 25 Jun 2018 22:47:32 +1000 (AEST) Received: from localhost ([::1]:46625 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQu1-0003tP-Kp for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 08:47:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53662) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQq4-00017j-0p for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:43:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQq0-0007Wq-RS for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:43:24 -0400 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:44061) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQq0-0007Wh-N3; Mon, 25 Jun 2018 08:43:20 -0400 Received: by mail-qt0-x244.google.com with SMTP id 92-v6so7286811qta.11; Mon, 25 Jun 2018 05:43:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=k/yTfONVSdgAMsJKiu3RkRkvkA+9wibCMpE2ntjOmQg=; b=s7UVLYGyJDvqw9H2PlfcLJydb81wZPvbvNGGdMCqxam8DJWnEoQMWEnlorzkLVygqR Rr3N5jAWvAf1f5JIdCDv/rdFpHr/A7uIydO2pqgGYv+wq+y+BHZbRTP20lVL3dDyfHXr Q5EQrWEtQKcNi2tvT5LDU2wMcqy7hMtcsOxbYDKzmtrTcdjU0uE/5EnX0viePDS9ykOa uhkw/im85nIMhy7EfDiPdVNDpNM913x4SwtORQv32uoeDkQN9uJzTzgp9J18I2+C3OSB 1FlrarU0m2JeWS1rU4Wrw0pTX14lGIQ9y6hF8CbW62t3n37ME+V6bOnnr9cJHIhhE4uK LFIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=k/yTfONVSdgAMsJKiu3RkRkvkA+9wibCMpE2ntjOmQg=; b=Z93bIrkJL4KxoeULv2UfyAcnX/51PreQh9nMTHD/Av7UqRPCeHIpZ9kmPOhyfNRCZD nFmZ4smVdGHxN9hb+z+Vc851iD7woLRZVlzbBtepjD+dF9/WKPH1SzTbJr9uhd8HHn57 RwEIGM0u7XIU+myo1lg/vVuWcdoJWIuDz8ZhlfjENGa8sBk6K9Fopp5TJr4cgzj5NZY2 SGjQeQcn4Yndw0p4kiISVBDjvFTt4EKOez5Gq/hc0/SoDEbzFc8VWFmozyeqVcnfQ3C6 4P6a8nOruOh4L2XVPy4KM98/W31o8l9Eq7ySD4oIE8o+3H1GoEpo54sikryyN5+RDilz HNpw== X-Gm-Message-State: APt69E20bAnH1B4+7wvvM+GHc94lWvs3Hb1ZDopMjbEUwTXXvA9K2HWo hHy7Vu4tNYqzVnsNTEqhnj8= X-Google-Smtp-Source: ADUXVKJPBPxbOMMAm1ztuQ5pX+T0TW3gac0/TqJyZKG+6Rs+cW5DhgnuuUC19zeuyHCrvu8y61H3iA== X-Received: by 2002:ac8:2191:: with SMTP id 17-v6mr10806622qty.279.1529930599716; Mon, 25 Jun 2018 05:43:19 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.43.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:43:19 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil Date: Mon, 25 Jun 2018 09:41:57 -0300 Message-Id: <20180625124238.25339-6-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::244 Subject: [Qemu-devel] [PATCH v5 05/46] hw: Use IEC binary prefix definitions from "qemu/units.h" 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 , qemu-devel@nongnu.org, Eduardo Habkost , qemu-trivial@nongnu.org, Markus Armbruster , Alexander Graf , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Subbaraya Sundeep , Paul Burton , "open list:ARM" , =?utf-8?q?Herv=C3=A9_Poussineau?= , "open list:PowerPC" , David Gibson , Yongbok Kim , Aurelien Jarno , Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Code change produced with: $ git ls-files | egrep '\.[ch]$' | \ xargs sed -i -e 's/\(\W[KMGTPE]\)_BYTE/\1iB/g' Suggested-by: Stefan Weil Signed-off-by: Philippe Mathieu-Daudé Acked-by: David Gibson (ppc parts) Reviewed-by: Richard Henderson --- include/qemu/cutils.h | 8 +------- hw/arm/msf2-soc.c | 4 ++-- hw/arm/msf2-som.c | 6 +++--- hw/core/loader-fit.c | 3 ++- hw/core/machine.c | 2 +- hw/display/sm501.c | 14 +++++++------- hw/hppa/machine.c | 2 +- hw/mips/boston.c | 28 ++++++++++++++-------------- hw/ppc/pnv.c | 4 ++-- hw/ppc/ppc440_uc.c | 26 +++++++++++++------------- hw/ppc/prep.c | 2 +- hw/ppc/sam460ex.c | 2 +- hw/ppc/spapr.c | 10 +++++----- hw/ppc/spapr_rtas.c | 2 +- hw/sd/sd.c | 4 ++-- hw/sd/sdhci.c | 2 +- tests/test-cutils.c | 18 +++++++++--------- tests/test-keyval.c | 6 +++--- tests/test-qemu-opts.c | 7 +++---- 19 files changed, 72 insertions(+), 78 deletions(-) diff --git a/include/qemu/cutils.h b/include/qemu/cutils.h index a663340b23..056e6629bb 100644 --- a/include/qemu/cutils.h +++ b/include/qemu/cutils.h @@ -2,6 +2,7 @@ #define QEMU_CUTILS_H #include "qemu/fprintf-fn.h" +#include "qemu/units.h" /** * pstrcpy: @@ -147,13 +148,6 @@ int qemu_strtosz(const char *nptr, char **end, uint64_t *result); int qemu_strtosz_MiB(const char *nptr, char **end, uint64_t *result); int qemu_strtosz_metric(const char *nptr, char **end, uint64_t *result); -#define K_BYTE (1ULL << 10) -#define M_BYTE (1ULL << 20) -#define G_BYTE (1ULL << 30) -#define T_BYTE (1ULL << 40) -#define P_BYTE (1ULL << 50) -#define E_BYTE (1ULL << 60) - /* used to print char* safely */ #define STR_OR_NULL(str) ((str) ? (str) : "null") diff --git a/hw/arm/msf2-soc.c b/hw/arm/msf2-soc.c index 75c44adf7d..530e461c42 100644 --- a/hw/arm/msf2-soc.c +++ b/hw/arm/msf2-soc.c @@ -40,14 +40,14 @@ #define SRAM_BASE_ADDRESS 0x20000000 -#define MSF2_ENVM_MAX_SIZE (512 * K_BYTE) +#define MSF2_ENVM_MAX_SIZE (512 * KiB) /* * eSRAM max size is 80k without SECDED(Single error correction and * dual error detection) feature and 64k with SECDED. * We do not support SECDED now. */ -#define MSF2_ESRAM_MAX_SIZE (80 * K_BYTE) +#define MSF2_ESRAM_MAX_SIZE (80 * KiB) static const uint32_t spi_addr[MSF2_NUM_SPIS] = { 0x40001000 , 0x40011000 }; static const uint32_t uart_addr[MSF2_NUM_UARTS] = { 0x40000000 , 0x40010000 }; diff --git a/hw/arm/msf2-som.c b/hw/arm/msf2-som.c index 0795a3a3a1..ed533bbde1 100644 --- a/hw/arm/msf2-som.c +++ b/hw/arm/msf2-som.c @@ -33,10 +33,10 @@ #include "cpu.h" #define DDR_BASE_ADDRESS 0xA0000000 -#define DDR_SIZE (64 * M_BYTE) +#define DDR_SIZE (64 * MiB) -#define M2S010_ENVM_SIZE (256 * K_BYTE) -#define M2S010_ESRAM_SIZE (64 * K_BYTE) +#define M2S010_ENVM_SIZE (256 * KiB) +#define M2S010_ESRAM_SIZE (64 * KiB) static void emcraft_sf2_s2s010_init(MachineState *machine) { diff --git a/hw/core/loader-fit.c b/hw/core/loader-fit.c index 6387854b54..447f60857d 100644 --- a/hw/core/loader-fit.c +++ b/hw/core/loader-fit.c @@ -18,6 +18,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "exec/memory.h" #include "hw/loader.h" #include "hw/loader-fit.h" @@ -194,7 +195,7 @@ static int fit_load_fdt(const struct fit_loader *ldr, const void *itb, err = fit_image_addr(itb, img_off, "load", &load_addr); if (err == -ENOENT) { - load_addr = ROUND_UP(kernel_end, 64 * K_BYTE) + (10 * M_BYTE); + load_addr = ROUND_UP(kernel_end, 64 * KiB) + (10 * MiB); } else if (err) { ret = err; goto out; diff --git a/hw/core/machine.c b/hw/core/machine.c index 617e5f8d75..ccf3a4b9c7 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -522,7 +522,7 @@ static void machine_class_init(ObjectClass *oc, void *data) MachineClass *mc = MACHINE_CLASS(oc); /* Default 128 MB as guest ram size */ - mc->default_ram_size = 128 * M_BYTE; + mc->default_ram_size = 128 * MiB; mc->rom_file_has_mr = true; /* numa node memory size aligned on 8MB by default. diff --git a/hw/display/sm501.c b/hw/display/sm501.c index 8206ae81a1..3bd871630e 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -452,12 +452,12 @@ /* SM501 local memory size taken from "linux/drivers/mfd/sm501.c" */ static const uint32_t sm501_mem_local_size[] = { - [0] = 4 * M_BYTE, - [1] = 8 * M_BYTE, - [2] = 16 * M_BYTE, - [3] = 32 * M_BYTE, - [4] = 64 * M_BYTE, - [5] = 2 * M_BYTE, + [0] = 4 * MiB, + [1] = 8 * MiB, + [2] = 16 * MiB, + [3] = 32 * MiB, + [4] = 64 * MiB, + [5] = 2 * MiB, }; #define get_local_mem_size(s) sm501_mem_local_size[(s)->local_mem_size_index] @@ -1829,7 +1829,7 @@ static void sm501_realize_pci(PCIDevice *dev, Error **errp) } static Property sm501_pci_properties[] = { - DEFINE_PROP_UINT32("vram-size", SM501PCIState, vram_size, 64 * M_BYTE), + DEFINE_PROP_UINT32("vram-size", SM501PCIState, vram_size, 64 * MiB), DEFINE_PROP_END_OF_LIST(), }; diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index aba269bb85..2ba26962f9 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -275,7 +275,7 @@ static void machine_hppa_machine_init(MachineClass *mc) mc->max_cpus = HPPA_MAX_CPUS; mc->default_cpus = 1; mc->is_default = 1; - mc->default_ram_size = 512 * M_BYTE; + mc->default_ram_size = 512 * MiB; mc->default_boot_order = "cd"; } diff --git a/hw/mips/boston.c b/hw/mips/boston.c index 52cce19766..512c60c03e 100644 --- a/hw/mips/boston.c +++ b/hw/mips/boston.c @@ -200,7 +200,7 @@ static uint64_t boston_platreg_read(void *opaque, hwaddr addr, val |= PLAT_BUILD_CFG_PCIE2_EN; return val; case PLAT_DDR_CFG: - val = s->mach->ram_size / G_BYTE; + val = s->mach->ram_size / GiB; assert(!(val & ~PLAT_DDR_CFG_SIZE)); val |= PLAT_DDR_CFG_MHZ; return val; @@ -355,7 +355,7 @@ static const void *boston_fdt_filter(void *opaque, const void *fdt_orig, return NULL; } - ram_low_sz = MIN(256 * M_BYTE, machine->ram_size); + ram_low_sz = MIN(256 * MiB, machine->ram_size); ram_high_sz = machine->ram_size - ram_low_sz; qemu_fdt_setprop_sized_cells(fdt, "/memory@0", "reg", 1, 0x00000000, 1, ram_low_sz, @@ -436,8 +436,8 @@ static void boston_mach_init(MachineState *machine) int fw_size, fit_err; bool is_64b; - if ((machine->ram_size % G_BYTE) || - (machine->ram_size > (2 * G_BYTE))) { + if ((machine->ram_size % GiB) || + (machine->ram_size > (2 * GiB))) { error_report("Memory size must be 1GB or 2GB"); exit(1); } @@ -472,7 +472,7 @@ static void boston_mach_init(MachineState *machine) flash = g_new(MemoryRegion, 1); memory_region_init_rom_nomigrate(flash, NULL, - "boston.flash", 128 * M_BYTE, &err); + "boston.flash", 128 * MiB, &err); memory_region_add_subregion_overlap(sys_mem, 0x18000000, flash, 0); ddr = g_new(MemoryRegion, 1); @@ -482,22 +482,22 @@ static void boston_mach_init(MachineState *machine) ddr_low_alias = g_new(MemoryRegion, 1); memory_region_init_alias(ddr_low_alias, NULL, "boston_low.ddr", - ddr, 0, MIN(machine->ram_size, (256 * M_BYTE))); + ddr, 0, MIN(machine->ram_size, (256 * MiB))); memory_region_add_subregion_overlap(sys_mem, 0, ddr_low_alias, 0); xilinx_pcie_init(sys_mem, 0, - 0x10000000, 32 * M_BYTE, - 0x40000000, 1 * G_BYTE, + 0x10000000, 32 * MiB, + 0x40000000, 1 * GiB, get_cps_irq(s->cps, 2), false); xilinx_pcie_init(sys_mem, 1, - 0x12000000, 32 * M_BYTE, - 0x20000000, 512 * M_BYTE, + 0x12000000, 32 * MiB, + 0x20000000, 512 * MiB, get_cps_irq(s->cps, 1), false); pcie2 = xilinx_pcie_init(sys_mem, 2, - 0x14000000, 32 * M_BYTE, - 0x16000000, 1 * M_BYTE, + 0x14000000, 32 * MiB, + 0x16000000, 1 * MiB, get_cps_irq(s->cps, 0), true); platreg = g_new(MemoryRegion, 1); @@ -527,7 +527,7 @@ static void boston_mach_init(MachineState *machine) if (machine->firmware) { fw_size = load_image_targphys(machine->firmware, - 0x1fc00000, 4 * M_BYTE); + 0x1fc00000, 4 * MiB); if (fw_size == -1) { error_printf("unable to load firmware image '%s'\n", machine->firmware); @@ -553,7 +553,7 @@ static void boston_mach_class_init(MachineClass *mc) mc->desc = "MIPS Boston"; mc->init = boston_mach_init; mc->block_default_type = IF_IDE; - mc->default_ram_size = 1 * G_BYTE; + mc->default_ram_size = 1 * GiB; mc->max_cpus = 16; mc->default_cpu_type = MIPS_CPU_TYPE_NAME("I6400"); } diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 7401ffe5b0..5fdac62311 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -556,7 +556,7 @@ static void pnv_init(MachineState *machine) char *chip_typename; /* allocate RAM */ - if (machine->ram_size < (1 * G_BYTE)) { + if (machine->ram_size < (1 * GiB)) { warn_report("skiboot may not work with < 1GB of RAM"); } @@ -1174,7 +1174,7 @@ static void pnv_machine_class_init(ObjectClass *oc, void *data) * storage */ mc->no_parallel = 1; mc->default_boot_order = NULL; - mc->default_ram_size = 1 * G_BYTE; + mc->default_ram_size = 1 * GiB; xic->icp_get = pnv_icp_get; xic->ics_get = pnv_ics_get; xic->ics_resend = pnv_ics_resend; diff --git a/hw/ppc/ppc440_uc.c b/hw/ppc/ppc440_uc.c index 123f4ac09d..b5b31b4b9b 100644 --- a/hw/ppc/ppc440_uc.c +++ b/hw/ppc/ppc440_uc.c @@ -215,13 +215,13 @@ void ppc4xx_l2sram_init(CPUPPCState *env) l2sram = g_malloc0(sizeof(*l2sram)); /* XXX: Size is 4*64kB for 460ex, cf. U-Boot, ppc4xx-isram.h */ memory_region_init_ram(&l2sram->bank[0], NULL, "ppc4xx.l2sram_bank0", - 64 * K_BYTE, &error_abort); + 64 * KiB, &error_abort); memory_region_init_ram(&l2sram->bank[1], NULL, "ppc4xx.l2sram_bank1", - 64 * K_BYTE, &error_abort); + 64 * KiB, &error_abort); memory_region_init_ram(&l2sram->bank[2], NULL, "ppc4xx.l2sram_bank2", - 64 * K_BYTE, &error_abort); + 64 * KiB, &error_abort); memory_region_init_ram(&l2sram->bank[3], NULL, "ppc4xx.l2sram_bank3", - 64 * K_BYTE, &error_abort); + 64 * KiB, &error_abort); qemu_register_reset(&l2sram_reset, l2sram); ppc_dcr_register(env, DCR_L2CACHE_CFG, l2sram, &dcr_read_l2sram, &dcr_write_l2sram); @@ -513,28 +513,28 @@ static uint32_t sdram_bcr(hwaddr ram_base, hwaddr ram_size) uint32_t bcr; switch (ram_size) { - case (8 * M_BYTE): + case (8 * MiB): bcr = 0xffc0; break; - case (16 * M_BYTE): + case (16 * MiB): bcr = 0xff80; break; - case (32 * M_BYTE): + case (32 * MiB): bcr = 0xff00; break; - case (64 * M_BYTE): + case (64 * MiB): bcr = 0xfe00; break; - case (128 * M_BYTE): + case (128 * MiB): bcr = 0xfc00; break; - case (256 * M_BYTE): + case (256 * MiB): bcr = 0xf800; break; - case (512 * M_BYTE): + case (512 * MiB): bcr = 0xf000; break; - case (1 * G_BYTE): + case (1 * GiB): bcr = 0xe000; break; default: @@ -561,7 +561,7 @@ static target_ulong sdram_size(uint32_t bcr) if (sh == 0) { size = -1; } else { - size = 8 * M_BYTE * sh; + size = 8 * MiB * sh; } return size; diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index 5ed0bcd862..25ae53304c 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -884,7 +884,7 @@ static void ibm_40p_machine_init(MachineClass *mc) mc->desc = "IBM RS/6000 7020 (40p)", mc->init = ibm_40p_init; mc->max_cpus = 1; - mc->default_ram_size = 128 * M_BYTE; + mc->default_ram_size = 128 * MiB; mc->block_default_type = IF_SCSI; mc->default_boot_order = "c"; mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("604"); diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c index bdc53d2603..2a98c10664 100644 --- a/hw/ppc/sam460ex.c +++ b/hw/ppc/sam460ex.c @@ -597,7 +597,7 @@ static void sam460ex_machine_init(MachineClass *mc) mc->desc = "aCube Sam460ex"; mc->init = sam460ex_init; mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("460exb"); - mc->default_ram_size = 512 * M_BYTE; + mc->default_ram_size = 512 * MiB; } DEFINE_MACHINE("sam460ex", sam460ex_machine_init) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 0d032a1ad0..6a2d8fcef0 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -2324,7 +2324,7 @@ static void spapr_validate_node_memory(MachineState *machine, Error **errp) error_setg(errp, "Memory size 0x" RAM_ADDR_FMT " is not aligned to %llu MiB", machine->ram_size, - SPAPR_MEMORY_BLOCK_SIZE / M_BYTE); + SPAPR_MEMORY_BLOCK_SIZE / MiB); return; } @@ -2332,7 +2332,7 @@ static void spapr_validate_node_memory(MachineState *machine, Error **errp) error_setg(errp, "Maximum memory size 0x" RAM_ADDR_FMT " is not aligned to %llu MiB", machine->ram_size, - SPAPR_MEMORY_BLOCK_SIZE / M_BYTE); + SPAPR_MEMORY_BLOCK_SIZE / MiB); return; } @@ -2342,7 +2342,7 @@ static void spapr_validate_node_memory(MachineState *machine, Error **errp) "Node %d memory size 0x%" PRIx64 " is not aligned to %llu MiB", i, numa_info[i].node_mem, - SPAPR_MEMORY_BLOCK_SIZE / M_BYTE); + SPAPR_MEMORY_BLOCK_SIZE / MiB); return; } } @@ -3213,7 +3213,7 @@ static void spapr_memory_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev, if (size % SPAPR_MEMORY_BLOCK_SIZE) { error_setg(errp, "Hotplugged memory size must be a multiple of " - "%lld MB", SPAPR_MEMORY_BLOCK_SIZE / M_BYTE); + "%lld MB", SPAPR_MEMORY_BLOCK_SIZE / MiB); return; } @@ -3969,7 +3969,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data) mc->max_cpus = 1024; mc->no_parallel = 1; mc->default_boot_order = ""; - mc->default_ram_size = 512 * M_BYTE; + mc->default_ram_size = 512 * MiB; mc->kvm_type = spapr_kvm_type; machine_class_allow_dynamic_sysbus_dev(mc, TYPE_SPAPR_PCI_HOST_BRIDGE); mc->pci_allow_0_address = true; diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c index 7f9738daed..f32740b947 100644 --- a/hw/ppc/spapr_rtas.c +++ b/hw/ppc/spapr_rtas.c @@ -241,7 +241,7 @@ static void rtas_ibm_get_system_parameter(PowerPCCPU *cpu, "DesProcs=%d," "MaxPlatProcs=%d", max_cpus, - current_machine->ram_size / M_BYTE, + current_machine->ram_size / MiB, smp_cpus, max_cpus); ret = sysparm_st(buffer, length, param_val, strlen(param_val) + 1); diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 540bccb8d1..9a16b768ed 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -305,7 +305,7 @@ static void sd_ocr_powerup(void *opaque) /* card power-up OK */ sd->ocr = FIELD_DP32(sd->ocr, OCR, CARD_POWER_UP, 1); - if (sd->size > 1 * G_BYTE) { + if (sd->size > 1 * GiB) { sd->ocr = FIELD_DP32(sd->ocr, OCR, CARD_CAPACITY, 1); } } @@ -377,7 +377,7 @@ static void sd_set_csd(SDState *sd, uint64_t size) uint32_t sectsize = (1 << (SECTOR_SHIFT + 1)) - 1; uint32_t wpsize = (1 << (WPGROUP_SHIFT + 1)) - 1; - if (size <= 1 * G_BYTE) { /* Standard Capacity SD */ + if (size <= 1 * GiB) { /* Standard Capacity SD */ sd->csd[0] = 0x00; /* CSD structure */ sd->csd[1] = 0x26; /* Data read access-time-1 */ sd->csd[2] = 0x00; /* Data read access-time-2 */ diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index 3017e5a95a..a11e802485 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -414,7 +414,7 @@ static void sdhci_end_transfer(SDHCIState *s) /* * Programmed i/o data transfer */ -#define BLOCK_SIZE_MASK (4 * K_BYTE - 1) +#define BLOCK_SIZE_MASK (4 * KiB - 1) /* Fill host controller's read buffer with BLKSIZE bytes of data from card */ static void sdhci_read_block_from_card(SDHCIState *s) diff --git a/tests/test-cutils.c b/tests/test-cutils.c index 64a489c2e9..ee543ac4bf 100644 --- a/tests/test-cutils.c +++ b/tests/test-cutils.c @@ -2022,7 +2022,7 @@ static void test_qemu_strtosz_units(void) /* default is M */ err = qemu_strtosz_MiB(none, &endptr, &res); g_assert_cmpint(err, ==, 0); - g_assert_cmpint(res, ==, M_BYTE); + g_assert_cmpint(res, ==, MiB); g_assert(endptr == none + 1); err = qemu_strtosz(b, &endptr, &res); @@ -2032,32 +2032,32 @@ static void test_qemu_strtosz_units(void) err = qemu_strtosz(k, &endptr, &res); g_assert_cmpint(err, ==, 0); - g_assert_cmpint(res, ==, K_BYTE); + g_assert_cmpint(res, ==, KiB); g_assert(endptr == k + 2); err = qemu_strtosz(m, &endptr, &res); g_assert_cmpint(err, ==, 0); - g_assert_cmpint(res, ==, M_BYTE); + g_assert_cmpint(res, ==, MiB); g_assert(endptr == m + 2); err = qemu_strtosz(g, &endptr, &res); g_assert_cmpint(err, ==, 0); - g_assert_cmpint(res, ==, G_BYTE); + g_assert_cmpint(res, ==, GiB); g_assert(endptr == g + 2); err = qemu_strtosz(t, &endptr, &res); g_assert_cmpint(err, ==, 0); - g_assert_cmpint(res, ==, T_BYTE); + g_assert_cmpint(res, ==, TiB); g_assert(endptr == t + 2); err = qemu_strtosz(p, &endptr, &res); g_assert_cmpint(err, ==, 0); - g_assert_cmpint(res, ==, P_BYTE); + g_assert_cmpint(res, ==, PiB); g_assert(endptr == p + 2); err = qemu_strtosz(e, &endptr, &res); g_assert_cmpint(err, ==, 0); - g_assert_cmpint(res, ==, E_BYTE); + g_assert_cmpint(res, ==, EiB); g_assert(endptr == e + 2); } @@ -2070,7 +2070,7 @@ static void test_qemu_strtosz_float(void) err = qemu_strtosz(str, &endptr, &res); g_assert_cmpint(err, ==, 0); - g_assert_cmpint(res, ==, 12.345 * M_BYTE); + g_assert_cmpint(res, ==, 12.345 * MiB); g_assert(endptr == str + 7); } @@ -2106,7 +2106,7 @@ static void test_qemu_strtosz_trailing(void) str = "123xxx"; err = qemu_strtosz_MiB(str, &endptr, &res); - g_assert_cmpint(res, ==, 123 * M_BYTE); + g_assert_cmpint(res, ==, 123 * MiB); g_assert(endptr == str + 3); err = qemu_strtosz(str, NULL, &res); diff --git a/tests/test-keyval.c b/tests/test-keyval.c index 63cb14629b..92d8e9fa89 100644 --- a/tests/test-keyval.c +++ b/tests/test-keyval.c @@ -457,11 +457,11 @@ static void test_keyval_visit_size(void) visit_type_size(v, "sz2", &sz, &error_abort); g_assert_cmpuint(sz, ==, 1536); visit_type_size(v, "sz3", &sz, &error_abort); - g_assert_cmphex(sz, ==, 2 * M_BYTE); + g_assert_cmphex(sz, ==, 2 * MiB); visit_type_size(v, "sz4", &sz, &error_abort); - g_assert_cmphex(sz, ==, G_BYTE / 10); + g_assert_cmphex(sz, ==, GiB / 10); visit_type_size(v, "sz5", &sz, &error_abort); - g_assert_cmphex(sz, ==, 16777215 * T_BYTE); + g_assert_cmphex(sz, ==, 16777215 * TiB); visit_check_struct(v, &error_abort); visit_end_struct(v, NULL); visit_free(v); diff --git a/tests/test-qemu-opts.c b/tests/test-qemu-opts.c index 7092e216f7..7074a176d7 100644 --- a/tests/test-qemu-opts.c +++ b/tests/test-qemu-opts.c @@ -704,13 +704,12 @@ static void test_opts_parse_size(void) g_assert_cmpuint(opts_count(opts), ==, 3); g_assert_cmphex(qemu_opt_get_size(opts, "size1", 0), ==, 8); g_assert_cmphex(qemu_opt_get_size(opts, "size2", 0), ==, 1536); - g_assert_cmphex(qemu_opt_get_size(opts, "size3", 0), ==, 2 * M_BYTE); + g_assert_cmphex(qemu_opt_get_size(opts, "size3", 0), ==, 2 * MiB); opts = qemu_opts_parse(&opts_list_02, "size1=0.1G,size2=16777215T", false, &error_abort); g_assert_cmpuint(opts_count(opts), ==, 2); - g_assert_cmphex(qemu_opt_get_size(opts, "size1", 0), ==, G_BYTE / 10); - g_assert_cmphex(qemu_opt_get_size(opts, "size2", 0), - ==, 16777215 * T_BYTE); + g_assert_cmphex(qemu_opt_get_size(opts, "size1", 0), ==, GiB / 10); + g_assert_cmphex(qemu_opt_get_size(opts, "size2", 0), ==, 16777215 * TiB); /* Beyond limit with suffix */ opts = qemu_opts_parse(&opts_list_02, "size1=16777216T", From patchwork Mon Jun 25 12:41:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934254 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="XJ4353M4"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41Dptr3kyxz9rvt for ; Mon, 25 Jun 2018 22:50:44 +1000 (AEST) Received: from localhost ([::1]:46644 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQx8-0006QK-4h for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 08:50:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53680) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQq6-00019c-1V for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:43:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQq4-0007YS-Th for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:43:26 -0400 Received: from mail-qk0-x236.google.com ([2607:f8b0:400d:c09::236]:34001) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQq4-0007YG-Oj; Mon, 25 Jun 2018 08:43:24 -0400 Received: by mail-qk0-x236.google.com with SMTP id b66-v6so1876830qkj.1; Mon, 25 Jun 2018 05:43:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QnrE27O2IfbCIWuv5SqVyNFfiWt6gyI8Civ7/zlOuMs=; b=XJ4353M4c8z8aDtwkiy0blWqPtxri8Px7rn9J6gvdBBNw0nGNI2y0hb6Gi2MD7Tb82 XhwmzSQbV1LQDpcTzo53EqFLpRsky6Z3JH7h5yWoo+ExmDzE1sTjaBNiyu+6VskSl700 Pf5dGPm9StarDEJq279dqFsDRhYq6NsvQjdsUmtdGvGrK3MEV6C17QkgZEGBU8vvQU5t nhgnI1q868/Xmrn+EAmxvlu6ItSRGD2x0xKGUwUvvbNJ9CH7SWJgxQ0LtlSpqcG0AMUa oZcxOg5tAv0fzbGB+XlSpjcPvVQy2cHsh3uzCuNrHnSUMCu4M1kHV8ZWAExOtoQMiviX 0+kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=QnrE27O2IfbCIWuv5SqVyNFfiWt6gyI8Civ7/zlOuMs=; b=p75ir9YGnEfiw8LSpkY9ejCMhUJKPRikRdRBUUzmeQTWCvAWDqZOl7ecOJ39ozi0pL uXt9nepoEby3gABnhE9hTZNOUQC7mUg4+xU/UD5gxtVMdawIWIZYp7OaPYb/r4Tne1Wm KE72wCcw0vthIYAiHD3jwyQWeVgAtFRHhhUr7PcEC4744qgq+OFLdQZGgF8UTNAzluQD 6g3zFkTQOk28myGIaDwnECV4HutZ6gNFJl/mziQJ0Mmk9gmz8GmYFxMlUM/zvMlLqt2C 2HZmMyd3FRIn/O+/DV2A+yDGs2PMKw+80YSIKLBdWnPviNgvOwkm4gP9yG+JyfpgnbVC X1WQ== X-Gm-Message-State: APt69E3/hH7yR5uipXKK0ZuwdArFWHMH3wN29ayW4UZKKwIsx47nj4xA TnaMyhs6jRIlPQUPv9zgZ6s= X-Google-Smtp-Source: ADUXVKJtLHSPvyBjZe+vc2uvQOnGjrh6PPeBA/8oAAaq1Pqgr6R/gmvTpa8f4ast2tU9uvf0OGk35A== X-Received: by 2002:a37:1614:: with SMTP id g20-v6mr9970810qkh.64.1529930604213; Mon, 25 Jun 2018 05:43:24 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.43.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:43:23 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil Date: Mon, 25 Jun 2018 09:41:58 -0300 Message-Id: <20180625124238.25339-7-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::236 Subject: [Qemu-devel] [PATCH v5 06/46] hw: Directly use "qemu/units.h" instead of "qemu/cutils.h" 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 , qemu-devel@nongnu.org, Eduardo Habkost , qemu-trivial@nongnu.org, Alexander Graf , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Subbaraya Sundeep , Paul Burton , "open list:ARM" , "open list:PowerPC" , Yongbok Kim , Aurelien Jarno , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" These files don't use anything exposed by "qemu/cutils.h", simplify preprocessing including directly "qemu/units.h". Signed-off-by: Philippe Mathieu-Daudé Acked-by: David Gibson (ppc parts) Reviewed-by: Richard Henderson --- hw/arm/msf2-soc.c | 2 +- hw/arm/msf2-som.c | 2 +- hw/core/machine.c | 2 +- hw/display/sm501.c | 2 +- hw/mips/boston.c | 2 +- hw/ppc/pnv.c | 2 +- hw/ppc/ppc440_uc.c | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/arm/msf2-soc.c b/hw/arm/msf2-soc.c index 530e461c42..edb3ba824f 100644 --- a/hw/arm/msf2-soc.c +++ b/hw/arm/msf2-soc.c @@ -23,13 +23,13 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "qemu-common.h" #include "hw/arm/arm.h" #include "exec/address-spaces.h" #include "hw/char/serial.h" #include "hw/boards.h" -#include "qemu/cutils.h" #include "hw/arm/msf2-soc.h" #include "hw/misc/unimp.h" diff --git a/hw/arm/msf2-som.c b/hw/arm/msf2-som.c index ed533bbde1..2432b5e935 100644 --- a/hw/arm/msf2-som.c +++ b/hw/arm/msf2-som.c @@ -23,12 +23,12 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "qemu/error-report.h" #include "hw/boards.h" #include "hw/arm/arm.h" #include "exec/address-spaces.h" -#include "qemu/cutils.h" #include "hw/arm/msf2-soc.h" #include "cpu.h" diff --git a/hw/core/machine.c b/hw/core/machine.c index ccf3a4b9c7..2077328bcc 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -11,6 +11,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "hw/boards.h" #include "qapi/error.h" #include "qapi/qapi-visit-common.h" @@ -19,7 +20,6 @@ #include "sysemu/sysemu.h" #include "sysemu/numa.h" #include "qemu/error-report.h" -#include "qemu/cutils.h" #include "sysemu/qtest.h" static char *machine_get_accel(Object *obj, Error **errp) diff --git a/hw/display/sm501.c b/hw/display/sm501.c index 3bd871630e..9dec0d3218 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -24,7 +24,7 @@ */ #include "qemu/osdep.h" -#include "qemu/cutils.h" +#include "qemu/units.h" #include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" diff --git a/hw/mips/boston.c b/hw/mips/boston.c index 512c60c03e..b7bfeccf4c 100644 --- a/hw/mips/boston.c +++ b/hw/mips/boston.c @@ -18,6 +18,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qemu-common.h" #include "exec/address-spaces.h" @@ -32,7 +33,6 @@ #include "hw/mips/cpudevs.h" #include "hw/pci-host/xilinx-pcie.h" #include "qapi/error.h" -#include "qemu/cutils.h" #include "qemu/error-report.h" #include "qemu/log.h" #include "chardev/char.h" diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 5fdac62311..346f5e7aed 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -18,6 +18,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "sysemu/sysemu.h" #include "sysemu/numa.h" @@ -31,7 +32,6 @@ #include "hw/ppc/pnv_core.h" #include "hw/loader.h" #include "exec/address-spaces.h" -#include "qemu/cutils.h" #include "qapi/visitor.h" #include "monitor/monitor.h" #include "hw/intc/intc.h" diff --git a/hw/ppc/ppc440_uc.c b/hw/ppc/ppc440_uc.c index b5b31b4b9b..1ab2235f20 100644 --- a/hw/ppc/ppc440_uc.c +++ b/hw/ppc/ppc440_uc.c @@ -9,8 +9,8 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qemu-common.h" -#include "qemu/cutils.h" #include "qemu/error-report.h" #include "qapi/error.h" #include "cpu.h" From patchwork Mon Jun 25 12:41:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934257 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="aKbSPljv"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41DpyN4bLlz9s2L for ; Mon, 25 Jun 2018 22:53:48 +1000 (AEST) Received: from localhost ([::1]:46669 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXR06-0000f5-8D for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 08:53:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53703) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQq7-0001AA-Up for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:43:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQq7-0007ZB-5V for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:43:27 -0400 Received: from mail-qk0-x22b.google.com ([2607:f8b0:400d:c09::22b]:39732) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQq7-0007Z4-1R; Mon, 25 Jun 2018 08:43:27 -0400 Received: by mail-qk0-x22b.google.com with SMTP id g14-v6so7362177qkm.6; Mon, 25 Jun 2018 05:43:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VmXn4fH5z8BhfEDYfNwQajZx+eidFdphjSwi7Jl0LRw=; b=aKbSPljv+B8EcO7g88MzvPYyxNfUL5KffN55veL6BMtQh0mg6LZ0cWOhCqVvJ550Fm nu0NMIn6wADi5umVgM7G76salS2ALeN5XJOR6UE16Q675fz1wmiH37ZKU6PI1R5lsYO9 q3w2rND56KfUmSmHh3s5TkkurkoDjfJQMnlOL5n24edgBAOWJgsSLhyTbJTLdaUQ2emC St91JIQ6aCUR3UCD320U3pIldfe2OiNedivrjEC97APsiQ/C6NLd3uQsTStquqejGL+3 oPFa68cpTnBP/3kh+H2XqI7bISaRk6uMAL7KG5UEesXH4ErgM8HlZoKQITQXeULZvLWB YBZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=VmXn4fH5z8BhfEDYfNwQajZx+eidFdphjSwi7Jl0LRw=; b=juw36Dl8kgF+lS64Uo3RtMcyalexz/ZJbgFIOlu0x4h6KcYPHtJ96UClPt+gPMv5m3 ma6IIA4JVyrxpnlVoEKqlRUPjm+cQYCzKwjt4cSFS00d7RUfYphhWqLg5uCXbX+3Gy2m S3XVQOchUxqUgjeWJu9YruSZ913iECufi4woOYtFD17PNIQX+NCiRYiZcJswWEH7cqgO N0FIDfOtEhNpNSrrYBYTBVNJfY3jaF1B2P7SAR87+116JK4GRqgtAdEiL1fjF8xAtow3 2Q4KvMk+XQir7WL8W++8mnHKN899VGSpITRpachYgXruCQzXPKjE5mjWp5k7tf98C5zy 8peg== X-Gm-Message-State: APt69E3zJsJF5clmtbv1eZZ53wCJClfJCoZ8M3cuymEPQEBvHsuROOh/ vQOfoftwe+6ReKWZ0HARr5s= X-Google-Smtp-Source: AAOMgpdjETZt4AhWs3wgG7TGL5FVxkrIxE1Ye5qgW1Ad2Al9kdfehA66odFe5m0pXVGVC0np72wBRA== X-Received: by 2002:a37:85c5:: with SMTP id h188-v6mr10749997qkd.40.1529930606468; Mon, 25 Jun 2018 05:43:26 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.43.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:43:25 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil Date: Mon, 25 Jun 2018 09:41:59 -0300 Message-Id: <20180625124238.25339-8-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::22b Subject: [Qemu-devel] [PATCH v5 07/46] hw/ivshmem: Use the IEC binary prefix definitions 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: qemu-trivial@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It eases code review, unit is explicit. Patch generated using: $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/ and modified manually. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Marc-André Lureau --- hw/misc/ivshmem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index 16f03701b7..9a9f990867 100644 --- a/hw/misc/ivshmem.c +++ b/hw/misc/ivshmem.c @@ -17,6 +17,7 @@ * GNU GPL, version 2 or (at your option) any later version. */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "qemu/cutils.h" #include "hw/hw.h" @@ -1302,7 +1303,7 @@ static void ivshmem_realize(PCIDevice *dev, Error **errp) } if (s->sizearg == NULL) { - s->legacy_size = 4 << 20; /* 4 MB default */ + s->legacy_size = 4 * MiB; /* 4 MB default */ } else { int ret; uint64_t size; From patchwork Mon Jun 25 12:42:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934259 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Y8/mwzMQ"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41Dpyw0XhZz9ryk for ; Mon, 25 Jun 2018 22:54:15 +1000 (AEST) Received: from localhost ([::1]:46671 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXR0W-0000zW-Vb for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 08:54:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53759) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQqA-0001CH-U5 for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:43:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQq9-0007aT-Eo for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:43:30 -0400 Received: from mail-qk0-x231.google.com ([2607:f8b0:400d:c09::231]:43582) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQq9-0007a2-AF; Mon, 25 Jun 2018 08:43:29 -0400 Received: by mail-qk0-x231.google.com with SMTP id j124-v6so547075qka.10; Mon, 25 Jun 2018 05:43:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2UK0NoqUpmf9xn9GoIZ3L6Qow6qgWaindH9dlZIma3A=; b=Y8/mwzMQmbLDXl8ALjB4juAdLWWUVp3mRLg6H8Ao/e6Asv+QwrkXMxTZ4f6rZ4EUK8 EcEic3V5Do+RABdRr8M6jJIFYQE0yuHGHrltB88IaoCz6cAIsCynHBRPjKTJJB0xF8EO 3Tc3kdEPSLM1A1c+qgxN9tgnZfZLUvCHRaIrSFRbonm/44jyCxNEQgv7NEzFaaDxKca3 WCnuzfrWLsuC9GKWtF/LOevY9rujNfpmMVVqUgG0h01ZlnVb33F/D3fOQQ8R3kQcgbDz xHRUMQL+HAK1M8pES3aLnO9Av1fdGjuOK7qFGcPWvjp1dl0SWwcp0LAqYkGfOZPSwMST H8Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=2UK0NoqUpmf9xn9GoIZ3L6Qow6qgWaindH9dlZIma3A=; b=F8XRxHVWb6S9d+U/118JvfMzvZSdg4TOexs9HsUaAfJ19efdVVfW9LF2q8B4HdDyHQ vcBdntM6sXnT7U+FNOOaHxFdCfFJsGhY8wdutf0G+Uhdaf9Kj5wWh58iK91/Hnjn0XBL kTGn97KiajfakmOnulu5ZpJV5udAcgoIZHBflktjFrLBCYLYl48vVmca3GkPr+JcXXMp 6SSlq/+IQ2u3SHg6Bjm/TVbcyQmDulHGOuuABnDyDExA34SfKnJTlxFAqUYHJcTKvcCl bqtP1WMZOqZBk4DCitlEALbbXg/n/td+P4Lv7n/ezhJhAqdP2ReMdtixZIAGIlhsQdFJ rCNw== X-Gm-Message-State: APt69E1Z4MBET2ORxbU3qlHPlwhUHacDL7vqjDV4vuOtiDlRBgXatlc4 N5sMWstjoPZuuHEYLChCku8= X-Google-Smtp-Source: AAOMgpdJPPUsxDye4gpgfNKNFqLMm3E7p/JmFVHSBGnNegkl/0DXmofTMS5HFycTATaIyrBR0xZpEw== X-Received: by 2002:a37:6251:: with SMTP id w78-v6mr4854811qkb.364.1529930608758; Mon, 25 Jun 2018 05:43:28 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.43.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:43:28 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil Date: Mon, 25 Jun 2018 09:42:00 -0300 Message-Id: <20180625124238.25339-9-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::231 Subject: [Qemu-devel] [PATCH v5 08/46] hw/ipack: Use the IEC binary prefix definitions 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: qemu-trivial@nongnu.org, Alberto Garcia , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It eases code review, unit is explicit. Patch generated using: $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/ and modified manually. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alberto Garcia --- hw/ipack/tpci200.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/ipack/tpci200.c b/hw/ipack/tpci200.c index da05c8589d..cd3e79139d 100644 --- a/hw/ipack/tpci200.c +++ b/hw/ipack/tpci200.c @@ -9,6 +9,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "hw/ipack/ipack.h" #include "hw/pci/pci.h" #include "qemu/bitops.h" @@ -597,9 +598,9 @@ static void tpci200_realize(PCIDevice *pci_dev, Error **errp) memory_region_init_io(&s->las1, OBJECT(s), &tpci200_las1_ops, s, "tpci200_las1", 1024); memory_region_init_io(&s->las2, OBJECT(s), &tpci200_las2_ops, - s, "tpci200_las2", 1024*1024*32); + s, "tpci200_las2", 32 * MiB); memory_region_init_io(&s->las3, OBJECT(s), &tpci200_las3_ops, - s, "tpci200_las3", 1024*1024*16); + s, "tpci200_las3", 16 * MiB); pci_register_bar(&s->dev, 0, PCI_BASE_ADDRESS_SPACE_MEMORY, &s->mmio); pci_register_bar(&s->dev, 1, PCI_BASE_ADDRESS_SPACE_IO, &s->io); pci_register_bar(&s->dev, 2, PCI_BASE_ADDRESS_SPACE_MEMORY, &s->las0); From patchwork Mon Jun 25 12:42:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934263 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="D2c7/w4T"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41Dq260W0Rz9rvt for ; Mon, 25 Jun 2018 22:57:02 +1000 (AEST) Received: from localhost ([::1]:46689 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXR3D-0003YC-KQ for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 08:56:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53800) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQqD-0001FN-Ml for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:43:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQqC-0007br-4x for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:43:33 -0400 Received: from mail-qk0-x234.google.com ([2607:f8b0:400d:c09::234]:45214) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQqC-0007bf-0M; Mon, 25 Jun 2018 08:43:32 -0400 Received: by mail-qk0-x234.google.com with SMTP id c198-v6so7348297qkg.12; Mon, 25 Jun 2018 05:43:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iSBXdjYq7cTSR9GfO+r6S/xluTUDYmMxrohSbewgYr4=; b=D2c7/w4T0tL8s6Slml+zdJRKPzrJf4cJ6zjRLphsRQvoe8OHtjtkbSPxsinvtJOxpE 984DxxbgyOp4A8/4bJQiinXnOajAziSLKIsxFcP/Iph0wmYy4fcDCfUY21HKXyshIB/a fYy8Xk29JDBECsvtBv2GQz/YNK8MKfq/vtMuMuyqumKDCh0sFZhFbuBJkmn414qChFZt 7Ru+CFodR9BIGl+15Hp8q6f+BwdI5Q5ihRhyoTsgwXYwp34weLQEEa12GhJL+jvl4Fl6 mZEn5hSOZc4uwzlaoN+xQbvTEU7jbzRD3TSTMXB7bY0pZJlJ0iyDGzSwSsFIkud5NP1d 2U6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=iSBXdjYq7cTSR9GfO+r6S/xluTUDYmMxrohSbewgYr4=; b=nvE886T3alWE6POlZYvVkqMNsdkbh5rNsxAVwdkC/m6ypE+2vRbckhmrXDisCwOyTe lK/4fMa9VLLyjMyhlBvfbfleSa6PbeHBu3RWaLbUrFN3NWz/kXZ3+s5YVhG69zK8D2BE Mcr2yAdssRrrNNCmIX75yx8EMq+4O93t6quONX7TYP3qeGiNkEB5Bh47e2/IJqDKFW8i hZ+BppU8x/djJ/kUYOxQPNrIvSDQAJkhr0iX0wrqvuBdUsIPaFd3broCIXfNFv5un5nM xi2fQBN+MG5BuI1x062HAJZb0KLdBQqxsQzL+bkubWkbCXbErYLibAIkL782mur6X7jz qZhQ== X-Gm-Message-State: APt69E0TugR+393ButDsKVV+PxHPxWo6yS1sJkWnUSRmqFg2bNao7vQE tj3eDKwapzxx/cCEL3ddgC0= X-Google-Smtp-Source: ADUXVKJnGfVRI7mbsUqfhnb+C4n9zppaVLSlzIYWa/Xh2TCPKWqGbrOk/fDaszQOq1ERer7TzO1A0w== X-Received: by 2002:a37:849:: with SMTP id 70-v6mr10383402qki.200.1529930611485; Mon, 25 Jun 2018 05:43:31 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.43.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:43:31 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil Date: Mon, 25 Jun 2018 09:42:01 -0300 Message-Id: <20180625124238.25339-10-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::234 Subject: [Qemu-devel] [PATCH v5 09/46] hw/scsi: Use the IEC binary prefix definitions 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: qemu-trivial@nongnu.org, Paolo Bonzini , Fam Zheng , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It eases code review, unit is explicit. Patch generated using: $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/ and modified manually. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/scsi/scsi-disk.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index aeaf611854..311134482f 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -29,6 +29,7 @@ do { printf("scsi-disk: " fmt , ## __VA_ARGS__); } while (0) #endif #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "qemu/error-report.h" #include "hw/scsi/scsi.h" @@ -44,13 +45,13 @@ do { printf("scsi-disk: " fmt , ## __VA_ARGS__); } while (0) #include #endif -#define SCSI_WRITE_SAME_MAX 524288 -#define SCSI_DMA_BUF_SIZE 131072 +#define SCSI_WRITE_SAME_MAX (512 * KiB) +#define SCSI_DMA_BUF_SIZE (128 * KiB) #define SCSI_MAX_INQUIRY_LEN 256 #define SCSI_MAX_MODE_LEN 256 -#define DEFAULT_DISCARD_GRANULARITY 4096 -#define DEFAULT_MAX_UNMAP_SIZE (1 << 30) /* 1 GB */ +#define DEFAULT_DISCARD_GRANULARITY (4 * KiB) +#define DEFAULT_MAX_UNMAP_SIZE (1 * GiB) #define DEFAULT_MAX_IO_SIZE INT_MAX /* 2 GB - 1 block */ #define TYPE_SCSI_DISK_BASE "scsi-disk-base" From patchwork Mon Jun 25 12:42:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934265 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="g7Moo/gc"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41Dq2Z4bdBz9ryk for ; Mon, 25 Jun 2018 22:57:26 +1000 (AEST) Received: from localhost ([::1]:46693 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXR3c-0003rh-9l for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 08:57:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53883) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQqI-0001IL-QS for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:43:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQqE-0007cu-Ml for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:43:38 -0400 Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]:39695) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQqE-0007cm-Ic; Mon, 25 Jun 2018 08:43:34 -0400 Received: by mail-qt0-x243.google.com with SMTP id c23-v6so2825649qtn.6; Mon, 25 Jun 2018 05:43:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ks9APs4FnU7N4alkvQahhOOn31iXi+wj6DszMhAYvWg=; b=g7Moo/gcZII4UjwTdMNijLGMlp58osHCXMLjCdhlts+WpXeCJPQnepGBa2e/qG2lA1 QkNi3DjpMzmSDwMaRu3jf3YJncbL4/pr+jfpgbxsUksgoZDWXmA9v+sk2fnN5Lgbsc3Q OlUkpSjABEU4l3dwOKcGGGroR2siOaKNs+E0q1uGeQNtYyXUhIRJKi3e+Vn3aQ7rmDW2 oUxanKaOCzMdqPTP3iqkdVHqs8+QVEEmyrSo0CeSwv/knE9Mruo9uaKDhFLXcwik8IO4 FO3Uz5Mfo5IvEu+YQFgq//2jNQSr/zqyLPW66v5t9xgpwewVs3ASxzt+vRRYjU3jGVp9 bNGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ks9APs4FnU7N4alkvQahhOOn31iXi+wj6DszMhAYvWg=; b=K0H2iLFUSb6pO8h+khCDNk3rWjoTLXRbKyKnk27boh7wfEZNFbQ8u0+/3Rjc8n+ELA JDt2+SbEabjatoDlexxa21v8ZTHo2baxFs/yJiI1YNzq4oWO5a4b7jKWY49V/iBId4P6 73/2nfHprNCRr9avPLOulul/3sSKRZdlAIzR74zDVFOp4Kqq4XeY4EsF43R7/KzGGCLP Zw7AqD+MoZGg0xfYjgFRohF10emjQ7ibFl5HvPUYbuUBXpD13IX2GHVfQpz8QoMIFleK CHem6r5Do43d/5nhmVzHQdMjBH9/N1kzxvYiDAC8GtuMUqVTDjDTrNOrwfFQebPnwJWG W4uw== X-Gm-Message-State: APt69E06bi9a1nShSdGBjxHqJCvFhIOJJQK9rm2FIVnO2VYv//hYkqnA F4cLYWgIE7DTpVOCuDKQAvvR1Z4Sf+0= X-Google-Smtp-Source: AAOMgpewGeDMj11U0if5JuJoO+P2hqrtZB5VeGzRjJdjmeujXPU1fWFwPOzHVivsufWRbYRg0oOr9g== X-Received: by 2002:aed:3cae:: with SMTP id d43-v6mr4827943qtf.379.1529930614062; Mon, 25 Jun 2018 05:43:34 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.43.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:43:33 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil Date: Mon, 25 Jun 2018 09:42:02 -0300 Message-Id: <20180625124238.25339-11-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::243 Subject: [Qemu-devel] [PATCH v5 10/46] hw/smbios: Use the IEC binary prefix definitions 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: qemu-trivial@nongnu.org, Igor Mammedov , "Michael S. Tsirkin" , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It eases code review, unit is explicit. Patch generated using: $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/ and modified manually. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Igor Mammedov --- hw/smbios/smbios.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c index 27a07e96f4..a27e54b2fa 100644 --- a/hw/smbios/smbios.c +++ b/hw/smbios/smbios.c @@ -16,6 +16,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "qemu/config-file.h" #include "qemu/error-report.h" @@ -625,10 +626,6 @@ static void smbios_build_type_11_table(void) SMBIOS_BUILD_TABLE_POST; } -#define ONE_KB ((ram_addr_t)1 << 10) -#define ONE_MB ((ram_addr_t)1 << 20) -#define ONE_GB ((ram_addr_t)1 << 30) - #define MAX_T16_STD_SZ 0x80000000 /* 2T in Kilobytes */ static void smbios_build_type_16_table(unsigned dimm_cnt) @@ -640,7 +637,7 @@ static void smbios_build_type_16_table(unsigned dimm_cnt) t->location = 0x01; /* Other */ t->use = 0x03; /* System memory */ t->error_correction = 0x06; /* Multi-bit ECC (for Microsoft, per SeaBIOS) */ - size_kb = QEMU_ALIGN_UP(ram_size, ONE_KB) / ONE_KB; + size_kb = QEMU_ALIGN_UP(ram_size, KiB) / KiB; if (size_kb < MAX_T16_STD_SZ) { t->maximum_capacity = cpu_to_le32(size_kb); t->extended_maximum_capacity = cpu_to_le64(0); @@ -668,7 +665,7 @@ static void smbios_build_type_17_table(unsigned instance, uint64_t size) t->memory_error_information_handle = cpu_to_le16(0xFFFE); /* Not provided */ t->total_width = cpu_to_le16(0xFFFF); /* Unknown */ t->data_width = cpu_to_le16(0xFFFF); /* Unknown */ - size_mb = QEMU_ALIGN_UP(size, ONE_MB) / ONE_MB; + size_mb = QEMU_ALIGN_UP(size, MiB) / MiB; if (size_mb < MAX_T17_STD_SZ) { t->size = cpu_to_le16(size_mb); t->extended_size = cpu_to_le32(0); @@ -707,8 +704,8 @@ static void smbios_build_type_19_table(unsigned instance, end = start + size - 1; assert(end > start); - start_kb = start / ONE_KB; - end_kb = end / ONE_KB; + start_kb = start / KiB; + end_kb = end / KiB; if (start_kb < UINT32_MAX && end_kb < UINT32_MAX) { t->starting_address = cpu_to_le32(start_kb); t->ending_address = cpu_to_le32(end_kb); @@ -869,7 +866,7 @@ void smbios_get_tables(const struct smbios_phys_mem_area *mem_array, smbios_build_type_11_table(); -#define MAX_DIMM_SZ (16ll * ONE_GB) +#define MAX_DIMM_SZ (16 * GiB) #define GET_DIMM_SZ ((i < dimm_cnt - 1) ? MAX_DIMM_SZ \ : ((ram_size - 1) % MAX_DIMM_SZ) + 1) From patchwork Mon Jun 25 12:42:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934247 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="d6oc+CaW"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41Dppv1JKWz9rvt for ; Mon, 25 Jun 2018 22:47:19 +1000 (AEST) Received: from localhost ([::1]:46624 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQto-0003nu-R3 for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 08:47:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53927) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQqM-0001K6-8N for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:43:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQqJ-0007en-67 for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:43:42 -0400 Received: from mail-qk0-x244.google.com ([2607:f8b0:400d:c09::244]:35367) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQqJ-0007eb-25; Mon, 25 Jun 2018 08:43:39 -0400 Received: by mail-qk0-x244.google.com with SMTP id u21-v6so1772449qku.2; Mon, 25 Jun 2018 05:43:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Zh1e1cXNw3DKZtCDbdrfbkiCXZMg8qqGWos+WoeWfTo=; b=d6oc+CaW+PISqGSmMTdr9xF3OEPGtPlARTil1vu3sIM+TlTJMxhtXVxsHQbFbb5Kx4 zl6qmbBIQBTu5cD9acetJ/EMy92NJVbQo9cRltGxrTRJ0kz5sN0UjiPlOSmNW+ML6uWV LPRMf4zg84LRGsOTgrcVs57WP9IfAZ8BaYiAbKfJRZYHVn3PJwWxnFhWQ2xyogOWjKm9 lVRTrwKL7Ws3FAUJZUouh3xMYS/kpMbFFI7DRkFLx1VKF9xrsiOop8RnvUd4kL5pUlln 8HKniTosWZkZ2DRW6om+eyX4nMEjwEmjpgJoj3B++BlpMeyNopk/gHaufc0w0vu/5IrM Bc3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Zh1e1cXNw3DKZtCDbdrfbkiCXZMg8qqGWos+WoeWfTo=; b=dkvGjaZIJgTpgwo4DzJEHaRBptqZspDm8uqsYFcL+WHQs2E5s5xOgm8IrP7qASSLeF 5BynITLAKVc7wTadAw0qPloCb7aUnpcqW+4ROtze+CM6SDT24lWwpdB45kL+fmpIzlAF dlBkPPlD82tIAcgFgCwt/Sp6AJx04WUHXbQqbyOgBxhGxK8xh3XmmmuxPFooCgO0zPPE nD6G0lPzPo3Y3jnmVm3UmZc+8Ih8JD+BGg0o21MqiJtkkBB7bb7QnyeowpY62Ifhg5Yq zpGZ3A6KixX7vM2QR75XjW2RvpJ6P1miy1QKRegE1JL7FIRp+6RsK4wAh9S6V5NuukD0 D/8A== X-Gm-Message-State: APt69E2LtDDkXm3GupgwoEXawPSM6QTKKTg7joZfRVfYZ3HCUUcvGfY6 Tb/lCilM2A2hlQvpS5GdZq9AZ/dRnmo= X-Google-Smtp-Source: ADUXVKKuUEc6bAea6WerfkU7xGNLUpDg7KygIoJez6lbcHMQPOH2qJ7XZSukk+XRHaT1V9ojTjp70w== X-Received: by 2002:ae9:e113:: with SMTP id g19-v6mr10681764qkm.9.1529930618498; Mon, 25 Jun 2018 05:43:38 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.43.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:43:38 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil Date: Mon, 25 Jun 2018 09:42:03 -0300 Message-Id: <20180625124238.25339-12-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::244 Subject: [Qemu-devel] [PATCH v5 11/46] hw/xen: Use the IEC binary prefix definitions 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: Kevin Wolf , Stefano Stabellini , Eduardo Habkost , "open list:Block layer core" , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, "open list:X86" , Anthony Perard , Paolo Bonzini , Max Reitz , Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It eases code review, unit is explicit. Patch generated using: $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/ and modified manually. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alan Robinson --- hw/block/xen_disk.c | 3 ++- hw/i386/xen/xen-mapcache.c | 3 ++- hw/xenpv/xen_domainbuild.c | 13 +++++++------ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c index 9fbc0cdb87..36eff94f84 100644 --- a/hw/block/xen_disk.c +++ b/hw/block/xen_disk.c @@ -20,6 +20,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include #include @@ -814,7 +815,7 @@ static int blk_connect(struct XenDevice *xendev) xen_pv_printf(xendev, 1, "type \"%s\", fileproto \"%s\", filename \"%s\"," " size %" PRId64 " (%" PRId64 " MB)\n", blkdev->type, blkdev->fileproto, blkdev->filename, - blkdev->file_size, blkdev->file_size >> 20); + blkdev->file_size, blkdev->file_size / MiB); /* Fill in number of sector size and number of sectors */ xenstore_write_be_int(xendev, "sector-size", blkdev->file_blk); diff --git a/hw/i386/xen/xen-mapcache.c b/hw/i386/xen/xen-mapcache.c index 628b813a11..4e4f069a24 100644 --- a/hw/i386/xen/xen-mapcache.c +++ b/hw/i386/xen/xen-mapcache.c @@ -9,6 +9,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qemu/error-report.h" #include @@ -46,7 +47,7 @@ * From empirical tests I observed that qemu use 75MB more than the * max_mcache_size. */ -#define NON_MCACHE_MEMORY_SIZE (80 * 1024 * 1024) +#define NON_MCACHE_MEMORY_SIZE (80 * MiB) typedef struct MapCacheEntry { hwaddr paddr_index; diff --git a/hw/xenpv/xen_domainbuild.c b/hw/xenpv/xen_domainbuild.c index 027f76fad1..188acaca16 100644 --- a/hw/xenpv/xen_domainbuild.c +++ b/hw/xenpv/xen_domainbuild.c @@ -1,4 +1,5 @@ #include "qemu/osdep.h" +#include "qemu/units.h" #include "hw/xen/xen_backend.h" #include "xen_domainbuild.h" #include "qemu/timer.h" @@ -75,9 +76,9 @@ int xenstore_domain_init1(const char *kernel, const char *ramdisk, xenstore_write_str(dom, "vm", vm); /* memory */ - xenstore_write_int(dom, "memory/target", ram_size >> 10); // kB - xenstore_write_int(vm, "memory", ram_size >> 20); // MB - xenstore_write_int(vm, "maxmem", ram_size >> 20); // MB + xenstore_write_int(dom, "memory/target", ram_size / KiB); + xenstore_write_int(vm, "memory", ram_size / MiB); + xenstore_write_int(vm, "maxmem", ram_size / MiB); /* cpus */ for (i = 0; i < smp_cpus; i++) { @@ -113,7 +114,7 @@ int xenstore_domain_init2(int xenstore_port, int xenstore_mfn, /* console */ xenstore_write_str(dom, "console/type", "ioemu"); - xenstore_write_int(dom, "console/limit", 128 * 1024); + xenstore_write_int(dom, "console/limit", 128 * KiB); xenstore_write_int(dom, "console/ring-ref", console_mfn); xenstore_write_int(dom, "console/port", console_port); xen_config_dev_console(0); @@ -260,7 +261,7 @@ int xen_domain_build_pv(const char *kernel, const char *ramdisk, } #endif - rc = xc_domain_setmaxmem(xen_xc, xen_domid, ram_size >> 10); + rc = xc_domain_setmaxmem(xen_xc, xen_domid, ram_size / KiB); if (rc < 0) { fprintf(stderr, "xen: xc_domain_setmaxmem() failed\n"); goto err; @@ -269,7 +270,7 @@ int xen_domain_build_pv(const char *kernel, const char *ramdisk, xenstore_port = xc_evtchn_alloc_unbound(xen_xc, xen_domid, 0); console_port = xc_evtchn_alloc_unbound(xen_xc, xen_domid, 0); - rc = xc_linux_build(xen_xc, xen_domid, ram_size >> 20, + rc = xc_linux_build(xen_xc, xen_domid, ram_size / MiB, kernel, ramdisk, cmdline, 0, flags, xenstore_port, &xenstore_mfn, From patchwork Mon Jun 25 12:42:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934273 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="XlsPLnSA"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41Dq662V8bz9rvt for ; Mon, 25 Jun 2018 23:00:29 +1000 (AEST) Received: from localhost ([::1]:46713 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXR6X-0006jH-Er for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 09:00:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53945) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQqN-0001K8-4k for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:43:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQqM-0007hC-7P for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:43:43 -0400 Received: from mail-qk0-x231.google.com ([2607:f8b0:400d:c09::231]:33603) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQqM-0007h5-23; Mon, 25 Jun 2018 08:43:42 -0400 Received: by mail-qk0-x231.google.com with SMTP id c131-v6so7370120qkb.0; Mon, 25 Jun 2018 05:43:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+dMOwVwWsV1ekYTem4+xUaMUvfilyxHnQ6xvBi0DQCo=; b=XlsPLnSA3XAdSqlGqamU3eAH1GX/pDsfpHxk9jEAZfFiwaLtsePgvTjYx5aJAEbeqF cuRSoNkQ0Ortv5/VK7izgzr01IxkQ5PIl9fo5MzV2mN8sC1czS5adlGj3YUtKH6P1rFG CI5ykXnP38QnIs9zjeX+j4zXw2GHsVLPOvSRqgqUcO2z1gqTA36Lg4Q+/Wu2Iz2p9B4z 75XPJq5ZFvPnYNtGSv0D5v1vPUsjON0dDRyLkn46cFFqstzdw72S+sokVEOrlpcOQjWX kNOVFQV5e0IgUSO0p6bSTzgkbwVUGCuoSI8jFMeb4+SvdrbWKSm5IcojhWZNOMVobjCE EmyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=+dMOwVwWsV1ekYTem4+xUaMUvfilyxHnQ6xvBi0DQCo=; b=KJU7z8dSzp9t0ipvIMU1o9zfmtU3dThb5wf/+7E86gvgsZox5wxTG2By9u/MRfAiG2 2K3rQRo3lbyqarxHV438mlD7+XCLTrAIhxA12/U2UBFP4WyN5fluLradVjJPd6Plu86U yE1Kky/OoWtfME1goGPPqc1DD/DOAZMF3InV00OqC8P5MHcDbXTDwoiJVYSzWZpX0EXI cWzG9hNIKEyS43I+Tmk9Qtd9/h64g4opaWsyeIQ+IlhPwzH8zj2mQk3ZQAPxUt1Gm+xk pYKxGl5TjK+LuTqj2osvKEdplFd/jNRlUVuj8IJ+e9hV6maCP9Psa/T1D+BqHd4xaXJP L2eA== X-Gm-Message-State: APt69E2AsR02jSzjrYIvQeywjKISbPlZeEiUB7ipdDFtGwnT+aCuNI+F h/O0Q53SvuIT94ISoVVST/YF8Q4bWXc= X-Google-Smtp-Source: ADUXVKJuumF1Hko4OoH2wQURQqwvWDR+9no8YQgpUAhwjlQz7LmfKZQvuwOfWGMkynqoI44If91/GA== X-Received: by 2002:a37:9704:: with SMTP id z4-v6mr10710222qkd.272.1529930621559; Mon, 25 Jun 2018 05:43:41 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.43.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:43:40 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil Date: Mon, 25 Jun 2018 09:42:04 -0300 Message-Id: <20180625124238.25339-13-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::231 Subject: [Qemu-devel] [PATCH v5 12/46] hw/tpm: Use the IEC binary prefix definitions 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: "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Stefan Berger , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , qemu-devel@nongnu.org, Igor Mammedov Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It eases code review, unit is explicit. Patch generated using: $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/ and modified manually. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Marc-André Lureau Reviewed-by: Igor Mammedov --- include/hw/acpi/tpm.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/hw/acpi/tpm.h b/include/hw/acpi/tpm.h index 46ac4dc581..3580ffd50c 100644 --- a/include/hw/acpi/tpm.h +++ b/include/hw/acpi/tpm.h @@ -16,6 +16,7 @@ #ifndef HW_ACPI_TPM_H #define HW_ACPI_TPM_H +#include "qemu/units.h" #include "hw/registerfields.h" #define TPM_TIS_ADDR_BASE 0xFED40000 @@ -176,7 +177,7 @@ REG32(CRB_DATA_BUFFER, 0x80) #define TPM_CRB_ADDR_CTRL (TPM_CRB_ADDR_BASE + A_CRB_CTRL_REQ) #define TPM_CRB_R_MAX R_CRB_DATA_BUFFER -#define TPM_LOG_AREA_MINIMUM_SIZE (64 * 1024) +#define TPM_LOG_AREA_MINIMUM_SIZE (64 * KiB) #define TPM_TCPA_ACPI_CLASS_CLIENT 0 #define TPM_TCPA_ACPI_CLASS_SERVER 1 From patchwork Mon Jun 25 12:42:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934252 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="TJ4pRNpF"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41Dptg3pBsz9rvt for ; Mon, 25 Jun 2018 22:50:35 +1000 (AEST) Received: from localhost ([::1]:46642 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQwy-0006F5-Sa for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 08:50:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54014) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQqR-0001Ni-0h for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:43:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQqQ-0007jH-07 for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:43:47 -0400 Received: from mail-qt0-x229.google.com ([2607:f8b0:400d:c0d::229]:40045) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQqP-0007j1-Rz; Mon, 25 Jun 2018 08:43:45 -0400 Received: by mail-qt0-x229.google.com with SMTP id x23-v6so1558433qto.7; Mon, 25 Jun 2018 05:43:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Kisz6XCZvm5VQaoGpFfligXR8g2TGkGe0t/8nXzQvRk=; b=TJ4pRNpF/VqZ6Chr95qq9GbN9Zk0MbvbA2/Krw3xrvncgfRn8ew35e5zj9DkL/nHc8 30DEFoAyofznw7NBYTpyhKoK+N5LuQIe4TPq0ZNWWMmJIR51NOQRe6GaZlRhmuvgugFr Y4DAdEFSsFgNMI2arw7vbQR3mmUpwxYARiTHY/HDhqyF8siA1k2OCv5C5PDj/y6GHNr8 DmPR1ERnoPeHp6KOUFCaORHBb2/A7N8myTSxsnrk2OSTGKj7fv9cJ9NGBkkKbtBAKFOE XqwqCz/ks2MzN0EdipKySXpbknTPYs5bAsAm6ahxXh6utAcUFJTws/GzKyaXjOBVNt58 /Scw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Kisz6XCZvm5VQaoGpFfligXR8g2TGkGe0t/8nXzQvRk=; b=toIsvLkWWf1yI3oQ3Q9JfGdvGmodlLA+qoQX0tp8AGWrYFVqNTzSi+iawSOFbDzX5Y tEn/TdlAmy9wJwS7iIs67HTM2KN2wWJ/V23d7nuRXBh16YXzzHoIE6rxbfJJHqaHrLmK rdVWZG4OLvf9GjoXdsOb+DsqUjRD9oW3uQG8GNJqCW09VqTmo13rFT1hHHhW58pxK/1j rS0dpCfKSrelCMkUAp9ihNAVm5exBRsBi7Xr/zsSAaER6iOC5aZ8edMTqQ9jBVaVcfag 8pczuYIAfr1coA1bxTDzN1HlDSn1P+cMfsKqjruf+HpGCIdSBY4lfknyhtBSigCTkawO RAbg== X-Gm-Message-State: APt69E0s1wLakv/AvhfiSafgG/DApLWR83+JjD+dDFI4GEzXWkdxXdzy hIbOZx6iH7MklRwbw3p0H8s= X-Google-Smtp-Source: ADUXVKIkIISM/YOPDogt7fthe3j34OcXJ9nTvvZdCxHRiFZJ1TTBIjIMS13M6EtsXqL5HPE1EWai+Q== X-Received: by 2002:aed:3f36:: with SMTP id p51-v6mr10523944qtf.213.1529930625271; Mon, 25 Jun 2018 05:43:45 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.43.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:43:44 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil Date: Mon, 25 Jun 2018 09:42:05 -0300 Message-Id: <20180625124238.25339-14-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::229 Subject: [Qemu-devel] [PATCH v5 13/46] hw/block: Use the IEC binary prefix definitions 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: Kevin Wolf , "open list:Block layer core" , Peter Crosthwaite , qemu-trivial@nongnu.org, Alistair Francis , =?utf-8?q?Philippe_Mathieu?= =?utf-8?q?-Daud=C3=A9?= , qemu-devel@nongnu.org, Keith Busch , Max Reitz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It eases code review, unit is explicit. Patch generated using: $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/ and modified manually. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/block/m25p80.c | 5 +++-- hw/block/nvme.c | 3 ++- hw/block/tc58128.c | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c index b0ed8fa418..e8dfa14b33 100644 --- a/hw/block/m25p80.c +++ b/hw/block/m25p80.c @@ -22,6 +22,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "hw/hw.h" #include "sysemu/block-backend.h" #include "hw/ssi/ssi.h" @@ -541,12 +542,12 @@ static void flash_erase(Flash *s, int offset, FlashCMD cmd) switch (cmd) { case ERASE_4K: case ERASE4_4K: - len = 4 << 10; + len = 4 * KiB; capa_to_assert = ER_4K; break; case ERASE_32K: case ERASE4_32K: - len = 32 << 10; + len = 32 * KiB; capa_to_assert = ER_32K; break; case ERASE_SECTOR: diff --git a/hw/block/nvme.c b/hw/block/nvme.c index d5bf95b79b..65c84e7de3 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -25,6 +25,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "hw/block/block.h" #include "hw/hw.h" #include "hw/pci/msix.h" @@ -648,7 +649,7 @@ static uint16_t nvme_identify_ns(NvmeCtrl *n, NvmeIdentify *c) static uint16_t nvme_identify_nslist(NvmeCtrl *n, NvmeIdentify *c) { - static const int data_len = 4096; + static const int data_len = 4 * KiB; uint32_t min_nsid = le32_to_cpu(c->nsid); uint64_t prp1 = le64_to_cpu(c->prp1); uint64_t prp2 = le64_to_cpu(c->prp2); diff --git a/hw/block/tc58128.c b/hw/block/tc58128.c index 1d9f7ee000..808ad76ba6 100644 --- a/hw/block/tc58128.c +++ b/hw/block/tc58128.c @@ -1,4 +1,5 @@ #include "qemu/osdep.h" +#include "qemu/units.h" #include "hw/hw.h" #include "hw/sh4/sh.h" #include "hw/loader.h" @@ -26,7 +27,7 @@ typedef struct { static tc58128_dev tc58128_devs[2]; -#define FLASH_SIZE (16*1024*1024) +#define FLASH_SIZE (16 * MiB) static void init_dev(tc58128_dev * dev, const char *filename) { From patchwork Mon Jun 25 12:42:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934249 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="kCWE7YfV"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41Dpqt0SrFz9rvt for ; Mon, 25 Jun 2018 22:48:10 +1000 (AEST) Received: from localhost ([::1]:46632 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQud-0004KO-KD for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 08:48:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54114) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQqX-0001VQ-UO for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:43:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQqU-0007lH-8y for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:43:53 -0400 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]:46061) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQqU-0007l3-48; Mon, 25 Jun 2018 08:43:50 -0400 Received: by mail-qt0-x241.google.com with SMTP id i18-v6so11720200qtp.12; Mon, 25 Jun 2018 05:43:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xfjZ3x+bJEw9boY4UIUJAoMrsb8RqVEjFmy9G1F2y38=; b=kCWE7YfVlcJLh72qKCzbj+Gjk5erwAgYDji+DhsY1R6JyCSamYnJ4NiIUfaZiGAzzW nzUYhHmS8c4jeLko/AD+yhzYRKCBGm3TSdUO37ls7Kbkhz7sxdMubGNWbW3ceJsHIhtv DJxyCSauxlVFj56hfcOBrpWXiC8NHVuSHCY6aaFuRE348AJCQtKfq+fhhwoG7wWArHUI C/G+zlDTdFZBA6UDjsKS8k8+c0z0qk450ajQBblx2EeHlaf/dDR66wbw5CYws6GuOKvh 7dXxrluKwsKnBVje+fuPmc5tTpi/f4KAJwKG/5777mkUHw5J6TahhcPDU3Y/A2hpetwS aMzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=xfjZ3x+bJEw9boY4UIUJAoMrsb8RqVEjFmy9G1F2y38=; b=Dagvk7+g3jz1T3rkuJAQATBi3wClUPF5YxinKQYrsl/LvFKdNhI1X01eprPSykyqSF JWCyFKGqDoJ356hr0HQ7I/KyrljryuHSZEN6qWPSScI2NJjKeXCBUqHKNs4WEHZPYVH8 DGGrQ7MVbXOWUYUut5gweduTUvd/Hw+cgfEhLIxNshUu3cenaUHO2vyHzBCZ6Gh8z/RW hUDeQyBqKAoSx7bsWGomPA8MEfQfFJkFjwLXaWfxdrzybpBVbHKPl3xyiRg15rq+Q6d7 GrDkEdY0g0DqeV3RMAh1Tp/iapgOr06WbjQeYtT/EuzO7MTS8DBnAe5p1dMojDXAnxGd n3Cg== X-Gm-Message-State: APt69E3jus9EkJ4RsCuaChocy3CSKz8tBFTxnMNT/wPaqaukVx2R/ogJ pTpxIT/0WiIQP2wcDAEamaY= X-Google-Smtp-Source: AAOMgpee+4nkHwPuutbjmX5D+Jpc8SQ4wdaYYRzuFuy56a9BxDau62v58lH5MAw6LiYFdz+/wpRl8A== X-Received: by 2002:a0c:f806:: with SMTP id r6-v6mr10874791qvn.214.1529930629437; Mon, 25 Jun 2018 05:43:49 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.43.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:43:48 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil Date: Mon, 25 Jun 2018 09:42:06 -0300 Message-Id: <20180625124238.25339-15-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::241 Subject: [Qemu-devel] [PATCH v5 14/46] hw/display: Use the IEC binary prefix definitions 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: Stefano Stabellini , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Alistair Francis , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, "open list:Xilinx ZynqMP" , Gerd Hoffmann , "open list:X86" , Anthony Perard , "Edgar E. Iglesias" Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It eases code review, unit is explicit. Patch generated using: $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/ and modified manually. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gerd Hoffmann Reviewed-by: Alistair Francis --- include/hw/display/xlnx_dp.h | 5 +++-- hw/display/bochs-display.c | 9 +++++---- hw/display/cirrus_vga.c | 10 +++++----- hw/display/g364fb.c | 4 ++-- hw/display/qxl.c | 30 ++++++++++++++---------------- hw/display/vga-isa-mm.c | 5 +++-- hw/display/vga.c | 5 +++-- hw/display/virtio-gpu.c | 4 ++-- hw/display/vmware_vga.c | 3 ++- hw/display/xenfb.c | 3 ++- 10 files changed, 41 insertions(+), 37 deletions(-) diff --git a/include/hw/display/xlnx_dp.h b/include/hw/display/xlnx_dp.h index ee046a5fac..26b759cd44 100644 --- a/include/hw/display/xlnx_dp.h +++ b/include/hw/display/xlnx_dp.h @@ -29,14 +29,15 @@ #include "hw/display/dpcd.h" #include "hw/i2c/i2c-ddc.h" #include "qemu/fifo8.h" +#include "qemu/units.h" #include "hw/dma/xlnx_dpdma.h" #include "audio/audio.h" #ifndef XLNX_DP_H #define XLNX_DP_H -#define AUD_CHBUF_MAX_DEPTH 32768 -#define MAX_QEMU_BUFFER_SIZE 4096 +#define AUD_CHBUF_MAX_DEPTH (32 * KiB) +#define MAX_QEMU_BUFFER_SIZE (4 * KiB) #define DP_CORE_REG_ARRAY_SIZE (0x3AF >> 2) #define DP_AVBUF_REG_ARRAY_SIZE (0x238 >> 2) diff --git a/hw/display/bochs-display.c b/hw/display/bochs-display.c index 1187d77576..5e0c1f1914 100644 --- a/hw/display/bochs-display.c +++ b/hw/display/bochs-display.c @@ -5,6 +5,7 @@ * See the COPYING file in the top-level directory. */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "hw/hw.h" #include "hw/pci/pci.h" #include "hw/display/bochs-vbe.h" @@ -70,7 +71,7 @@ static uint64_t bochs_display_vbe_read(void *ptr, hwaddr addr, case VBE_DISPI_INDEX_ID: return VBE_DISPI_ID5; case VBE_DISPI_INDEX_VIDEO_MEMORY_64K: - return s->vgamem / (64 * 1024); + return s->vgamem / (64 * KiB); } if (index >= ARRAY_SIZE(s->vbe_regs)) { @@ -258,10 +259,10 @@ static void bochs_display_realize(PCIDevice *dev, Error **errp) s->con = graphic_console_init(DEVICE(dev), 0, &bochs_display_gfx_ops, s); - if (s->vgamem < (4 * 1024 * 1024)) { + if (s->vgamem < 4 * MiB) { error_setg(errp, "bochs-display: video memory too small"); } - if (s->vgamem > (256 * 1024 * 1024)) { + if (s->vgamem > 256 * MiB) { error_setg(errp, "bochs-display: video memory too big"); } s->vgamem = pow2ceil(s->vgamem); @@ -323,7 +324,7 @@ static void bochs_display_exit(PCIDevice *dev) } static Property bochs_display_properties[] = { - DEFINE_PROP_SIZE("vgamem", BochsDisplayState, vgamem, 16 * 1024 * 1024), + DEFINE_PROP_SIZE("vgamem", BochsDisplayState, vgamem, 16 * MiB), DEFINE_PROP_END_OF_LIST(), }; diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c index 138ae961b9..5e44f00f3f 100644 --- a/hw/display/cirrus_vga.c +++ b/hw/display/cirrus_vga.c @@ -27,6 +27,7 @@ * available at http://home.worldonline.dk/~finth/ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "trace.h" #include "hw/hw.h" @@ -2218,7 +2219,7 @@ static inline void cirrus_cursor_compute_yrange(CirrusVGAState *s) uint32_t content; int y, y_min, y_max; - src = s->vga.vram_ptr + s->real_vram_size - 16 * 1024; + src = s->vga.vram_ptr + s->real_vram_size - 16 * KiB; if (s->vga.sr[0x12] & CIRRUS_CURSOR_LARGE) { src += (s->vga.sr[0x13] & 0x3c) * 256; y_min = 64; @@ -2347,7 +2348,7 @@ static void cirrus_cursor_draw_line(VGACommonState *s1, uint8_t *d1, int scr_y) return; } - src = s->vga.vram_ptr + s->real_vram_size - 16 * 1024; + src = s->vga.vram_ptr + s->real_vram_size - 16 * KiB; if (s->vga.sr[0x12] & CIRRUS_CURSOR_LARGE) { src += (s->vga.sr[0x13] & 0x3c) * 256; src += (scr_y - s->vga.hw_cursor_y) * 16; @@ -2995,8 +2996,7 @@ static void cirrus_init_common(CirrusVGAState *s, Object *owner, /* I/O handler for LFB */ memory_region_init_io(&s->cirrus_linear_io, owner, &cirrus_linear_io_ops, s, - "cirrus-linear-io", s->vga.vram_size_mb - * 1024 * 1024); + "cirrus-linear-io", s->vga.vram_size_mb * MiB); memory_region_set_flush_coalesced(&s->cirrus_linear_io); /* I/O handler for LFB */ @@ -3013,7 +3013,7 @@ static void cirrus_init_common(CirrusVGAState *s, Object *owner, memory_region_set_flush_coalesced(&s->cirrus_mmio_io); s->real_vram_size = - (s->device_id == CIRRUS_ID_CLGD5446) ? 4096 * 1024 : 2048 * 1024; + (s->device_id == CIRRUS_ID_CLGD5446) ? 4 * MiB : 2 * MiB; /* XXX: s->vga.vram_size must be a power of two */ s->cirrus_addr_mask = s->real_vram_size - 1; diff --git a/hw/display/g364fb.c b/hw/display/g364fb.c index 3d75394e77..fbc2b2422d 100644 --- a/hw/display/g364fb.c +++ b/hw/display/g364fb.c @@ -18,6 +18,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "hw/hw.h" #include "qemu/error-report.h" #include "ui/console.h" @@ -510,8 +511,7 @@ static void g364fb_sysbus_reset(DeviceState *d) } static Property g364fb_sysbus_properties[] = { - DEFINE_PROP_UINT32("vram_size", G364SysBusState, g364.vram_size, - 8 * 1024 * 1024), + DEFINE_PROP_UINT32("vram_size", G364SysBusState, g364.vram_size, 8 * MiB), DEFINE_PROP_END_OF_LIST(), }; diff --git a/hw/display/qxl.c b/hw/display/qxl.c index a71714ccb4..b09a03997a 100644 --- a/hw/display/qxl.c +++ b/hw/display/qxl.c @@ -19,6 +19,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include #include "qapi/error.h" @@ -2012,11 +2013,11 @@ static void qxl_init_ramsize(PCIQXLDevice *qxl) if (qxl->vgamem_size_mb > 256) { qxl->vgamem_size_mb = 256; } - qxl->vgamem_size = qxl->vgamem_size_mb * 1024 * 1024; + qxl->vgamem_size = qxl->vgamem_size_mb * MiB; /* vga ram (bar 0, total) */ if (qxl->ram_size_mb != -1) { - qxl->vga.vram_size = qxl->ram_size_mb * 1024 * 1024; + qxl->vga.vram_size = qxl->ram_size_mb * MiB; } if (qxl->vga.vram_size < qxl->vgamem_size * 2) { qxl->vga.vram_size = qxl->vgamem_size * 2; @@ -2024,7 +2025,7 @@ static void qxl_init_ramsize(PCIQXLDevice *qxl) /* vram32 (surfaces, 32bit, bar 1) */ if (qxl->vram32_size_mb != -1) { - qxl->vram32_size = qxl->vram32_size_mb * 1024 * 1024; + qxl->vram32_size = qxl->vram32_size_mb * MiB; } if (qxl->vram32_size < 4096) { qxl->vram32_size = 4096; @@ -2032,7 +2033,7 @@ static void qxl_init_ramsize(PCIQXLDevice *qxl) /* vram (surfaces, 64bit, bar 4+5) */ if (qxl->vram_size_mb != -1) { - qxl->vram_size = (uint64_t)qxl->vram_size_mb * 1024 * 1024; + qxl->vram_size = (uint64_t)qxl->vram_size_mb * MiB; } if (qxl->vram_size < qxl->vram32_size) { qxl->vram_size = qxl->vram32_size; @@ -2134,13 +2135,12 @@ static void qxl_realize_common(PCIQXLDevice *qxl, Error **errp) } /* print pci bar details */ - dprint(qxl, 1, "ram/%s: %d MB [region 0]\n", - qxl->id == 0 ? "pri" : "sec", - qxl->vga.vram_size / (1024*1024)); - dprint(qxl, 1, "vram/32: %" PRIx64 "d MB [region 1]\n", - qxl->vram32_size / (1024*1024)); - dprint(qxl, 1, "vram/64: %" PRIx64 "d MB %s\n", - qxl->vram_size / (1024*1024), + dprint(qxl, 1, "ram/%s: %" PRId64 " MB [region 0]\n", + qxl->id == 0 ? "pri" : "sec", qxl->vga.vram_size / MiB); + dprint(qxl, 1, "vram/32: %" PRIx64 " MB [region 1]\n", + qxl->vram32_size / MiB); + dprint(qxl, 1, "vram/64: %" PRIx64 " MB %s\n", + qxl->vram_size / MiB, qxl->vram32_size < qxl->vram_size ? "[region 4]" : "[unmapped]"); qxl->ssd.qxl.base.sif = &qxl_interface.base; @@ -2167,7 +2167,7 @@ static void qxl_realize_primary(PCIDevice *dev, Error **errp) qxl->id = 0; qxl_init_ramsize(qxl); vga->vbe_size = qxl->vgamem_size; - vga->vram_size_mb = qxl->vga.vram_size >> 20; + vga->vram_size_mb = qxl->vga.vram_size / MiB; vga_common_init(vga, OBJECT(dev), true); vga_init(vga, OBJECT(dev), pci_address_space(dev), pci_address_space_io(dev), false); @@ -2391,10 +2391,8 @@ static VMStateDescription qxl_vmstate = { }; static Property qxl_properties[] = { - DEFINE_PROP_UINT32("ram_size", PCIQXLDevice, vga.vram_size, - 64 * 1024 * 1024), - DEFINE_PROP_UINT64("vram_size", PCIQXLDevice, vram32_size, - 64 * 1024 * 1024), + DEFINE_PROP_UINT32("ram_size", PCIQXLDevice, vga.vram_size, 64 * MiB), + DEFINE_PROP_UINT64("vram_size", PCIQXLDevice, vram32_size, 64 * MiB), DEFINE_PROP_UINT32("revision", PCIQXLDevice, revision, QXL_DEFAULT_REVISION), DEFINE_PROP_UINT32("debug", PCIQXLDevice, debug, 0), diff --git a/hw/display/vga-isa-mm.c b/hw/display/vga-isa-mm.c index e887b45651..bd58141117 100644 --- a/hw/display/vga-isa-mm.c +++ b/hw/display/vga-isa-mm.c @@ -22,12 +22,13 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "hw/hw.h" #include "hw/display/vga.h" #include "vga_int.h" #include "ui/pixel_ops.h" -#define VGA_RAM_SIZE (8192 * 1024) +#define VGA_RAM_SIZE (8 * MiB) typedef struct ISAVGAMMState { VGACommonState vga; @@ -130,7 +131,7 @@ int isa_vga_mm_init(hwaddr vram_base, s = g_malloc0(sizeof(*s)); - s->vga.vram_size_mb = VGA_RAM_SIZE >> 20; + s->vga.vram_size_mb = VGA_RAM_SIZE / MiB; vga_common_init(&s->vga, NULL, true); vga_mm_init(s, vram_base, ctrl_base, it_shift, address_space); diff --git a/hw/display/vga.c b/hw/display/vga.c index ed476e4e80..d7599182a8 100644 --- a/hw/display/vga.c +++ b/hw/display/vga.c @@ -22,6 +22,7 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "hw/hw.h" #include "hw/display/vga.h" @@ -721,7 +722,7 @@ uint32_t vbe_ioport_read_data(void *opaque, uint32_t addr) val = s->vbe_regs[s->vbe_index]; } } else if (s->vbe_index == VBE_DISPI_INDEX_VIDEO_MEMORY_64K) { - val = s->vbe_size / (64 * 1024); + val = s->vbe_size / (64 * KiB); } else { val = 0; } @@ -2192,7 +2193,7 @@ void vga_common_init(VGACommonState *s, Object *obj, bool global_vmstate) s->vram_size_mb = uint_clamp(s->vram_size_mb, 1, 512); s->vram_size_mb = pow2ceil(s->vram_size_mb); - s->vram_size = s->vram_size_mb << 20; + s->vram_size = s->vram_size_mb * MiB; if (!s->vbe_size) { s->vbe_size = s->vram_size; diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index 2dd3c3481a..71a00718e6 100644 --- a/hw/display/virtio-gpu.c +++ b/hw/display/virtio-gpu.c @@ -12,6 +12,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qemu-common.h" #include "qemu/iov.h" #include "ui/console.h" @@ -1314,8 +1315,7 @@ static const VMStateDescription vmstate_virtio_gpu = { static Property virtio_gpu_properties[] = { DEFINE_PROP_UINT32("max_outputs", VirtIOGPU, conf.max_outputs, 1), - DEFINE_PROP_SIZE("max_hostmem", VirtIOGPU, conf.max_hostmem, - 256 * 1024 * 1024), + DEFINE_PROP_SIZE("max_hostmem", VirtIOGPU, conf.max_hostmem, 256 * MiB), #ifdef CONFIG_VIRGL DEFINE_PROP_BIT("virgl", VirtIOGPU, conf.flags, VIRTIO_GPU_FLAG_VIRGL_ENABLED, true), diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c index bd3e8b3586..08deb08783 100644 --- a/hw/display/vmware_vga.c +++ b/hw/display/vmware_vga.c @@ -22,6 +22,7 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "hw/hw.h" #include "hw/loader.h" @@ -565,7 +566,7 @@ static inline int vmsvga_fifo_length(struct vmsvga_state_s *s) s->fifo_next >= SVGA_FIFO_SIZE) { return 0; } - if (s->fifo_max < s->fifo_min + 10 * 1024) { + if (s->fifo_max < s->fifo_min + 10 * KiB) { return 0; } diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c index f5afcc0358..180d205021 100644 --- a/hw/display/xenfb.c +++ b/hw/display/xenfb.c @@ -25,6 +25,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "hw/hw.h" #include "ui/input.h" @@ -889,7 +890,7 @@ static int fb_initialise(struct XenDevice *xendev) return rc; fb_page = fb->c.page; - rc = xenfb_configure_fb(fb, videoram * 1024 * 1024U, + rc = xenfb_configure_fb(fb, videoram * MiB, fb_page->width, fb_page->height, fb_page->depth, fb_page->mem_length, 0, fb_page->line_length); if (rc != 0) From patchwork Mon Jun 25 12:42:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934258 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="bRF858Rm"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41DpyP1m5gz9s31 for ; Mon, 25 Jun 2018 22:53:49 +1000 (AEST) Received: from localhost ([::1]:46668 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXR06-0000e8-Rm for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 08:53:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54106) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQqX-0001Ua-Ak for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:43:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQqW-0007m6-It for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:43:53 -0400 Received: from mail-qt0-x232.google.com ([2607:f8b0:400d:c0d::232]:40054) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQqW-0007lv-F5; Mon, 25 Jun 2018 08:43:52 -0400 Received: by mail-qt0-x232.google.com with SMTP id x23-v6so1558762qto.7; Mon, 25 Jun 2018 05:43:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZuMsEJNqvKSyCBPPY14CcKQaksQw5RRFbWT+Gic0K8g=; b=bRF858RmjQSogIzEoRn9AHTptOTP1YHcn1UTbmAJ3xVpfmKhKYsESnFMQlAUpZV31R yv+9s2g6Jk7kysIw6L7jyePoeiji3Tz/u4TC1vbdklQR8FcAKE2OTunB99tZpSe/uapv BheZ2NIzmzrmptWCgd86zTOJZT03e6VuPgO/6kRCzfiTJ0YLHDBvf+plZgGuewE0qFjb dKXYRzlOLa8XMn0LzIbENeZckc79r0RFtEKeJe+maz4uzsAFcyGivOgKBIiUG2e1kXjn JXbmddWu4y24mPWn+vODlXqW5XZu0oC9ToeUa94q5VySjs9ylWtzZsSBHZqtVXEniJSw bsVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ZuMsEJNqvKSyCBPPY14CcKQaksQw5RRFbWT+Gic0K8g=; b=cDOJVMUqg/Jq2bLJsEorajIavZbkdrr+bgEC3QbInzZxRIm0dFuTsNFLcT5qbCxQIy p3cEuRN7olCsvexIcdFe2oEx7PzCsHF8TKnulWqfYHjNvkGCY2AfGukiOoKh1IvyW3+u Bj1SfcuAjmi9BiSmVDIwgzcbPmrSt2So3KAXTQ5Hco9GqZhbVK90pdw/F8IKIDRTJsc3 NjU5i+Qpd7np3LJQin3DDenpMdQ0nCj0Kyc/ENOocgYqRR6EmRhyzi7AiuIq6KbYXwxZ FuY3K7e5r+ph5cZb3kV01ZEkWakQd6rHxEmna08AXydoYq+98otbAXk/HZtk3x1tUA6j eWKA== X-Gm-Message-State: APt69E2/ynKjBeF4Es7bGExA83vS7PjO5bqa1cFpf+9zijxKWgpAFTDk bkaw0FCOGBb9y5L3oizM6a4= X-Google-Smtp-Source: ADUXVKKe2mwLeQ9SaArPEJhQGQS34/l/83o7AwjHiurMdC9UsU5+XR1N0wT2wp7W61ERVrob1Ex49g== X-Received: by 2002:aed:39a1:: with SMTP id m30-v6mr10096450qte.328.1529930631918; Mon, 25 Jun 2018 05:43:51 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.43.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:43:51 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil Date: Mon, 25 Jun 2018 09:42:07 -0300 Message-Id: <20180625124238.25339-16-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::232 Subject: [Qemu-devel] [PATCH v5 15/46] hw/misc: Use the IEC binary prefix definitions 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: qemu-trivial@nongnu.org, Jiri Slaby , =?utf-8?q?Philip?= =?utf-8?q?pe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It eases code review, unit is explicit. Patch generated using: $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/ and modified manually. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/misc/auxbus.c | 3 ++- hw/misc/edu.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/misc/auxbus.c b/hw/misc/auxbus.c index b4cacd664b..b8a8721201 100644 --- a/hw/misc/auxbus.c +++ b/hw/misc/auxbus.c @@ -27,6 +27,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qemu/log.h" #include "hw/misc/auxbus.h" #include "hw/i2c/i2c.h" @@ -68,7 +69,7 @@ AUXBus *aux_init_bus(DeviceState *parent, const char *name) /* Memory related. */ bus->aux_io = g_malloc(sizeof(*bus->aux_io)); - memory_region_init(bus->aux_io, OBJECT(bus), "aux-io", (1 << 20)); + memory_region_init(bus->aux_io, OBJECT(bus), "aux-io", 1 * MiB); address_space_init(&bus->aux_addr_space, bus->aux_io, "aux-io"); return bus; } diff --git a/hw/misc/edu.c b/hw/misc/edu.c index 34eb05d213..df26a4d046 100644 --- a/hw/misc/edu.c +++ b/hw/misc/edu.c @@ -23,6 +23,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "hw/pci/pci.h" #include "hw/pci/msi.h" #include "qemu/timer.h" @@ -357,7 +358,7 @@ static void pci_edu_realize(PCIDevice *pdev, Error **errp) edu, QEMU_THREAD_JOINABLE); memory_region_init_io(&edu->mmio, OBJECT(edu), &edu_mmio_ops, edu, - "edu-mmio", 1 << 20); + "edu-mmio", 1 * MiB); pci_register_bar(pdev, 0, PCI_BASE_ADDRESS_SPACE_MEMORY, &edu->mmio); } From patchwork Mon Jun 25 12:42:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934274 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="pXlj9c2/"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41Dq7x6wTfz9rvt for ; Mon, 25 Jun 2018 23:02:05 +1000 (AEST) Received: from localhost ([::1]:46732 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXR87-00081h-EH for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 09:02:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54156) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQqb-0001Z1-9o for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:44:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQqa-0007o7-Da for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:43:57 -0400 Received: from mail-qk0-x230.google.com ([2607:f8b0:400d:c09::230]:33603) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQqa-0007nv-8z; Mon, 25 Jun 2018 08:43:56 -0400 Received: by mail-qk0-x230.google.com with SMTP id c131-v6so7370569qkb.0; Mon, 25 Jun 2018 05:43:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HnKZTyVoatcEAua8gRzzE0zGdvFeT/ivPmK+152r7rk=; b=pXlj9c2/ns2cADJJE7L7Q1nG7jx81hphD1ok3ZM1V6vh7nx9GYQOrYcjRiHR7HgJFU 4zfS82bgwXAtFQTzJuzvmojUc6ZElw7bVMWA1d3vGzrsabEEht5rnZA52elO1ZLTk1my 9HKuojR0/q9FkyTvCuq6LgYvCE1dN0GF41pVmsAnmyqAlHieRgzoSbJPgW5z6UO8MeRr Mi1XuSVwd2s6xtNBDIHCKEQ7do8+LpoitEd1dCjVZ39efUlsrv4h0TWJlDLyBaATiAI3 UWGPfyluUZajk515sGRItlVI/phi9Tbxh4UW1Jj6XFj9oT9FMhaqCW/yFDVK/RxAjxG+ Hb0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=HnKZTyVoatcEAua8gRzzE0zGdvFeT/ivPmK+152r7rk=; b=CKx+ii9jxxcS8EE/3sJ/R1C4XUjeJ5Q55XopK81fLwS2v1WJJWDTIVFhqonroYhZ0+ He+HCJHHw0Sr33gp4TJ2mQR7yvR2+g6s2MPM/Uo2HXJuePunO+IKaOSWw47H+CcoLgI7 1Gs4PrhORlC1wXY0V3cWQXU4cVTnZkiADZ9k9NtYO+RytEwKSM/rTEHurgG7e5aZO64r +owNVtnDnZ+6uDpgdD4sUgCKvgz4eVyRpXefv/9ZIWMGjYm87hz1CHkUFiTEgLXjQSAs 7AZL000WSK9oSxeQU+XqvtHb4PUYIBZmTb8f7W+XBCNclGbysFkSN3Fzl3NxIv21hLy3 7fsw== X-Gm-Message-State: APt69E1GGeqt76Ko860UgJN4O08ygPs7wKlJF2saYF5D0ZCckVBeKUhA Gg3yVCyvzu0NByVGhUtMYI0= X-Google-Smtp-Source: AAOMgpcLQ3+vYB7eTUnGRXdEK5uogcyOwWGtLc9kRU4eZMellixpyOqEd+D/208p+alqEv7BW09dgw== X-Received: by 2002:a37:6251:: with SMTP id w78-v6mr4856140qkb.364.1529930634984; Mon, 25 Jun 2018 05:43:54 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.43.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:43:54 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil Date: Mon, 25 Jun 2018 09:42:08 -0300 Message-Id: <20180625124238.25339-17-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::230 Subject: [Qemu-devel] [PATCH v5 16/46] hw/riscv: Use the IEC binary prefix definitions 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: Sagar Karandikar , qemu-trivial@nongnu.org, Bastian Koppelmann , Palmer Dabbelt , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Michael Clark Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It eases code review, unit is explicit. Patch generated using: $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/ and modified manually. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Michael Clark --- hw/riscv/virt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index ad03113e0f..34d48993a2 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -19,6 +19,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qemu/log.h" #include "qemu/error-report.h" #include "qapi/error.h" @@ -84,7 +85,7 @@ static hwaddr load_initrd(const char *filename, uint64_t mem_size, * halfway into RAM, and for boards with 256MB of RAM or more we put * the initrd at 128MB. */ - *start = kernel_entry + MIN(mem_size / 2, 128 * 1024 * 1024); + *start = kernel_entry + MIN(mem_size / 2, 128 * MiB); size = load_ramdisk(filename, *start, mem_size - *start); if (size == -1) { From patchwork Mon Jun 25 12:42:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934278 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="sekyyqsp"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41DqCS2svKz9rvt for ; Mon, 25 Jun 2018 23:05:08 +1000 (AEST) Received: from localhost ([::1]:46761 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXRB4-0001mC-2T for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 09:05:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54199) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQqe-0001eK-Fp for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:44:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQqc-0007p1-87 for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:44:00 -0400 Received: from mail-qt0-x230.google.com ([2607:f8b0:400d:c0d::230]:36332) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQqc-0007oi-3b; Mon, 25 Jun 2018 08:43:58 -0400 Received: by mail-qt0-x230.google.com with SMTP id o9-v6so11745937qtp.3; Mon, 25 Jun 2018 05:43:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=w/eNHN7MVFKtZqhxJDVTIFbHzlGa0yQerWoCZrXvEQM=; b=sekyyqspgYSfb+sUm0AfP3QPQgrTX8WKWBnkikxDkqOyHQmXaKqGVrFu97+22WJEhY TkfpIAYHSa9kTWawoaQ+REhNK6QZbZNcdnAVCcMhwQ0I5z4gRCnvIVhNT1RE+sa4sNlQ ZwpAj/3//SKClX+6Q6liNfO8TZyhDjITDbmec0Q2IJfnEUvfxSavOVYRolySL/4f6THG CIDR5aPArgdVvg9sU0vDkN1A7TCrzfXkwPDnpzSL4CmKmGshxVoZEDJGzW0i0HeNyNeV KWJlfThGIS2aWxsWnUpGkR+YPLvgY2Ba8B84TOs87aWnm8w/66pPbHUpMNt57X2PO37l XOJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=w/eNHN7MVFKtZqhxJDVTIFbHzlGa0yQerWoCZrXvEQM=; b=P8Q0v3Hy+MzJLEWyGEFGWg0PsiG2E8e0bmXKK4kQV4+13hMK7uYnarxsNj/rh+D7Av 7hQv9m4u0dRxIsFeiQsQiyQ5MhhfsjcOrgeQwgqbVBKRl64jOaw6p4XJ2n1aYR4gSQZH Do4BVBSj0GRn2P4+e7/5tjbJ/yfxeK7GaHWOBDF4meZyCWbNTvt9MHy3i4nUt4poCXNr /vmoRKFCrwmm6POGNSBWjCQ934m1QtNbkA0t2WDghXD2EGvArSB4ZCTeV3sUGJCOY7O2 zHau0NAzFmT7DesYWnM4EpyM5QS7OWhX1TUoL/VjfTMJajZpOptgkBecZL1FtSyN4hKT hrhA== X-Gm-Message-State: APt69E0I8C2Q4OI/7HLP6ovjxW74rgSOuRKn2I35eG4QoMzM2SpnOX4r 7EMSqVhsPgnqi6Tl/9loQgU= X-Google-Smtp-Source: ADUXVKJy0uHooAIQWbwa07jlWbPnQggiu8fyRaUTQY7aS9geSAIERxKVN679/HDb2/n8wozEWW8bHw== X-Received: by 2002:ac8:2e83:: with SMTP id h3-v6mr10553238qta.365.1529930637537; Mon, 25 Jun 2018 05:43:57 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.43.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:43:57 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil Date: Mon, 25 Jun 2018 09:42:09 -0300 Message-Id: <20180625124238.25339-18-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::230 Subject: [Qemu-devel] [PATCH v5 17/46] hw/m68k: Use the IEC binary prefix definitions 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: qemu-trivial@nongnu.org, Thomas Huth , =?utf-8?q?P?= =?utf-8?q?hilippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It eases code review, unit is explicit. Patch generated using: $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/ and modified manually. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- hw/m68k/mcf5208.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/m68k/mcf5208.c b/hw/m68k/mcf5208.c index ae3dcc98c3..0f2245dd81 100644 --- a/hw/m68k/mcf5208.c +++ b/hw/m68k/mcf5208.c @@ -6,6 +6,7 @@ * This code is licensed under the GPL */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qemu/error-report.h" #include "qapi/error.h" #include "qemu-common.h" @@ -241,7 +242,7 @@ static void mcf5208evb_init(MachineState *machine) memory_region_add_subregion(address_space_mem, 0x40000000, ram); /* Internal SRAM. */ - memory_region_init_ram(sram, NULL, "mcf5208.sram", 16384, &error_fatal); + memory_region_init_ram(sram, NULL, "mcf5208.sram", 16 * KiB, &error_fatal); memory_region_add_subregion(address_space_mem, 0x80000000, sram); /* Internal peripherals. */ From patchwork Mon Jun 25 12:42:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934264 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ZU3K/Eqi"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41Dq275JWJz9rvt for ; Mon, 25 Jun 2018 22:57:03 +1000 (AEST) Received: from localhost ([::1]:46690 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXR3F-0003Yl-9l for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 08:57:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54259) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQqh-0001hP-2o for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:44:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQqf-0007qV-2I for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:44:03 -0400 Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]:34655) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQqe-0007qP-TS; Mon, 25 Jun 2018 08:44:00 -0400 Received: by mail-qt0-x243.google.com with SMTP id b20-v6so2516267qtp.1; Mon, 25 Jun 2018 05:44:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iz3ZQ0yZHAFsCyyHxKIGPQYYa7aYo+6g0CaIB6xqMS4=; b=ZU3K/EqiZ55S6uzRjh1MRh1esoOyNM5JEM9x6YH90UxseUc7NdqoRgUszOiiZPpeBs w09VD3rIdL5RZS6rTI09oF8ERO2zl1F8YTwEcrJ2ETvRBVcgw6O1T/didf2ZrZ8Yp3yk GKHeKU3uH2CPbsy/nYw/dOhXkk+uPKyjH7CHrtZvgpmu8ps4jW7lcME8WyADN6qSG3oQ dmC+n/YV2X3a+qE42Jv6x5anbXNSDZ0qfgCk62ZCGbI0BQyQ47gqK/8bH4l4lLF2+BoH 0TZuBaCSFfzV4s7ONqhL6NM2SQ9dW8CAdNJ6taY2xqlQMK+piZ1b55akJKDgDS0l80G8 dXPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=iz3ZQ0yZHAFsCyyHxKIGPQYYa7aYo+6g0CaIB6xqMS4=; b=EiGWf+66LBRhEomsNjxF0XE6cylqULSuHetrvxwq4rSMxf65aop94deTiX8udsuVQv oGlCtP8aAs7E+qZ6ySg6nSbuCyMY2ACUTfafN1j6Dtm/wVhbIOT/nxIs3vbsBI2Yoywc aBN3W4PEWWDBhxsvpaPUI5/9C8aAT+YCjMkOy7Oe6p+orG0SHUKsPTElEmbQqwDVpXGE VXgDnl4oskZOoz9F53p70p5ykHBNplT0rXslBDGbDR28Ffb4XRk+8iQV8F8fdKsLSIwS 1c505NdyXBqoJ6Ja3Y6Zc4kkBSxfVsaGGdDygmqJ8dozuH/+HOa1w++6tXcrseeSrI1d OE6A== X-Gm-Message-State: APt69E17M2HMy4gcc4wVHn9/ryICSMhO3fYmbMZDbNGcsUzMITqOeCMT cFfHcajVTe98a2xwc+c17sYappkH7CQ= X-Google-Smtp-Source: ADUXVKJFj7ay4MCnBdT4Fg/ymkUhVNWukuRlKkpZ1TyjKN3iPNzQmmPpAhPSGb4bkPMV6mlVoM7Rdw== X-Received: by 2002:ac8:4703:: with SMTP id f3-v6mr7484839qtp.176.1529930640385; Mon, 25 Jun 2018 05:44:00 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.43.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:43:59 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil Date: Mon, 25 Jun 2018 09:42:10 -0300 Message-Id: <20180625124238.25339-19-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::243 Subject: [Qemu-devel] [PATCH v5 18/46] hw/sparc: Use the IEC binary prefix definitions 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: qemu-trivial@nongnu.org, Mark Cave-Ayland , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Fabien Chouteau , qemu-devel@nongnu.org, Artyom Tarasenko Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It eases code review, unit is explicit. Patch generated using: $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/ and modified manually. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/sparc/leon3.c | 10 ++++++---- hw/sparc/sun4m.c | 10 +++++----- hw/sparc64/niagara.c | 3 ++- hw/sparc64/sun4u.c | 4 ++-- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c index 98fa6adae0..fa98ab8177 100644 --- a/hw/sparc/leon3.c +++ b/hw/sparc/leon3.c @@ -22,6 +22,7 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qemu/error-report.h" #include "qapi/error.h" #include "qemu-common.h" @@ -139,9 +140,10 @@ static void leon3_generic_hw_init(MachineState *machine) env->qemu_irq_ack = leon3_irq_manager; /* Allocate RAM */ - if ((uint64_t)ram_size > (1UL << 30)) { - error_report("Too much memory for this machine: %d, maximum 1G", - (unsigned int)(ram_size / (1024 * 1024))); + if (ram_size > 1 * GiB) { + error_report("Too much memory for this machine: %" PRId64 "MB," + " maximum 1G", + ram_size / MiB); exit(1); } @@ -149,7 +151,7 @@ static void leon3_generic_hw_init(MachineState *machine) memory_region_add_subregion(address_space_mem, 0x40000000, ram); /* Allocate BIOS */ - prom_size = 8 * 1024 * 1024; /* 8Mb */ + prom_size = 8 * MiB; memory_region_init_ram(prom, NULL, "Leon3.bios", prom_size, &error_fatal); memory_region_set_readonly(prom, true); memory_region_add_subregion(address_space_mem, 0x00000000, prom); diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index b984d2da0e..a9d477572e 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -22,6 +22,7 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" @@ -45,7 +46,6 @@ #include "hw/loader.h" #include "elf.h" #include "trace.h" -#include "qemu/cutils.h" /* * Sun4m architecture was used in the following machines: @@ -66,7 +66,7 @@ #define KERNEL_LOAD_ADDR 0x00004000 #define CMDLINE_ADDR 0x007ff000 #define INITRD_LOAD_ADDR 0x00800000 -#define PROM_SIZE_MAX (1024 * 1024) +#define PROM_SIZE_MAX (1 * MiB) #define PROM_VADDR 0xffd00000 #define PROM_FILENAME "openbios-sparc32" #define CFG_ADDR 0xd00000510ULL @@ -774,9 +774,9 @@ static void ram_init(hwaddr addr, ram_addr_t RAM_size, /* allocate RAM */ if ((uint64_t)RAM_size > max_mem) { - error_report("Too much memory for this machine: %d, maximum %d", - (unsigned int)(RAM_size / (1024 * 1024)), - (unsigned int)(max_mem / (1024 * 1024))); + error_report("Too much memory for this machine: %" PRId64 "," + " maximum %" PRId64, + RAM_size / MiB, max_mem / MiB); exit(1); } dev = qdev_create(NULL, "memory"); diff --git a/hw/sparc64/niagara.c b/hw/sparc64/niagara.c index 22c4655fde..4fa8cb2904 100644 --- a/hw/sparc64/niagara.c +++ b/hw/sparc64/niagara.c @@ -23,6 +23,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qemu-common.h" #include "cpu.h" #include "hw/hw.h" @@ -84,7 +85,7 @@ typedef struct NiagaraBoardState { #define NIAGARA_PROM_BASE 0xfff0000000ULL #define NIAGARA_Q_OFFSET 0x10000ULL #define NIAGARA_OBP_OFFSET 0x80000ULL -#define PROM_SIZE_MAX (4 * 1024 * 1024) +#define PROM_SIZE_MAX (4 * MiB) static void add_rom_or_fail(const char *file, const hwaddr addr) { diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index 3975a7b65a..97d1269346 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -22,6 +22,7 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qemu/error-report.h" #include "qapi/error.h" #include "qemu-common.h" @@ -52,11 +53,10 @@ #include "hw/loader.h" #include "elf.h" #include "trace.h" -#include "qemu/cutils.h" #define KERNEL_LOAD_ADDR 0x00404000 #define CMDLINE_ADDR 0x003ff000 -#define PROM_SIZE_MAX (4 * 1024 * 1024) +#define PROM_SIZE_MAX (4 * MiB) #define PROM_VADDR 0x000ffd00000ULL #define PBM_SPECIAL_BASE 0x1fe00000000ULL #define PBM_MEM_BASE 0x1ff00000000ULL From patchwork Mon Jun 25 12:42:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934283 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="CwzGmZAf"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41DqKc1dgFz9ryk for ; Mon, 25 Jun 2018 23:10:28 +1000 (AEST) Received: from localhost ([::1]:46793 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXRGD-0005yU-Qv for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 09:10:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54330) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQqk-0001ky-6D for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:44:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQqj-0007uL-1a for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:44:06 -0400 Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]:39699) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQqi-0007u0-PV; Mon, 25 Jun 2018 08:44:04 -0400 Received: by mail-qt0-x243.google.com with SMTP id c23-v6so2826978qtn.6; Mon, 25 Jun 2018 05:44:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aQ3j/YvZkmWMsIul5k1XIP5Icic3DirFF7HExLy1BdA=; b=CwzGmZAfzfbSyVSvYbHCrk8WVdvk7lJq56bd85eAuM9LHSn/YMiLudXG8PGIIA3S4/ H4dUX7abMmSYIHX4fH6tRhu6lUCXS5E27+g4GBjqjK6Asu3Z5z1TFhaQKwEawtTV4vFa piyoqdwN/xSdXd+7coITvfYR3SMJo7R4HQZQzPG1MKPgzuDP1dOctPbNneg+ksfUfaaW aFrj3CDPpGAXT4gfyuAiEgOkHhKSZTPU6GvyexikyE/R2DBXWTw+VSPGjj55RXPWK0CF wpGH/7SdJIuwiRusAAlUvg0c93gatuV9hgJgxW+wUJF741TCfOQnjp/twfGMwBgkSFtj BF2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=aQ3j/YvZkmWMsIul5k1XIP5Icic3DirFF7HExLy1BdA=; b=kCpEe00bpVOdk24T15y5+tvIE+xrT0vR59XTSq6/PmYsQ3VvoSSUZf1joThHyRd1WV IyuOQTZpRd+iBWa/U+k182IX8FVUM4bqlH3SdemtLM15sZjkHOWt6Vqxk/Qy6qPFg0ET 9kpc1WHA7cPymdmHn2NfJPfgdEXl2pGUu18ySKTMY4dY4oTsPmrrW0MY6egwhnHoV0RT WcphsEK+x/nF5JR8vtbFwgEhWu8NdyrVJgM7BvwkbuY9VOCB0KckUWHYqrqTy0mbzj8C z7uA87DtfqOCflsYbJ+vpl3mn/Lz1s4jxr/A+ImDe5PZpOYDGryIkyvZ9XgY6vveXJk/ wByQ== X-Gm-Message-State: APt69E28HdUigAEIneQraXvH25ROzngRSKVvdNXIeaesOEShGcPkJUgH i9B7s2eHu1DB1TLmpiJouwg= X-Google-Smtp-Source: AAOMgpfhT5kQ86KhXdXyE1am9VgJD50T48zBjVNnqpE8kvdCQJBz1/jRoUDq/1uQ4CEWRi5T1VZ4Zg== X-Received: by 2002:a0c:e24a:: with SMTP id x10-v6mr10837209qvl.244.1529930644201; Mon, 25 Jun 2018 05:44:04 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.44.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:44:03 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil Date: Mon, 25 Jun 2018 09:42:11 -0300 Message-Id: <20180625124238.25339-20-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::243 Subject: [Qemu-devel] [PATCH v5 19/46] hw/s390x: Use the IEC binary prefix definitions 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: qemu-devel@nongnu.org, David Hildenbrand , qemu-trivial@nongnu.org, Cornelia Huck , Alexander Graf , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Christian Borntraeger , "open list:S390" , Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It eases code review, unit is explicit. Patch generated using: $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/ and modified manually. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Acked-by: Cornelia Huck --- hw/s390x/s390-skeys.c | 3 ++- hw/s390x/s390-stattrib.c | 3 ++- hw/s390x/sclp.c | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/s390x/s390-skeys.c b/hw/s390x/s390-skeys.c index 76241c240e..15f7ab0e53 100644 --- a/hw/s390x/s390-skeys.c +++ b/hw/s390x/s390-skeys.c @@ -10,6 +10,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "hw/boards.h" #include "hw/s390x/storage-keys.h" #include "qapi/error.h" @@ -19,7 +20,7 @@ #include "sysemu/kvm.h" #include "migration/register.h" -#define S390_SKEYS_BUFFER_SIZE 131072 /* Room for 128k storage keys */ +#define S390_SKEYS_BUFFER_SIZE (128 * KiB) /* Room for 128k storage keys */ #define S390_SKEYS_SAVE_FLAG_EOS 0x01 #define S390_SKEYS_SAVE_FLAG_SKEYS 0x02 #define S390_SKEYS_SAVE_FLAG_ERROR 0x04 diff --git a/hw/s390x/s390-stattrib.c b/hw/s390x/s390-stattrib.c index 70b95550a8..5161a1659b 100644 --- a/hw/s390x/s390-stattrib.c +++ b/hw/s390x/s390-stattrib.c @@ -10,6 +10,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "hw/boards.h" #include "cpu.h" #include "migration/qemu-file.h" @@ -20,7 +21,7 @@ #include "qapi/error.h" #include "qapi/qmp/qdict.h" -#define CMMA_BLOCK_SIZE (1 << 10) +#define CMMA_BLOCK_SIZE (1 * KiB) #define STATTR_FLAG_EOS 0x01ULL #define STATTR_FLAG_MORE 0x02ULL diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c index 047d577313..bd2a024efd 100644 --- a/hw/s390x/sclp.c +++ b/hw/s390x/sclp.c @@ -13,6 +13,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "cpu.h" #include "sysemu/sysemu.h" @@ -289,7 +290,7 @@ static void sclp_realize(DeviceState *dev, Error **errp) ret = s390_set_memory_limit(machine->maxram_size, &hw_limit); if (ret == -E2BIG) { error_setg(&err, "host supports a maximum of %" PRIu64 " GB", - hw_limit >> 30); + hw_limit / GiB); } else if (ret) { error_setg(&err, "setting the guest size failed"); } From patchwork Mon Jun 25 12:42:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934255 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="fiSV0yG4"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41DpwC5fcsz9rvt for ; Mon, 25 Jun 2018 22:51:55 +1000 (AEST) Received: from localhost ([::1]:46654 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQyF-0007Qa-NW for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 08:51:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54400) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQqp-0001nt-CT for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:44:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQqo-0007wj-50 for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:44:11 -0400 Received: from mail-qk0-x235.google.com ([2607:f8b0:400d:c09::235]:45218) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQqo-0007wY-0e; Mon, 25 Jun 2018 08:44:10 -0400 Received: by mail-qk0-x235.google.com with SMTP id c198-v6so7349440qkg.12; Mon, 25 Jun 2018 05:44:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=J3ru3PJeV88R2BDv/Grb7IZ4WRCbtW2k8onhNGPjswY=; b=fiSV0yG4J4BxZcuioxayQznbP7VlY+Nn/pLiExc9KXJf1cvJTYHrQ6xX2GixEIq3Y/ ry5H9HFpbJL1seovmlixUw5txmbnYT6Z+9bAmiMIESTWhcYU2ppth27ayynNa1TBU32c wbdI8BJk8ML5xOXy9rxIVIBO9wKaxNw19+qcUvQH3iS7ZOl774htiexAAXLrWAf8ZlW6 I28O7FjavNw8ytKS4qWhO2y5g16Z+0ZjkP51F5L3TRHmL9wx+3Ju8SqnajebVURQUKen UyBybFD2S/nIPHkWjnlsj9StlYunkHXu/GByiyNfe0BqIWmqOlfJn8RdnSyIXXe9FXmN TbJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=J3ru3PJeV88R2BDv/Grb7IZ4WRCbtW2k8onhNGPjswY=; b=Oj+NCWOQv+IDqPTZs2nDz+gz+yAeipUlqCwP9WKc0wsfTRyvoiyISZ96E93lQ9Z78e fS2HO/Htk/PkpSdxvfE2BthKRSyrCOtcQczyYcI2kS181zrOGwVjfUySMEe6w0SExcpl 3wnCMnvljY15dOr+u7DN7es/g2MEaDHhKnrW01UIzqVi4B/pRfiIAXQAV3wjLSnmC7ih C4Bjdu9tjXqxcVJOZ2SsjIoM5oT+SlhOzpu8LNHY15NU/9b6frwi2mBVqN37ULea/17j V2DbD5vVgE24DU41mbstFRPIbwPaNLNKKk31XQCZz8Je9XsiDSVsomdHUSXP9DJ8u16r 5bsA== X-Gm-Message-State: APt69E3Se9R50EXhv24L5tauvfcdtOxBQCxPY/ssovGGfzhITCByDi0q HggWQVzwloe6BAwxPdb3DEI= X-Google-Smtp-Source: AAOMgpf0wV6UaZTa7GLR0B2p92tZTL/5alc9pNR4S3Gk4+mWWGxq6Dc8wf+qLSm3K0VVzqdvuPoq1Q== X-Received: by 2002:a37:19e3:: with SMTP id 96-v6mr10462327qkz.242.1529930649420; Mon, 25 Jun 2018 05:44:09 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.44.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:44:08 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil Date: Mon, 25 Jun 2018 09:42:13 -0300 Message-Id: <20180625124238.25339-22-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::235 Subject: [Qemu-devel] [PATCH v5 21/46] hw/xtensa: Use the IEC binary prefix definitions 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: qemu-trivial@nongnu.org, Max Filippov , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It eases code review, unit is explicit. Patch generated using: $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/ $ git grep -n '[<>][<>]= ?[1-5]0' and modified manually. Signed-off-by: Philippe Mathieu-Daudé Acked-by: Max Filippov --- hw/xtensa/xtfpga.c | 9 +++++---- target/xtensa/helper.c | 5 +++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c index 5dc13034f9..b3161de320 100644 --- a/hw/xtensa/xtfpga.c +++ b/hw/xtensa/xtfpga.c @@ -26,6 +26,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "cpu.h" #include "sysemu/sysemu.h" @@ -152,7 +153,7 @@ static void xtfpga_net_init(MemoryRegion *address_space, sysbus_mmio_get_region(s, 1)); ram = g_malloc(sizeof(*ram)); - memory_region_init_ram_nomigrate(ram, OBJECT(s), "open_eth.ram", 16384, + memory_region_init_ram_nomigrate(ram, OBJECT(s), "open_eth.ram", 16 * KiB, &error_fatal); vmstate_register_ram_global(ram); memory_region_add_subregion(address_space, buffers, ram); @@ -229,7 +230,7 @@ static void xtfpga_init(const XtfpgaBoardDesc *board, MachineState *machine) const char *kernel_cmdline = qemu_opt_get(machine_opts, "append"); const char *dtb_filename = qemu_opt_get(machine_opts, "dtb"); const char *initrd_filename = qemu_opt_get(machine_opts, "initrd"); - const unsigned system_io_size = 224 * 1024 * 1024; + const unsigned system_io_size = 224 * MiB; int n; for (n = 0; n < smp_cpus; n++) { @@ -342,7 +343,7 @@ static void xtfpga_init(const XtfpgaBoardDesc *board, MachineState *machine) cpu_physical_memory_write(cur_lowmem, fdt, fdt_size); cur_tagptr = put_tag(cur_tagptr, BP_TAG_FDT, sizeof(dtb_addr), &dtb_addr); - cur_lowmem = QEMU_ALIGN_UP(cur_lowmem + fdt_size, 4096); + cur_lowmem = QEMU_ALIGN_UP(cur_lowmem + fdt_size, 4 * KiB); } #else if (dtb_filename) { @@ -370,7 +371,7 @@ static void xtfpga_init(const XtfpgaBoardDesc *board, MachineState *machine) initrd_location.end = tswap32(cur_lowmem + initrd_size); cur_tagptr = put_tag(cur_tagptr, BP_TAG_INITRD, sizeof(initrd_location), &initrd_location); - cur_lowmem = QEMU_ALIGN_UP(cur_lowmem + initrd_size, 4096); + cur_lowmem = QEMU_ALIGN_UP(cur_lowmem + initrd_size, 4 * KiB); } cur_tagptr = put_tag(cur_tagptr, BP_TAG_LAST, 0, NULL); env->regs[2] = tagptr; diff --git a/target/xtensa/helper.c b/target/xtensa/helper.c index 34844eead3..c9a6132700 100644 --- a/target/xtensa/helper.c +++ b/target/xtensa/helper.c @@ -26,6 +26,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "cpu.h" #include "exec/exec-all.h" #include "exec/gdbstub.h" @@ -726,10 +727,10 @@ static void dump_tlb(FILE *f, fprintf_function cpu_fprintf, bool print_header = true; if (sz >= 0x100000) { - sz >>= 20; + sz /= MiB; sz_text = "MB"; } else { - sz >>= 10; + sz /= KiB; sz_text = "KB"; } From patchwork Mon Jun 25 12:42:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934260 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="sFdQhqCM"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41Dpzb1VXZz9rvt for ; Mon, 25 Jun 2018 22:54:51 +1000 (AEST) Received: from localhost ([::1]:46673 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXR16-0001RO-RO for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 08:54:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54462) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQqr-0001qe-N6 for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:44:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQqq-0007yF-HW for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:44:13 -0400 Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]:34657) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQqq-0007xs-A1; Mon, 25 Jun 2018 08:44:12 -0400 Received: by mail-qt0-x243.google.com with SMTP id b20-v6so2516792qtp.1; Mon, 25 Jun 2018 05:44:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kueQLUvLnaySKJL8JQ+5t8+YdWy7dKb/5gLlqfsMVaA=; b=sFdQhqCMaKz7it5TswCJZ7s2FUrngYtyMGC4BMipejQAFM28dyREdJTXLxSOK8ckAD Lgm3QMCtRfI7EoAmnEbEkkXEX9t8QK0L9mDH+F8THdPSl0l5Hm+CLGZe/jXPUtsRy6hJ +zq5Kwoas7r7tykcxKBB2XAzDa//p8scRLvJxZorOkI+6KJkcyzvMTlZ8LzMWNN54XiT Of5CNY8YAzjVy3NQBsXA879UeWmaWQeUhC8Q40NbakbVR2X8d+Me9R3wqzdEYlsxNfw8 /KhE96HXmhFhu3N4nC4jgYNCqp/RYQDmD7nxl/TWhcpi9o7FA/TVS63Bfq04Wux/OAfN S07Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=kueQLUvLnaySKJL8JQ+5t8+YdWy7dKb/5gLlqfsMVaA=; b=ubobe417ZhOADylxZtXDxK2KR6xTTqqVmhKLmulU7yKi3EV5tEsNjmxCHRKCNRQEsI oBSsIOaBmmF99XCWvs0kiE959E6UCLjRpd1NKPIbnsyYSfCw81sK/RxuildlZ4kbh40O zkWA6EtYAvfx7WMnizFwnW4/dhFD/1qaIg8yNYjJZl11OXU+e0Ed3/tAolpumPxmiH86 TnNMLQwisu4tmdSVIbBs5q4P2VhqKkXiqsK/uu+NFLOtcL5RL7oT9zV4VYxDzAD5f4Lk 613CXIJZMTdpKSPQXLl4AT5hzY4ficd0qxXrafNFWHKc5NzQsk7uS4XyV8WQUm9V4VzF Z87w== X-Gm-Message-State: APt69E0TCpIftMBda+LHtLDfRc0Phqiouupln0x3UNkENKplXHyO058b ycAV6SE+A/xn7pZFNisw+lY= X-Google-Smtp-Source: ADUXVKIrQOnU/DhSXyYxLCRBQTpqIy2/nYagoIInwghoiotkZk7C4pPsCI0uAgGAFF9p9tOmv0rqxw== X-Received: by 2002:ac8:5144:: with SMTP id h4-v6mr5240259qtn.115.1529930651735; Mon, 25 Jun 2018 05:44:11 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.44.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:44:11 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil Date: Mon, 25 Jun 2018 09:42:14 -0300 Message-Id: <20180625124238.25339-23-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::243 Subject: [Qemu-devel] [PATCH v5 22/46] hw/alpha: Use the IEC binary prefix definitions 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: qemu-trivial@nongnu.org, Richard Henderson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It eases code review, unit is explicit. Patch generated using: $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/ and modified manually. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/alpha/typhoon.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/hw/alpha/typhoon.c b/hw/alpha/typhoon.c index d3ed7cdbe8..d74b5b55e1 100644 --- a/hw/alpha/typhoon.c +++ b/hw/alpha/typhoon.c @@ -7,6 +7,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "cpu.h" #include "hw/hw.h" @@ -813,8 +814,6 @@ PCIBus *typhoon_init(ram_addr_t ram_size, ISABus **isa_bus, qemu_irq *p_rtc_irq, AlphaCPU *cpus[4], pci_map_irq_fn sys_map_irq) { - const uint64_t MB = 1024 * 1024; - const uint64_t GB = 1024 * MB; MemoryRegion *addr_space = get_system_memory(); DeviceState *dev; TyphoonState *s; @@ -855,30 +854,30 @@ PCIBus *typhoon_init(ram_addr_t ram_size, ISABus **isa_bus, /* Pchip0 CSRs, 0x801.8000.0000, 256MB. */ memory_region_init_io(&s->pchip.region, OBJECT(s), &pchip_ops, s, "pchip0", - 256*MB); + 256 * MiB); memory_region_add_subregion(addr_space, 0x80180000000ULL, &s->pchip.region); /* Cchip CSRs, 0x801.A000.0000, 256MB. */ memory_region_init_io(&s->cchip.region, OBJECT(s), &cchip_ops, s, "cchip0", - 256*MB); + 256 * MiB); memory_region_add_subregion(addr_space, 0x801a0000000ULL, &s->cchip.region); /* Dchip CSRs, 0x801.B000.0000, 256MB. */ memory_region_init_io(&s->dchip_region, OBJECT(s), &dchip_ops, s, "dchip0", - 256*MB); + 256 * MiB); memory_region_add_subregion(addr_space, 0x801b0000000ULL, &s->dchip_region); /* Pchip0 PCI memory, 0x800.0000.0000, 4GB. */ - memory_region_init(&s->pchip.reg_mem, OBJECT(s), "pci0-mem", 4*GB); + memory_region_init(&s->pchip.reg_mem, OBJECT(s), "pci0-mem", 4 * GiB); memory_region_add_subregion(addr_space, 0x80000000000ULL, &s->pchip.reg_mem); /* Pchip0 PCI I/O, 0x801.FC00.0000, 32MB. */ memory_region_init_io(&s->pchip.reg_io, OBJECT(s), &alpha_pci_ignore_ops, - NULL, "pci0-io", 32*MB); + NULL, "pci0-io", 32 * MiB); memory_region_add_subregion(addr_space, 0x801fc000000ULL, &s->pchip.reg_io); @@ -899,13 +898,13 @@ PCIBus *typhoon_init(ram_addr_t ram_size, ISABus **isa_bus, /* Pchip0 PCI special/interrupt acknowledge, 0x801.F800.0000, 64MB. */ memory_region_init_io(&s->pchip.reg_iack, OBJECT(s), &alpha_pci_iack_ops, - b, "pci0-iack", 64*MB); + b, "pci0-iack", 64 * MiB); memory_region_add_subregion(addr_space, 0x801f8000000ULL, &s->pchip.reg_iack); /* Pchip0 PCI configuration, 0x801.FE00.0000, 16MB. */ memory_region_init_io(&s->pchip.reg_conf, OBJECT(s), &alpha_pci_conf1_ops, - b, "pci0-conf", 16*MB); + b, "pci0-conf", 16 * MiB); memory_region_add_subregion(addr_space, 0x801fe000000ULL, &s->pchip.reg_conf); From patchwork Mon Jun 25 12:42:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934269 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Zjt1BDtr"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41Dq3D5FYYz9rvt for ; Mon, 25 Jun 2018 22:58:00 +1000 (AEST) Received: from localhost ([::1]:46696 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXR4A-0004M0-A8 for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 08:57:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54523) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQqw-0001uM-2S for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:44:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQqt-0007zj-0W for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:44:18 -0400 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:39701) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQqs-0007za-TH; Mon, 25 Jun 2018 08:44:14 -0400 Received: by mail-qt0-x244.google.com with SMTP id c23-v6so2827495qtn.6; Mon, 25 Jun 2018 05:44:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rK2vkEZJ3UQToBCwCmEfXL0x21NcGMSFEBZy9FMBB+s=; b=Zjt1BDtrsLYnY7sLMgn1CpdLIzXiQAVQQP7RMu33nTgzPF9vXu4aOcQu0ift7OXmlI 8aYSnds7q5Aubz5e+k2otEAFf3Kq/AmUmivdTn8ZCj+WHaUvnJnXviyicZTKx2B3AuCh WZ5QM/jCzVlFWA5lYY997Dujo7eLyyd/ss4VgOPtxiYQS1ZFSQvphVVo0UdPymksz9aM BE9LG8eDU93Zsi/Vkghe6DCPh7Q6qskOmmuxqdN/NpspSvogGJuCIWM2cldQITiBnmaB 4CzK2jNErGpXivYo3pC2UYguUgfLKF/oURrIUEEGjViXxeF9cnpzshLODOQBiY38tPaS gMCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=rK2vkEZJ3UQToBCwCmEfXL0x21NcGMSFEBZy9FMBB+s=; b=YxPUk0nqmV9lUFhUvyc1mzLJXRH7mjse9N36m2AZbs1yBmi24Ga7KykX2MRPzDrovg j7+EOg2f79zPXm56HARvn7AbYpxZVRS62E9pq9K9/XHmTQq7SkNiuRdCBEFSJ8MekG1m pcooZmkceRvYiGthPgqCkraPExZoHkkMGkAIcxa8m25oiBjb/r0e0XpBkLxbJbGXF23D NsA83DvGuev+zqrJMKdyld8PkQwnsdDsxDDPhOZ9/VJcIV4XZbVAPNvNJXrJQQkmbl6x OKJ5jNLKcFLqChdmEzq6Nr+eXjA8jrRZc2J6FTSyTyDaNdoL1PZhQi/xf476+F9f5y3w 8krg== X-Gm-Message-State: APt69E2ljP6lPRiAsnHS5B9la0/JnDE+IZ1vBjdhKiuq4WBhPc8AxpON 23pGMVH9Nm3Ja7le6NYJHMc= X-Google-Smtp-Source: AAOMgpf0VWfYlzvtcSKr3BknmlSExr59HGcHs22DMnQrVsYh70/7hMFHm028en0H5qR5DU+qCdpZVA== X-Received: by 2002:ac8:1a57:: with SMTP id q23-v6mr10942846qtk.297.1529930654423; Mon, 25 Jun 2018 05:44:14 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.44.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:44:13 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil Date: Mon, 25 Jun 2018 09:42:15 -0300 Message-Id: <20180625124238.25339-24-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::244 Subject: [Qemu-devel] [PATCH v5 23/46] hw/tricore: Use the IEC binary prefix definitions 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: qemu-trivial@nongnu.org, Bastian Koppelmann , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It eases code review, unit is explicit. Patch generated using: $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/ and modified manually. Signed-off-by: Philippe Mathieu-Daudé Acked-by: Bastian Koppelmann --- hw/tricore/tricore_testboard.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/hw/tricore/tricore_testboard.c b/hw/tricore/tricore_testboard.c index 8e61dfc3e6..a58096f05e 100644 --- a/hw/tricore/tricore_testboard.c +++ b/hw/tricore/tricore_testboard.c @@ -19,6 +19,7 @@ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" @@ -72,17 +73,17 @@ static void tricore_testboard_init(MachineState *machine, int board_id) cpu = TRICORE_CPU(cpu_create(machine->cpu_type)); env = &cpu->env; memory_region_init_ram(ext_cram, NULL, "powerlink_ext_c.ram", - 2 * 1024 * 1024, &error_fatal); + 2 * MiB, &error_fatal); memory_region_init_ram(ext_dram, NULL, "powerlink_ext_d.ram", - 4 * 1024 * 1024, &error_fatal); - memory_region_init_ram(int_cram, NULL, "powerlink_int_c.ram", 48 * 1024, + 4 * MiB, &error_fatal); + memory_region_init_ram(int_cram, NULL, "powerlink_int_c.ram", 48 * KiB, &error_fatal); - memory_region_init_ram(int_dram, NULL, "powerlink_int_d.ram", 48 * 1024, + memory_region_init_ram(int_dram, NULL, "powerlink_int_d.ram", 48 * KiB, &error_fatal); memory_region_init_ram(pcp_data, NULL, "powerlink_pcp_data.ram", - 16 * 1024, &error_fatal); + 16 * KiB, &error_fatal); memory_region_init_ram(pcp_text, NULL, "powerlink_pcp_text.ram", - 32 * 1024, &error_fatal); + 32 * KiB, &error_fatal); memory_region_add_subregion(sysmem, 0x80000000, ext_cram); memory_region_add_subregion(sysmem, 0xa1000000, ext_dram); From patchwork Mon Jun 25 12:42:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934279 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="RLW8TNsB"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41DqDR5PHMz9s2t for ; Mon, 25 Jun 2018 23:05:59 +1000 (AEST) Received: from localhost ([::1]:46771 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXRBt-0002fz-BQ for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 09:05:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54529) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQqw-0001uS-Ho for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:44:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQqv-00080d-N8 for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:44:18 -0400 Received: from mail-qk0-x22f.google.com ([2607:f8b0:400d:c09::22f]:36333) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQqv-00080P-IM; Mon, 25 Jun 2018 08:44:17 -0400 Received: by mail-qk0-x22f.google.com with SMTP id a132-v6so423283qkg.3; Mon, 25 Jun 2018 05:44:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wplSpMQsybUjD/teSFBT4ppWSdPGswCxgwbKvL+lxAs=; b=RLW8TNsBODFQpWTlNTWe5H6jUMikFf6/Mo5JDJwzxEMpf7NWyn75CCUm3gjN5Xz7i6 ezBwn1iRG6D1tYO7I86uJwh4CKa3KxOuwSkXWWwwZAz/6iWwdjHoFvH7OF1+CrbyUnBI MvqZ3ltevSqICOZCFNM+VyunqHBS4XkuPHKY/2Xj7OaL8ZD0lieQ7Br8eiy25eW9+Tw9 bCEduK95urXaLsW4hk+BFtw0oOuGa84Mj5ggZiFa9/9wuV4UlhNPmXHj113s8cBCnzoa qjDrDAweSWrGPHsW3/7uJi9mq8ypvl2wMhGFYDjIICK6896A8JcsAdl6dJkRKrtsSyvt FF0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=wplSpMQsybUjD/teSFBT4ppWSdPGswCxgwbKvL+lxAs=; b=ZLGo4S72UWm032kLQ8yYfcl7A+5/3EvjSloLHlJlBJnk392r+SXhy+fR+Oav60TtFU 0i2/aaYKu9b40vMOvj6yPsF/NRBKRaMbjzf11wRx4eIwVw9TODrqLSBp5ICir1JRsGza x2eHj0rSUQ1RL4JsYfZ6ASEWlkNNz3i80bqQek3VsxsiNwyMX4x09ccPhb4l0ksI34Gp 98so7ky5XeCFFVUb5ObTWUmeiA7V7fxO5TMdDyWN7TQEjjsfsa9KBwkNsfHvAoGkXo9+ 1SHOgKzRFnB4r5Cd8tv+nnt9znXo1d6SscnP0p4ihRnn5YBRaJOvv5M6CN3SaeHFJca3 WHRw== X-Gm-Message-State: APt69E3mlnKUygq5MSjIrSmPTl03c+1Xqp/Xdlp90KxqETC8tGZWFs3g EZTQLsTOEb8h3YVd7u1lMYo= X-Google-Smtp-Source: AAOMgpcsdhvi9eW2WzxOA5dfXFtON0IRDLrDQ/n5/MHOjDz9Hp80UHeNniG8JeHhB25gWcLGC9eHVA== X-Received: by 2002:a37:234c:: with SMTP id j73-v6mr4197623qkj.146.1529930656976; Mon, 25 Jun 2018 05:44:16 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.44.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:44:16 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil Date: Mon, 25 Jun 2018 09:42:16 -0300 Message-Id: <20180625124238.25339-25-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::22f Subject: [Qemu-devel] [PATCH v5 24/46] hw/microblaze: Use the IEC binary prefix definitions 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: qemu-trivial@nongnu.org, "Edgar E. Iglesias" , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It eases code review, unit is explicit. Patch generated using: $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/ and modified manually. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/microblaze/petalogix_ml605_mmu.c | 7 ++++--- hw/microblaze/petalogix_s3adsp1800_mmu.c | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/hw/microblaze/petalogix_ml605_mmu.c b/hw/microblaze/petalogix_ml605_mmu.c index 6c4a544eac..c730878d25 100644 --- a/hw/microblaze/petalogix_ml605_mmu.c +++ b/hw/microblaze/petalogix_ml605_mmu.c @@ -26,6 +26,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" @@ -44,8 +45,8 @@ #include "hw/stream.h" -#define LMB_BRAM_SIZE (128 * 1024) -#define FLASH_SIZE (32 * 1024 * 1024) +#define LMB_BRAM_SIZE (128 * KiB) +#define FLASH_SIZE (32 * MiB) #define BINARY_DEVICE_TREE_FILE "petalogix-ml605.dtb" @@ -109,7 +110,7 @@ petalogix_ml605_init(MachineState *machine) pflash_cfi01_register(FLASH_BASEADDR, NULL, "petalogix_ml605.flash", FLASH_SIZE, dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, - (64 * 1024), FLASH_SIZE >> 16, + 64 * KiB, FLASH_SIZE >> 16, 2, 0x89, 0x18, 0x0000, 0x0, 0); diff --git a/hw/microblaze/petalogix_s3adsp1800_mmu.c b/hw/microblaze/petalogix_s3adsp1800_mmu.c index 0da3e62102..5cf7b84c79 100644 --- a/hw/microblaze/petalogix_s3adsp1800_mmu.c +++ b/hw/microblaze/petalogix_s3adsp1800_mmu.c @@ -24,6 +24,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" @@ -39,8 +40,8 @@ #include "boot.h" -#define LMB_BRAM_SIZE (128 * 1024) -#define FLASH_SIZE (16 * 1024 * 1024) +#define LMB_BRAM_SIZE (128 * KiB) +#define FLASH_SIZE (16 * MiB) #define BINARY_DEVICE_TREE_FILE "petalogix-s3adsp1800.dtb" @@ -87,7 +88,7 @@ petalogix_s3adsp1800_init(MachineState *machine) pflash_cfi01_register(FLASH_BASEADDR, NULL, "petalogix_s3adsp1800.flash", FLASH_SIZE, dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, - (64 * 1024), FLASH_SIZE >> 16, + 64 * KiB, FLASH_SIZE >> 16, 1, 0x89, 0x18, 0x0000, 0x0, 1); dev = qdev_create(NULL, "xlnx.xps-intc"); From patchwork Mon Jun 25 12:42:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934281 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="EHY6yLzJ"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41DqHP0ZWfz9rvt for ; Mon, 25 Jun 2018 23:08:33 +1000 (AEST) Received: from localhost ([::1]:46780 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXREM-0004U3-Mr for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 09:08:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54563) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQqy-0001vW-Tr for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:44:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQqy-00081a-3m for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:44:20 -0400 Received: from mail-qk0-x22f.google.com ([2607:f8b0:400d:c09::22f]:42890) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQqx-00081W-Vt; Mon, 25 Jun 2018 08:44:20 -0400 Received: by mail-qk0-x22f.google.com with SMTP id u62-v6so4824275qkf.9; Mon, 25 Jun 2018 05:44:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=X12l4Aoe2kRtlEABqCKPMZ0wxEOwnCu+oNzwaXBv9H4=; b=EHY6yLzJAQFMA5QiX/ifdQGfJWOz3blpNTximpV3k4pbGXm4hBqCZC6CbRWIefHZtE uBkR22S4579VZpjarPxJDtxGm1akKSn8j1+pUNe0stAgvZubfCOjKAJk8Vm5j4OhjDKJ 9wKtRfCG6l5RXBSgT6g1BNHnpSmWKYfCUb0DSWV/ublDe5m0NlZHvTCSh584VleWu2pf ib2dGyoOvdG/7G+bG8QV8Pard+hxcd4uejQCh5KjhFpfq4R7R8PQ4VQIF/GpaU/P5FkL UoTXpP4GcT8Cb3znylAPY17W2bs1TjPak8V89o6rqDFCA3xY5+3VLiXxouMO4T6Cx7jp XBEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=X12l4Aoe2kRtlEABqCKPMZ0wxEOwnCu+oNzwaXBv9H4=; b=kM8IrbyWp9++ZDgUtHZM+clL1Zvh3iKNx08SuW6lFYDAf0Hi8j2gjVeCIz1uWIdoGR ZkpIpw/uFSXn2HXdqsk3w4Do4XK0vwrHssBu1NC7+80F2qGVkzmQyj9a7Z/pb2NmGGS7 toYD3DlI7DnUGsaE9wYr5+qyY2IoLOOufu9Rby3G3og8MOM41gYjocuHYMxlTnqd9iNs hpiBNb/P9EKQ5vXDjQe+vCuBnCPWAX2JfX2cuUx78IQYpnsxMgngikJij/L0DnyLyPAv A1nOu8LeioVZgNckfYZtngAFLbl6uzph/6RCQLGLLGFQRflyIceJC6AbzA4kkR6vXDOY pbJg== X-Gm-Message-State: APt69E1vqngOdBxv4EmgqRJmbtRBOL0PVGa1f44QItuQbMsCeX5PkWRH gnYASMh8scY4QE9XwEcKYTo= X-Google-Smtp-Source: AAOMgpeY7glr45BWpm6BbTTf0FcHZai0eBVAr+r6ybzr6IziH1WIAvye7Vbx2dvEAPbmvbAZYHgmLg== X-Received: by 2002:a37:b91:: with SMTP id 139-v6mr511174qkl.429.1529930659496; Mon, 25 Jun 2018 05:44:19 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.44.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:44:19 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil Date: Mon, 25 Jun 2018 09:42:17 -0300 Message-Id: <20180625124238.25339-26-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::22f Subject: [Qemu-devel] [PATCH v5 25/46] hw/nios2: Use the IEC binary prefix definitions 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: qemu-trivial@nongnu.org, Marek Vasut , Chris Wulff , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It eases code review, unit is explicit. Patch generated using: $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/ and modified manually. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/nios2/boot.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/nios2/boot.c b/hw/nios2/boot.c index 94f436e7fb..4bb5b601d3 100644 --- a/hw/nios2/boot.c +++ b/hw/nios2/boot.c @@ -29,6 +29,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qemu-common.h" #include "cpu.h" #include "qemu/option.h" @@ -38,7 +39,6 @@ #include "sysemu/sysemu.h" #include "hw/loader.h" #include "elf.h" -#include "qemu/cutils.h" #include "boot.h" @@ -177,7 +177,7 @@ void nios2_load_kernel(Nios2CPU *cpu, hwaddr ddr_base, high = ddr_base + kernel_size; } - high = ROUND_UP(high, 1024 * 1024); + high = ROUND_UP(high, 1 * MiB); /* If initrd is available, it goes after the kernel, aligned to 1M. */ if (initrd_filename) { @@ -213,7 +213,7 @@ void nios2_load_kernel(Nios2CPU *cpu, hwaddr ddr_base, high += fdt_size; /* Kernel command is at the end, 4k aligned. */ - boot_info.cmdline = ROUND_UP(high, 4096); + boot_info.cmdline = ROUND_UP(high, 4 * KiB); if (kernel_cmdline && strlen(kernel_cmdline)) { pstrcpy_targphys("cmdline", boot_info.cmdline, 256, kernel_cmdline); } From patchwork Mon Jun 25 12:42:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934284 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="gJVSWbk9"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41DqM85Wf7z9rvt for ; Mon, 25 Jun 2018 23:11:48 +1000 (AEST) Received: from localhost ([::1]:46805 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXRHW-00073Q-As for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 09:11:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54612) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQr1-0001yZ-IU for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:44:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQr0-00082q-NK for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:44:23 -0400 Received: from mail-qk0-x230.google.com ([2607:f8b0:400d:c09::230]:42891) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQr0-00082f-Hy; Mon, 25 Jun 2018 08:44:22 -0400 Received: by mail-qk0-x230.google.com with SMTP id u62-v6so4824354qkf.9; Mon, 25 Jun 2018 05:44:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bCdZdki+FpDloqz02q7J0g7sSirFO9erYi+TTCX6QF8=; b=gJVSWbk9jvtqS/TeiqLky7YYX0pT+R430vBBptuk5DuA3CSfoN0cRjuBYaxkxKlf+r gQkH0NBpWgU8IUwyEOUNzEz4QNc7+62CtgrWmLRJ9rtSvBCAnSs8eK2rLuWkYUivgceu 1gpFNao89VqEQ7DLR+HzkPl3LJcLnTuJ0nPrdgaFlAK6BZSPPrivpJUzb/NxLw4MBR4Z 2VjPUL6noxHFJtUIzvUiZSxSMinUTfKAt/5/XoVvUdrCalVYhsUP5ah1TmdgnCG+gjka 1ScDTcAGXkVIubiE9K6pORzE0z0TvG/pLKea+zcwnI+gPlKvh0nKF/473SzabjG2j6Zx 9xJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=bCdZdki+FpDloqz02q7J0g7sSirFO9erYi+TTCX6QF8=; b=DitByo//4gaKGk28cXAdQMlAs6nW7vaDFuKH0rB7p+6JnIMG682Np7NgINM+BSPND2 op9vqeNVit9qb8BBggEw0XAnBLOti/YfGfggLYAhg6DY8IwzS9MQavbP+qupSvdwJg2C W9tw7O7kN5xKjwnRBSiGzBLRG2h2DDhPFlUt9ow2w26JWZ7dsbZzUBiV/FR7tzK5juo9 3sxVeIogPi1iWDJ9H+F5CTFoKFr9BbEOfFSFct5CKktzWUcHlAUP0FtA13ncJFX6ezKS oMWXKWW82dVJIMWWpnZmlI1YH7DxSDiA9uaE3owGh/yBTm+XP48zAPrS4VYfqzyMrqyB oZHw== X-Gm-Message-State: APt69E3MeeaJOSXwJGtsHHwiU5zSeIEFvwaS1BoqRASOHivLeKUCmp7v lGTAvmLBMF8WPsHG8nbBUAA= X-Google-Smtp-Source: AAOMgpdMpnYrY66gxVRi1+QDcp0Y7+jzdkSivPWAAeNiaqfp0TaeyGMiasEm8tlxhc83xwk639MUnA== X-Received: by 2002:a37:3a45:: with SMTP id h66-v6mr3695760qka.118.1529930662061; Mon, 25 Jun 2018 05:44:22 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.44.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:44:21 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil Date: Mon, 25 Jun 2018 09:42:18 -0300 Message-Id: <20180625124238.25339-27-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::230 Subject: [Qemu-devel] [PATCH v5 26/46] hw/cris: Use the IEC binary prefix definitions 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: qemu-trivial@nongnu.org, "Edgar E. Iglesias" , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It eases code review, unit is explicit. Patch generated using: $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/ and modified manually. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/cris/axis_dev88.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/cris/axis_dev88.c b/hw/cris/axis_dev88.c index 56ee398ee5..191292eebf 100644 --- a/hw/cris/axis_dev88.c +++ b/hw/cris/axis_dev88.c @@ -23,6 +23,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" @@ -242,7 +243,7 @@ static const MemoryRegionOps gpio_ops = { }, }; -#define INTMEM_SIZE (128 * 1024) +#define INTMEM_SIZE (128 * KiB) static struct cris_load_info li; From patchwork Mon Jun 25 12:42:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934272 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="BEOmRjDX"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41Dq662VGpz9ryk for ; Mon, 25 Jun 2018 23:00:29 +1000 (AEST) Received: from localhost ([::1]:46712 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXR6X-0006hf-35 for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 09:00:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54656) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQr5-000224-Nf for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:44:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQr3-00083s-3E for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:44:27 -0400 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:39703) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQr2-00083d-VO; Mon, 25 Jun 2018 08:44:25 -0400 Received: by mail-qt0-x244.google.com with SMTP id c23-v6so2827965qtn.6; Mon, 25 Jun 2018 05:44:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=t2iQqIMi1+J2VItu51DRtsuf+lb7WIl0xZZ6TqVdeJY=; b=BEOmRjDX9ZcSVzYfPbchPn7srIWFYtydRy1d8OvpEqGLZmQKw3v2ZaCwuImZgXGUeY 2iwhc70RFMVXknOFBfpniiEhP3jikx+ybT5/U5SrlcTP2SSCTxg8BmDBAHv1OncXJkQV rAYnj9tgJTh4ajciyrb61eHpWXMvzE5MLeaDKCVe//HgTePgnELVpdaRuHxFg4Qu7eOb 0FmzKXWyLSpNGpw5t6BTAe/dJI0o9tvTMmyAt56Oympe+vy7AQVBhKL/7dnA/jUVVu+n QULGwI5ASXcm4BZLZC4RKafWk9LyL4jJjbr3elMDtEEyseID2CHSvCiDyF5SkdHjGoq8 3lWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=t2iQqIMi1+J2VItu51DRtsuf+lb7WIl0xZZ6TqVdeJY=; b=sANgNMGbIqBmCcObg4DjSx/kf399UCp9wIwBQP3q8yUVUSL0p4nSLrc9//1amSu6NH y3BckQzueA1CAgBKBX4qk/JaCh4pHyAr8GBuum3ByyP1tn9wP4E2lE0L8B1doEHHOJTe tS8FO5I/KqYeHYBM4GGNHf5pMDaokEfweTlRQkIpHV8HE1+d0pdibNEnCPTZ00OwJGX/ uYUZID3EOHYVo90jlzT3pJtoMAf3S57DvIxfRegmf3Gc0ql2mk9NPU+aZeSqWKi7qM6a TF/3PtygBIUvTj6yu0ygF8pd9OFgFECh74zDOzlZcmkPoxK09FwTik9sXD3C0BmtuwYK EcYA== X-Gm-Message-State: APt69E3Hk+8eXWY3XQ95ANDQtYDacvJwxsTw+PEz6sSDRVPcJ6sK2HKO kJDYk0HbDDs9AOH7C1qcHBo= X-Google-Smtp-Source: AAOMgpc5IIM4wraxUf+ek84IXurhqWiQpyhr3Oqp8zYz0UmYh1xC0qD1rORJ8oMC/ARYE2GHZF1h9w== X-Received: by 2002:a0c:a063:: with SMTP id b90-v6mr10713335qva.115.1529930664450; Mon, 25 Jun 2018 05:44:24 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.44.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:44:24 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil Date: Mon, 25 Jun 2018 09:42:19 -0300 Message-Id: <20180625124238.25339-28-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::244 Subject: [Qemu-devel] [PATCH v5 27/46] hw/lm32: Use the IEC binary prefix definitions 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: qemu-trivial@nongnu.org, Michael Walle , =?utf-8?q?P?= =?utf-8?q?hilippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It eases code review, unit is explicit. Patch generated using: $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/ and modified manually. Signed-off-by: Philippe Mathieu-Daudé Acked-by: Michael Walle --- hw/lm32/lm32_boards.c | 13 +++++++------ hw/lm32/milkymist.c | 10 +++++----- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/hw/lm32/lm32_boards.c b/hw/lm32/lm32_boards.c index 167058348e..fd8eccca14 100644 --- a/hw/lm32/lm32_boards.c +++ b/hw/lm32/lm32_boards.c @@ -18,6 +18,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qemu/error-report.h" #include "qemu-common.h" #include "cpu.h" @@ -87,10 +88,10 @@ static void lm32_evr_init(MachineState *machine) /* memory map */ hwaddr flash_base = 0x04000000; - size_t flash_sector_size = 256 * 1024; - size_t flash_size = 32 * 1024 * 1024; + size_t flash_sector_size = 256 * KiB; + size_t flash_size = 32 * MiB; hwaddr ram_base = 0x08000000; - size_t ram_size = 64 * 1024 * 1024; + size_t ram_size = 64 * MiB; hwaddr timer0_base = 0x80002000; hwaddr uart0_base = 0x80006000; hwaddr timer1_base = 0x8000a000; @@ -173,10 +174,10 @@ static void lm32_uclinux_init(MachineState *machine) /* memory map */ hwaddr flash_base = 0x04000000; - size_t flash_sector_size = 256 * 1024; - size_t flash_size = 32 * 1024 * 1024; + size_t flash_sector_size = 256 * KiB; + size_t flash_size = 32 * MiB; hwaddr ram_base = 0x08000000; - size_t ram_size = 64 * 1024 * 1024; + size_t ram_size = 64 * MiB; hwaddr uart0_base = 0x80000000; hwaddr timer0_base = 0x80002000; hwaddr timer1_base = 0x80010000; diff --git a/hw/lm32/milkymist.c b/hw/lm32/milkymist.c index c36bbc4ae2..321f184595 100644 --- a/hw/lm32/milkymist.c +++ b/hw/lm32/milkymist.c @@ -18,6 +18,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qemu/error-report.h" #include "qemu-common.h" #include "cpu.h" @@ -33,11 +34,10 @@ #include "milkymist-hw.h" #include "lm32.h" #include "exec/address-spaces.h" -#include "qemu/cutils.h" #define BIOS_FILENAME "mmone-bios.bin" #define BIOS_OFFSET 0x00860000 -#define BIOS_SIZE (512*1024) +#define BIOS_SIZE (512 * KiB) #define KERNEL_LOAD_ADDR 0x40000000 typedef struct { @@ -96,10 +96,10 @@ milkymist_init(MachineState *machine) /* memory map */ hwaddr flash_base = 0x00000000; - size_t flash_sector_size = 128 * 1024; - size_t flash_size = 32 * 1024 * 1024; + size_t flash_sector_size = 128 * KiB; + size_t flash_size = 32 * MiB; hwaddr sdram_base = 0x40000000; - size_t sdram_size = 128 * 1024 * 1024; + size_t sdram_size = 128 * MiB; hwaddr initrd_base = sdram_base + 0x1002000; hwaddr cmdline_base = sdram_base + 0x1000000; From patchwork Mon Jun 25 12:42:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934287 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="G/rrkqlK"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41DqQJ1fQzz9ryk for ; Mon, 25 Jun 2018 23:14:32 +1000 (AEST) Received: from localhost ([::1]:46822 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXRK9-0000dI-No for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 09:14:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54674) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQr6-00023G-MH for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:44:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQr5-00084o-Tg for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:44:28 -0400 Received: from mail-qt0-x236.google.com ([2607:f8b0:400d:c0d::236]:40061) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQr5-00084b-PO; Mon, 25 Jun 2018 08:44:27 -0400 Received: by mail-qt0-x236.google.com with SMTP id x23-v6so1560307qto.7; Mon, 25 Jun 2018 05:44:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=19cBcMWK/hzR8d2Dsnno3+HmJyy0GnwFw6ac/J8Nnuk=; b=G/rrkqlK0TAj/gnOcmBksD+otPmXoPjIb1ovmxdeqeaar4iT5E2IZXfuB3laUwbuN9 KFX6cVtYFH0skPif/SQeyFI5HEUm+Mq6zz1soKEWRjG/Yl0E+vQbgu+Uy9UTdOoK3ALC RdroMVOMS5m+GrNnmGUrpraWVz+RWcXDn/FbLkcCTIto7pBUtHUIMhMwJD/Kdq7S9RBy jaqQuIwmjg2hcbhltFuD4JrwGDi4ZvvuJ1QbA2jvxGkmNkrp3cUFUu36uL5E9WXiPn1P FAoXa9XC2xy0exEEZ2Xh2nsVXEhvPQ0KZ6UEzicA23/VNSv88Uz9aOfP41ELQewytvjy yhIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=19cBcMWK/hzR8d2Dsnno3+HmJyy0GnwFw6ac/J8Nnuk=; b=OQHxqLSAD2n5OBAAMMGR29IsfP+fNwieBRs74AQNKab2J820KlK7X5ZWp7CNzAI4Fu yhNe9CSH9hIE/L6TE8iiYzS1XOq4wMIyT70d/Wp0oUTlmG7B7ve/h0qxyWZJoaDN9/2b aykdSGqtuROWzON3S9rKqVieF/pOOGnLQIm9ugVh5IWz1PbJf/KomP1IE8MVCXKmy0Zt jY8B1WFq+Rswaw5OamCx4wWt6e9yjDXDXuCnH+crN9qF3NLSOiBDgB9gXYxKUWde3TIj pr1wKaPIQx70mYkPE59sN5SplcK6DqQoWN+CwlVUExsDLgm4gmlkGKXBuY6Xv3unwLkX 4OIg== X-Gm-Message-State: APt69E2v9qZoasrhzn/6ZSfjRMbVemsbTsbYplMhwVfqPa9a7PTEuYkK TC171qDThRuBRtSlPm3PJaY= X-Google-Smtp-Source: ADUXVKLF93iFN9wrP7PGJK0yJ4kUrXQyEGSdeeeNuw7Hwc0HZowtLYs8hIyAYNzKwpPl82LRyhABFQ== X-Received: by 2002:aed:3c78:: with SMTP id u53-v6mr10871341qte.201.1529930667194; Mon, 25 Jun 2018 05:44:27 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.44.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:44:26 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil Date: Mon, 25 Jun 2018 09:42:20 -0300 Message-Id: <20180625124238.25339-29-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::236 Subject: [Qemu-devel] [PATCH v5 28/46] hw/sh4: Use the IEC binary prefix definitions 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: qemu-trivial@nongnu.org, Magnus Damm , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Aurelien Jarno , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It eases code review, unit is explicit. Patch generated using: $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/ and modified manually. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/sh4/r2d.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c index 8fe8766eb9..6a5fc46a47 100644 --- a/hw/sh4/r2d.c +++ b/hw/sh4/r2d.c @@ -24,6 +24,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" @@ -291,7 +292,7 @@ static void r2d_init(MachineState *machine) dinfo = drive_get(IF_PFLASH, 0, 0); pflash_cfi02_register(0x0, NULL, "r2d.flash", FLASH_SIZE, dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, - (16 * 1024), FLASH_SIZE >> 16, + 16 * KiB, FLASH_SIZE >> 16, 1, 4, 0x0000, 0x0000, 0x0000, 0x0000, 0x555, 0x2aa, 0); From patchwork Mon Jun 25 12:42:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934297 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="hwdKyb/P"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41DqTy5d9Jz9rvt for ; Mon, 25 Jun 2018 23:17:42 +1000 (AEST) Received: from localhost ([::1]:46853 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXRNE-0003Lb-Ak for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 09:17:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54729) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQr9-00026C-Df for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:44:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQr8-00085z-KM for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:44:31 -0400 Received: from mail-qt0-x236.google.com ([2607:f8b0:400d:c0d::236]:46354) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQr8-00085s-Fc; Mon, 25 Jun 2018 08:44:30 -0400 Received: by mail-qt0-x236.google.com with SMTP id h5-v6so11723073qtm.13; Mon, 25 Jun 2018 05:44:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DpGDAANFeItaqjBmVNhj5xTyltU2NnM6H5rOAOaCg2Q=; b=hwdKyb/PxyPZ9LwwAiu+miH62Vg1ihHxIU/wswOrwgh5/0S6LT1yHqAMCcBSZQmzqP FPV7AZOcjEIXFDMIZRZux1LrZwJfpZLnwGXbskAySeGq6dWYzy7lBD/Cqv7OMx1rcgMO ywN4A6Xt0B+6AkBvNwrI69e3V4WuaHFXeV2fViFgwuBBpL/2Id6yqTsEas2Ue/q8VJ9e iS1XNpNS9npd8hz9cnV2XWsTv/Wr9bQjZ4bgYXW9ITz7+LVY/6GHi9jWRuNLuRb8lUrX aEvPGHzo8estXusy3cV+cv9awevn8PCDZ0jx5fhX3Kv+5lF5d77W4TetESgpXcSOvh2W XD+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=DpGDAANFeItaqjBmVNhj5xTyltU2NnM6H5rOAOaCg2Q=; b=GQo7mDJ3PvnQfaMCasnJAuj7mqNVY6CYW+DRAVUdumfOOq8ee0/zMMWw1qyUsgk2Jp spBRwzox6sVT5sfcJJnwkF/I7dNEjG1qL8eiq7hzqnP8HS5aeVITpVClen+DWqqK8uGL pPZefdYoDWuJ4rUEkhJEA/ukOJM+WVmXajW5kB9zZwTx/0O6+fHefy74mPG9ALM/XLv6 QRkxbIZUD8Samb/EtmthvJBCCqdLGuj9LuPCLDz0K/0+oW48zHJ74IPQyiIs9l6jHKpF /ZbTFOrYfNUvbpIxo+fhmcm7k/oTM4HzgGi+3oNCibKKVt9SFqiGS0riU2MZTYsSGzoa pLzw== X-Gm-Message-State: APt69E2r0bh8mhwlbQ6sWF6HtGSEIuXiPihWQ0eL+VvJhHREGvxGakFh J6ytwKSy11PL2irTW8PNYDw= X-Google-Smtp-Source: ADUXVKJ4ERL9VPn2LPBoAgZIP/SoKQMNwEsz9xrly9qU/ue6brSmD11WdqqrmttqgCTitYH4Nzh4OA== X-Received: by 2002:ac8:2e83:: with SMTP id h3-v6mr10554938qta.365.1529930669986; Mon, 25 Jun 2018 05:44:29 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.44.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:44:29 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil Date: Mon, 25 Jun 2018 09:42:21 -0300 Message-Id: <20180625124238.25339-30-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::236 Subject: [Qemu-devel] [PATCH v5 29/46] hw/mips/r4k: Constify params_size 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: qemu-trivial@nongnu.org, Yongbok Kim , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Aurelien Jarno , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- hw/mips/mips_r4k.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c index e5cf8ed1a3..fc38b4bf99 100644 --- a/hw/mips/mips_r4k.c +++ b/hw/mips/mips_r4k.c @@ -79,8 +79,9 @@ typedef struct ResetData { static int64_t load_kernel(void) { + const size_t params_size = 264; int64_t entry, kernel_high; - long kernel_size, initrd_size, params_size; + long kernel_size, initrd_size; ram_addr_t initrd_offset; uint32_t *params_buf; int big_endian; @@ -128,7 +129,6 @@ static int64_t load_kernel(void) } /* Store command line. */ - params_size = 264; params_buf = g_malloc(params_size); params_buf[0] = tswap32(ram_size); @@ -143,7 +143,7 @@ static int64_t load_kernel(void) } rom_add_blob_fixed("params", params_buf, params_size, - (16 << 20) - 264); + (16 << 20) - params_size); g_free(params_buf); return entry; From patchwork Mon Jun 25 12:42:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934276 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="mQMBAA/5"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41DqBH1T4bz9rvt for ; Mon, 25 Jun 2018 23:04:07 +1000 (AEST) Received: from localhost ([::1]:46750 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXRA4-00015p-QT for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 09:04:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54782) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQrE-0002BT-JQ for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:44:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQrB-00087b-Ia for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:44:36 -0400 Received: from mail-qk0-x235.google.com ([2607:f8b0:400d:c09::235]:33610) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQrB-00087O-Db; Mon, 25 Jun 2018 08:44:33 -0400 Received: by mail-qk0-x235.google.com with SMTP id c131-v6so7371701qkb.0; Mon, 25 Jun 2018 05:44:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4M0caCxGu2A70sPvvaj82hsuFYeC2A74as3zfwEKqvE=; b=mQMBAA/5P8FQ/yrHofXaMirN5Fk6hgELcsJ5uZGqlpIeU7vAE+kYOzpG7EICPfwhLh eFDX19SkQ82q6jkTJTReiiCVzOUdtK6lBYLdXliDpTgtchyPOZe8wbWUkiQYVcBM34t0 UJQIAQp/zQoDM5hg+gc5n1MO5dS9I5dc6lBQhXkGPO3ddgv8L+xKLAoYGCf/cLirilwy jMkyr9dJ9PueGE39bRH5zuZCacZpoWpQZtBvd/1hNzG1ctnp/ZZu+7mfhkVf/yuBR/D6 avvuz5Ih9xSKvty66z4C0Cn01b9A0qBgzOn2erxSBIY5sPPryov1FUCY4WhzOuhR8TeO yGdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=4M0caCxGu2A70sPvvaj82hsuFYeC2A74as3zfwEKqvE=; b=rFW5/pSeVVmdalLLrioox5jQ9cCMOADp3k2hdmYDJ/IaWA+SEWJe+zBJ+lIhpHsmO/ x0CNf8kXTwo8T2Njl93QvLk7K8q2tvSWSUlg7RbveM1ZB5PTg+VzqJdFevQb/XYi/Wck wpDktifcdk2LmF24s57R0VHavnIgYaWugz9SybeSRlT5sDXumKS3XuA6GipczqI29KVF 4hoJRIZCkRBySe7rXjNMw9TTTi3VwYWG+NG/tHHoXkKjPWveNTgnX0UiBw+g8mrB863y lVi2YgvDNQdLb+5DKmiWFcuQAU7hSrzhJTTVgoI0x/t6xrsTIyi1I4wZCkl223PPJJWU E9GA== X-Gm-Message-State: APt69E3cpzhU704CKEJXUFINvG5TyUJr3cTQ2RjzWQVyjj722iuBj06/ O7z48aag7P17AG0aQ+xRCy4= X-Google-Smtp-Source: AAOMgpfjwew3tcbZtchgKakDohp/4CvvM+lrzbqjSOaUqCcwYF/gspMAFZsYSfkV5Hropo3pmKjshg== X-Received: by 2002:ae9:e118:: with SMTP id g24-v6mr9941029qkm.99.1529930672846; Mon, 25 Jun 2018 05:44:32 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.44.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:44:32 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil Date: Mon, 25 Jun 2018 09:42:22 -0300 Message-Id: <20180625124238.25339-31-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::235 Subject: [Qemu-devel] [PATCH v5 30/46] hw/mips: Use the IEC binary prefix definitions 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: qemu-trivial@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Paul Burton , Yongbok Kim , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It eases code review, unit is explicit. Patch generated using: $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/ $ git grep -n '[<>][<>]= ?[1-5]0' and modified manually. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis --- include/hw/intc/mips_gic.h | 3 ++- include/hw/mips/bios.h | 3 ++- hw/mips/mips_fulong2e.c | 7 ++++--- hw/mips/mips_malta.c | 25 ++++++++++++++----------- hw/mips/mips_r4k.c | 11 ++++++----- hw/misc/mips_itu.c | 3 ++- hw/pci-host/xilinx-pcie.c | 5 +++-- 7 files changed, 33 insertions(+), 24 deletions(-) diff --git a/include/hw/intc/mips_gic.h b/include/hw/intc/mips_gic.h index b98d50094a..902a12b178 100644 --- a/include/hw/intc/mips_gic.h +++ b/include/hw/intc/mips_gic.h @@ -11,6 +11,7 @@ #ifndef MIPS_GIC_H #define MIPS_GIC_H +#include "qemu/units.h" #include "hw/timer/mips_gictimer.h" #include "cpu.h" /* @@ -19,7 +20,7 @@ /* The MIPS default location */ #define GIC_BASE_ADDR 0x1bdc0000ULL -#define GIC_ADDRSPACE_SZ (128 * 1024) +#define GIC_ADDRSPACE_SZ (128 * KiB) /* Constants */ #define GIC_POL_POS 1 diff --git a/include/hw/mips/bios.h b/include/hw/mips/bios.h index b4b88ac43d..d67ef33e83 100644 --- a/include/hw/mips/bios.h +++ b/include/hw/mips/bios.h @@ -1,6 +1,7 @@ +#include "qemu/units.h" #include "cpu.h" -#define BIOS_SIZE (4 * 1024 * 1024) +#define BIOS_SIZE (4 * MiB) #ifdef TARGET_WORDS_BIGENDIAN #define BIOS_FILENAME "mips_bios.bin" #else diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c index 02fb2fdcc4..c1694c8254 100644 --- a/hw/mips/mips_fulong2e.c +++ b/hw/mips/mips_fulong2e.c @@ -19,6 +19,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "hw/hw.h" #include "hw/i386/pc.h" @@ -159,7 +160,7 @@ static int64_t load_kernel (CPUMIPSState *env) /* Setup minimum environment variables */ prom_set(prom_buf, index++, "busclock=33000000"); prom_set(prom_buf, index++, "cpuclock=100000000"); - prom_set(prom_buf, index++, "memsize=%i", loaderparams.ram_size/1024/1024); + prom_set(prom_buf, index++, "memsize=%"PRIi64, loaderparams.ram_size / MiB); prom_set(prom_buf, index++, "modetty0=38400n8r"); prom_set(prom_buf, index++, NULL); @@ -303,10 +304,10 @@ static void mips_fulong2e_init(MachineState *machine) qemu_register_reset(main_cpu_reset, cpu); /* fulong 2e has 256M ram. */ - ram_size = 256 * 1024 * 1024; + ram_size = 256 * MiB; /* fulong 2e has a 1M flash.Winbond W39L040AP70Z */ - bios_size = 1024 * 1024; + bios_size = 1 * MiB; /* allocate RAM */ memory_region_allocate_system_memory(ram, NULL, "fulong2e.ram", ram_size); diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 494f84e290..010001a0bf 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -23,6 +23,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qemu-common.h" #include "cpu.h" #include "hw/hw.h" @@ -191,7 +192,7 @@ static void generate_eeprom_spd(uint8_t *eeprom, ram_addr_t ram_size) int i; /* work in terms of MB */ - ram_size >>= 20; + ram_size /= MiB; while ((ram_size >= 4) && (nbanks <= 2)) { int sz_log2 = MIN(31 - clz32(ram_size), 14); @@ -843,7 +844,8 @@ static int64_t load_kernel (void) /* The kernel allocates the bootmap memory in the low memory after the initrd. It takes at most 128kiB for 2GB RAM and 4kiB pages. */ - initrd_offset = (loaderparams.ram_low_size - initrd_size - 131072 + initrd_offset = (loaderparams.ram_low_size - initrd_size + - (128 * KiB) - ~INITRD_PAGE_MASK) & INITRD_PAGE_MASK; if (kernel_high >= initrd_offset) { error_report("memory too small for initial ram disk '%s'", @@ -1021,9 +1023,9 @@ void mips_malta_init(MachineState *machine) mips_create_cpu(s, machine->cpu_type, &cbus_irq, &i8259_irq); /* allocate RAM */ - if (ram_size > (2048u << 20)) { - error_report("Too much memory for this machine: %dMB, maximum 2048MB", - ((unsigned int)ram_size / (1 << 20))); + if (ram_size > 2 * GiB) { + error_report("Too much memory for this machine: %" PRId64 "MB," + " maximum 2048MB", ram_size / MiB); exit(1); } @@ -1034,17 +1036,18 @@ void mips_malta_init(MachineState *machine) /* alias for pre IO hole access */ memory_region_init_alias(ram_low_preio, NULL, "mips_malta_low_preio.ram", - ram_high, 0, MIN(ram_size, (256 << 20))); + ram_high, 0, MIN(ram_size, 256 * MiB)); memory_region_add_subregion(system_memory, 0, ram_low_preio); /* alias for post IO hole access, if there is enough RAM */ - if (ram_size > (512 << 20)) { + if (ram_size > 512 * MiB) { ram_low_postio = g_new(MemoryRegion, 1); memory_region_init_alias(ram_low_postio, NULL, "mips_malta_low_postio.ram", - ram_high, 512 << 20, - ram_size - (512 << 20)); - memory_region_add_subregion(system_memory, 512 << 20, ram_low_postio); + ram_high, 512 * MiB, + ram_size - 512 * MiB); + memory_region_add_subregion(system_memory, 512 * MiB, + ram_low_postio); } #ifdef TARGET_WORDS_BIGENDIAN @@ -1076,7 +1079,7 @@ void mips_malta_init(MachineState *machine) bios = pflash_cfi01_get_memory(fl); fl_idx++; if (kernel_filename) { - ram_low_size = MIN(ram_size, 256 << 20); + ram_low_size = MIN(ram_size, 256 * MiB); /* For KVM we reserve 1MB of RAM for running bootloader */ if (kvm_enabled()) { ram_low_size -= 0x100000; diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c index fc38b4bf99..d5725d0555 100644 --- a/hw/mips/mips_r4k.c +++ b/hw/mips/mips_r4k.c @@ -8,6 +8,7 @@ * the standard PC ISA addresses. */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" @@ -143,7 +144,7 @@ static int64_t load_kernel(void) } rom_add_blob_fixed("params", params_buf, params_size, - (16 << 20) - params_size); + 16 * MiB - params_size); g_free(params_buf); return entry; @@ -158,7 +159,7 @@ static void main_cpu_reset(void *opaque) env->active_tc.PC = s->vector; } -static const int sector_len = 32 * 1024; +static const int sector_len = 32 * KiB; static void mips_r4k_init(MachineState *machine) { @@ -194,9 +195,9 @@ void mips_r4k_init(MachineState *machine) qemu_register_reset(main_cpu_reset, reset_info); /* allocate RAM */ - if (ram_size > (256 << 20)) { - error_report("Too much memory for this machine: %dMB, maximum 256MB", - ((unsigned int)ram_size / (1 << 20))); + if (ram_size > 256 * MiB) { + error_report("Too much memory for this machine: %" PRId64 "MB," + " maximum 256MB", ram_size / MiB); exit(1); } memory_region_allocate_system_memory(ram, NULL, "mips_r4k.ram", ram_size); diff --git a/hw/misc/mips_itu.c b/hw/misc/mips_itu.c index ccc4c7d98a..43bbec46cf 100644 --- a/hw/misc/mips_itu.c +++ b/hw/misc/mips_itu.c @@ -18,6 +18,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qemu/log.h" #include "qapi/error.h" #include "cpu.h" @@ -80,7 +81,7 @@ static void itc_reconfigure(MIPSITUState *tag) uint64_t *am = &tag->ITCAddressMap[0]; MemoryRegion *mr = &tag->storage_io; hwaddr address = am[0] & ITC_AM0_BASE_ADDRESS_MASK; - uint64_t size = (1 << 10) + (am[1] & ITC_AM1_ADDR_MASK_MASK); + uint64_t size = (1 * KiB) + (am[1] & ITC_AM1_ADDR_MASK_MASK); bool is_enabled = (am[0] & ITC_AM0_EN_MASK) != 0; memory_region_transaction_begin(); diff --git a/hw/pci-host/xilinx-pcie.c b/hw/pci-host/xilinx-pcie.c index 044e312dc1..ff0cf38156 100644 --- a/hw/pci-host/xilinx-pcie.c +++ b/hw/pci-host/xilinx-pcie.c @@ -18,6 +18,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "hw/pci/pci_bridge.h" #include "hw/pci-host/xilinx-pcie.h" @@ -158,9 +159,9 @@ static void xilinx_pcie_host_init(Object *obj) static Property xilinx_pcie_host_props[] = { DEFINE_PROP_UINT32("bus_nr", XilinxPCIEHost, bus_nr, 0), DEFINE_PROP_SIZE("cfg_base", XilinxPCIEHost, cfg_base, 0), - DEFINE_PROP_SIZE("cfg_size", XilinxPCIEHost, cfg_size, 32 << 20), + DEFINE_PROP_SIZE("cfg_size", XilinxPCIEHost, cfg_size, 32 * MiB), DEFINE_PROP_SIZE("mmio_base", XilinxPCIEHost, mmio_base, 0), - DEFINE_PROP_SIZE("mmio_size", XilinxPCIEHost, mmio_size, 1 << 20), + DEFINE_PROP_SIZE("mmio_size", XilinxPCIEHost, mmio_size, 1 * MiB), DEFINE_PROP_BOOL("link_up", XilinxPCIEHost, link_up, true), DEFINE_PROP_END_OF_LIST(), }; From patchwork Mon Jun 25 12:42:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934280 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="lg5+nMZW"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41DqFW2z1Mz9rvt for ; Mon, 25 Jun 2018 23:06:55 +1000 (AEST) Received: from localhost ([::1]:46774 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXRCn-0003HJ-46 for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 09:06:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54852) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQrN-0002KF-7x for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:44:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQrK-0008Af-Ow for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:44:45 -0400 Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]:33114) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQrK-0008AS-I1; Mon, 25 Jun 2018 08:44:42 -0400 Received: by mail-qt0-x243.google.com with SMTP id l10-v6so11767538qtj.0; Mon, 25 Jun 2018 05:44:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AQSf+SgqPbtXXQJ8tJJNF5OBAvAGjGM62qQyfslxu+k=; b=lg5+nMZWe9qRCIj7fk7TOTlqzqCDVlbzW6TPaHKmOspSRAUej3W1C35yp5jaisTpeZ WM8V1qRm9th8g6ixE0HoTqF0T9NLYNj5q2qAfgxIS3chI3z7Na46i2IW9Ff/EKB+Xk9e mCHZy2kV2bEhVynI1vni4aVqtwByq7zmm68z5BFrJS5Aaoo6f/lwCocJMOZnjlKcYIKZ gMR9a2SKkYbgJnBvSn3Jb7+UldYtdCcGCrNW+QWv2ayBsJ/POTYsV7XkRlA0k8GWN+wm HyQDk+O8Ag49A8s+1llvUwk+TVrZdtE1qiK52F9x7J4jZaNAM0wZRSXpGH4U1y2OmQti hwZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=AQSf+SgqPbtXXQJ8tJJNF5OBAvAGjGM62qQyfslxu+k=; b=Be19ET6hW/ZkHCOunXtPka+GnjJZHNF3F7YqB35I//MvNo26+Q5/7//boznOjxlAo7 /knPG6O1GTGjBj7cvOb6nKI9f5hm4Lv2amV2S4KJ2upEvqvDCmHZ43KSM61q2cqGjq/R TuAGWYTFpsHjmBpw8bUqT5abYEcqnlglWmzepAYUSotRnWKFdZOlqEWLypUySzWb0uaO pFQQx1bjTlMRtu+v+j8Sqmj/LZSdNkvCWh+dWwvAJ80VVsaA7Wslpg6DTL7yZUxZOWGd A3bcYnqO8hq5yCq3aislpPBwvnn+PaemeFLWMz8ddc+eeA0tt/7np73YEOSS+x5AGs/R V4IA== X-Gm-Message-State: APt69E2FOKYiGdqzuzmNZaAF7ZXsLZTfArSBBYZqgUyoLWcX/mOLjzdL 9syVSnf3w3PGX3IAm/EH6po= X-Google-Smtp-Source: AAOMgpdYVUnHrw6g4YFLU0xBKGqw33dq1AVQUlhq0WIXHv3x6rXxEJEnQCQnAkaPtd/C2kXTlb/yVA== X-Received: by 2002:aed:3cae:: with SMTP id d43-v6mr4831550qtf.379.1529930681751; Mon, 25 Jun 2018 05:44:41 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.44.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:44:41 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil Date: Mon, 25 Jun 2018 09:42:24 -0300 Message-Id: <20180625124238.25339-33-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::243 Subject: [Qemu-devel] [PATCH v5 32/46] hw/ppc: Use the IEC binary prefix definitions 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: "open list:sPAPR" , qemu-devel@nongnu.org, qemu-trivial@nongnu.org, Alexander Graf , =?utf-8?q?Ph?= =?utf-8?q?ilippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Herv=C3=A9_Poussineau?= , "Edgar E. Iglesias" , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It eases code review, unit is explicit. Patch generated using: $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/ and modified manually. Signed-off-by: Philippe Mathieu-Daudé Acked-by: David Gibson --- hw/ppc/mac.h | 3 ++- include/hw/ppc/spapr.h | 5 +++-- hw/nvram/spapr_nvram.c | 11 +++++++---- hw/pci-host/prep.c | 3 ++- hw/ppc/e500.c | 13 +++++++------ hw/ppc/e500plat.c | 3 ++- hw/ppc/mac_newworld.c | 1 - hw/ppc/mac_oldworld.c | 9 ++++----- hw/ppc/ppc405_boards.c | 9 +++++---- hw/ppc/ppc405_uc.c | 7 ++++--- hw/ppc/ppc440_bamboo.c | 5 +++-- hw/ppc/ppc4xx_devs.c | 22 ++++++++++++---------- hw/ppc/ppce500_spin.c | 3 ++- hw/ppc/prep.c | 4 ++-- hw/ppc/rs6000_mc.c | 13 +++++++------ hw/ppc/sam460ex.c | 14 +++++++------- hw/ppc/spapr.c | 2 +- hw/ppc/virtex_ml507.c | 7 ++++--- 18 files changed, 74 insertions(+), 60 deletions(-) diff --git a/hw/ppc/mac.h b/hw/ppc/mac.h index c0217e66f2..41fd289e81 100644 --- a/hw/ppc/mac.h +++ b/hw/ppc/mac.h @@ -26,6 +26,7 @@ #ifndef PPC_MAC_H #define PPC_MAC_H +#include "qemu/units.h" #include "exec/memory.h" #include "hw/boards.h" #include "hw/sysbus.h" @@ -38,7 +39,7 @@ /* SMP is not enabled, for now */ #define MAX_CPUS 1 -#define BIOS_SIZE (1024 * 1024) +#define BIOS_SIZE (1 * MiB) #define NVRAM_SIZE 0x2000 #define PROM_FILENAME "openbios-ppc" #define PROM_ADDR 0xfff00000 diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index 7e028164ba..7e5de1a6fd 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -1,6 +1,7 @@ #ifndef HW_SPAPR_H #define HW_SPAPR_H +#include "qemu/units.h" #include "sysemu/dma.h" #include "hw/boards.h" #include "hw/ppc/xics.h" @@ -749,8 +750,8 @@ int spapr_rng_populate_dt(void *fdt); */ #define SPAPR_MAX_RAM_SLOTS 32 -/* 1GB alignment for device memory region */ -#define SPAPR_DEVICE_MEM_ALIGN (1ULL << 30) +/* 1GB alignment for hotplug memory region */ +#define SPAPR_DEVICE_MEM_ALIGN (1 * GiB) /* * Number of 32 bit words in each LMB list entry in ibm,dynamic-memory diff --git a/hw/nvram/spapr_nvram.c b/hw/nvram/spapr_nvram.c index 4a0aec8e1d..bed1557d83 100644 --- a/hw/nvram/spapr_nvram.c +++ b/hw/nvram/spapr_nvram.c @@ -23,6 +23,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" @@ -47,9 +48,9 @@ typedef struct sPAPRNVRAM { #define VIO_SPAPR_NVRAM(obj) \ OBJECT_CHECK(sPAPRNVRAM, (obj), TYPE_VIO_SPAPR_NVRAM) -#define MIN_NVRAM_SIZE 8192 -#define DEFAULT_NVRAM_SIZE 65536 -#define MAX_NVRAM_SIZE 1048576 +#define MIN_NVRAM_SIZE (8 * KiB) +#define DEFAULT_NVRAM_SIZE (64 * KiB) +#define MAX_NVRAM_SIZE (1 * MiB) static void rtas_nvram_fetch(PowerPCCPU *cpu, sPAPRMachineState *spapr, uint32_t token, uint32_t nargs, @@ -167,7 +168,9 @@ static void spapr_nvram_realize(VIOsPAPRDevice *dev, Error **errp) nvram->buf = g_malloc0(nvram->size); if ((nvram->size < MIN_NVRAM_SIZE) || (nvram->size > MAX_NVRAM_SIZE)) { - error_setg(errp, "spapr-nvram must be between %d and %d bytes in size", + error_setg(errp, + "spapr-nvram must be between %" PRId64 + " and %" PRId64 " bytes in size", MIN_NVRAM_SIZE, MAX_NVRAM_SIZE); return; } diff --git a/hw/pci-host/prep.c b/hw/pci-host/prep.c index 01f67f9db1..88f035c20b 100644 --- a/hw/pci-host/prep.c +++ b/hw/pci-host/prep.c @@ -24,6 +24,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "hw/hw.h" #include "hw/pci/pci.h" @@ -70,7 +71,7 @@ typedef struct PRePPCIState { int contiguous_map; } PREPPCIState; -#define BIOS_SIZE (1024 * 1024) +#define BIOS_SIZE (1 * MiB) static inline uint32_t raven_pci_io_config(hwaddr addr) { diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index 826053edc8..7d19b1498c 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -15,6 +15,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "e500.h" #include "e500-ccsr.h" @@ -46,11 +47,11 @@ #define BINARY_DEVICE_TREE_FILE "mpc8544ds.dtb" #define DTC_LOAD_PAD 0x1800000 #define DTC_PAD_MASK 0xFFFFF -#define DTB_MAX_SIZE (8 * 1024 * 1024) +#define DTB_MAX_SIZE (8 * MiB) #define INITRD_LOAD_PAD 0x2000000 #define INITRD_PAD_MASK 0xFFFFFF -#define RAM_SIZES_ALIGN (64UL << 20) +#define RAM_SIZES_ALIGN (64 * MiB) /* TODO: parameterize */ #define MPC8544_CCSRBAR_SIZE 0x00100000ULL @@ -603,7 +604,7 @@ static int ppce500_prep_device_tree(PPCE500MachineState *machine, /* Create -kernel TLB entries for BookE. */ hwaddr booke206_page_size_to_tlb(uint64_t size) { - return 63 - clz64(size >> 10); + return 63 - clz64(size / KiB); } static int booke206_initial_map_tsize(CPUPPCState *env) @@ -671,7 +672,7 @@ static void ppce500_cpu_reset(void *opaque) /* Set initial guest state. */ cs->halted = 0; - env->gpr[1] = (16<<20) - 8; + env->gpr[1] = (16 * MiB) - 8; env->gpr[3] = bi->dt_base; env->gpr[4] = 0; env->gpr[5] = 0; @@ -1012,9 +1013,9 @@ void ppce500_init(MachineState *machine) } cur_base = loadaddr + payload_size; - if (cur_base < (32 * 1024 * 1024)) { + if (cur_base < 32 * MiB) { /* u-boot occupies memory up to 32MB, so load blobs above */ - cur_base = (32 * 1024 * 1024); + cur_base = 32 * MiB; } /* Load bare kernel only if no bios/u-boot has been provided */ diff --git a/hw/ppc/e500plat.c b/hw/ppc/e500plat.c index d8e3f2066e..963d429cc8 100644 --- a/hw/ppc/e500plat.c +++ b/hw/ppc/e500plat.c @@ -10,6 +10,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qemu-common.h" #include "e500.h" #include "hw/net/fsl_etsec/etsec.h" @@ -85,7 +86,7 @@ static void e500plat_machine_class_init(ObjectClass *oc, void *data) pmc->has_mpc8xxx_gpio = true; pmc->has_platform_bus = true; pmc->platform_bus_base = 0xf00000000ULL; - pmc->platform_bus_size = (128ULL * 1024 * 1024); + pmc->platform_bus_size = 128 * MiB; pmc->platform_bus_first_irq = 5; pmc->platform_bus_num_irqs = 10; pmc->ccsrbar_base = 0xFE0000000ULL; diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index ff715ffffd..84355b2672 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -71,7 +71,6 @@ #include "hw/usb.h" #include "exec/address-spaces.h" #include "hw/sysbus.h" -#include "qemu/cutils.h" #include "trace.h" #define MAX_IDE_BUS 2 diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index 4608bab014..06ed6f660e 100644 --- a/hw/ppc/mac_oldworld.c +++ b/hw/ppc/mac_oldworld.c @@ -24,6 +24,7 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "hw/hw.h" #include "hw/ppc/ppc.h" @@ -46,7 +47,6 @@ #include "sysemu/kvm.h" #include "kvm_ppc.h" #include "exec/address-spaces.h" -#include "qemu/cutils.h" #define MAX_IDE_BUS 2 #define CFG_ADDR 0xf0000510 @@ -118,10 +118,9 @@ static void ppc_heathrow_init(MachineState *machine) } /* allocate RAM */ - if (ram_size > (2047 << 20)) { - fprintf(stderr, - "qemu: Too much memory for this machine: %d MB, maximum 2047 MB\n", - ((unsigned int)ram_size / (1 << 20))); + if (ram_size > 2047 * MiB) { + error_report("Too much memory for this machine: %" PRId64 " MB, " + "maximum 2047 MB", ram_size / MiB); exit(1); } diff --git a/hw/ppc/ppc405_boards.c b/hw/ppc/ppc405_boards.c index d301067d3b..70111075b3 100644 --- a/hw/ppc/ppc405_boards.c +++ b/hw/ppc/ppc405_boards.c @@ -22,6 +22,7 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" @@ -40,7 +41,7 @@ #include "exec/address-spaces.h" #define BIOS_FILENAME "ppc405_rom.bin" -#define BIOS_SIZE (2048 * 1024) +#define BIOS_SIZE (2 * MiB) #define KERNEL_LOAD_ADDR 0x00000000 #define INITRD_LOAD_ADDR 0x01800000 @@ -216,14 +217,14 @@ static void ref405ep_init(MachineState *machine) memory_region_init(&ram_memories[1], NULL, "ef405ep.ram1", 0); ram_bases[1] = 0x00000000; ram_sizes[1] = 0x00000000; - ram_size = 128 * 1024 * 1024; + ram_size = 128 * MiB; #ifdef DEBUG_BOARD_INIT printf("%s: register cpu\n", __func__); #endif env = ppc405ep_init(sysmem, ram_memories, ram_bases, ram_sizes, 33333333, &pic, kernel_filename == NULL ? 0 : 1); /* allocate SRAM */ - sram_size = 512 * 1024; + sram_size = 512 * KiB; memory_region_init_ram(sram, NULL, "ef405ep.sram", sram_size, &error_fatal); memory_region_add_subregion(sysmem, 0xFFF00000, sram); @@ -589,7 +590,7 @@ static void taihu_405ep_init(MachineState *machine) bios_size = blk_getlength(blk); /* XXX: should check that size is 32MB */ - bios_size = 32 * 1024 * 1024; + bios_size = 32 * MiB; fl_sectors = (bios_size + 65535) >> 16; #ifdef DEBUG_BOARD_INIT printf("Register parallel flash %d size %lx" diff --git a/hw/ppc/ppc405_uc.c b/hw/ppc/ppc405_uc.c index 34f8d57b07..4bd9fbcc1e 100644 --- a/hw/ppc/ppc405_uc.c +++ b/hw/ppc/ppc405_uc.c @@ -22,6 +22,7 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" @@ -983,10 +984,10 @@ static void ppc405_ocm_init(CPUPPCState *env) ocm = g_malloc0(sizeof(ppc405_ocm_t)); /* XXX: Size is 4096 or 0x04000000 */ - memory_region_init_ram(&ocm->isarc_ram, NULL, "ppc405.ocm", 4096, + memory_region_init_ram(&ocm->isarc_ram, NULL, "ppc405.ocm", 4 * KiB, &error_fatal); - memory_region_init_alias(&ocm->dsarc_ram, NULL, "ppc405.dsarc", &ocm->isarc_ram, - 0, 4096); + memory_region_init_alias(&ocm->dsarc_ram, NULL, "ppc405.dsarc", + &ocm->isarc_ram, 0, 4 * KiB); qemu_register_reset(&ocm_reset, ocm); ppc_dcr_register(env, OCM0_ISARC, ocm, &dcr_read_ocm, &dcr_write_ocm); diff --git a/hw/ppc/ppc440_bamboo.c b/hw/ppc/ppc440_bamboo.c index 44e6a0c21b..3d4c43b8cc 100644 --- a/hw/ppc/ppc440_bamboo.c +++ b/hw/ppc/ppc440_bamboo.c @@ -12,6 +12,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qemu/error-report.h" #include "qemu-common.h" #include "qemu/error-report.h" @@ -49,7 +50,7 @@ #define PPC440EP_SDRAM_NR_BANKS 4 static const unsigned int ppc440ep_sdram_bank_sizes[] = { - 256<<20, 128<<20, 64<<20, 32<<20, 16<<20, 8<<20, 0 + 256 * MiB, 128 * MiB, 64 * MiB, 32 * MiB, 16 * MiB, 8 * MiB, 0 }; static hwaddr entry; @@ -151,7 +152,7 @@ static void main_cpu_reset(void *opaque) CPUPPCState *env = &cpu->env; cpu_reset(CPU(cpu)); - env->gpr[1] = (16<<20) - 8; + env->gpr[1] = (16 * MiB) - 8; env->gpr[3] = FDT_ADDR; env->nip = entry; diff --git a/hw/ppc/ppc4xx_devs.c b/hw/ppc/ppc4xx_devs.c index 2e963894fe..8c6f3c9577 100644 --- a/hw/ppc/ppc4xx_devs.c +++ b/hw/ppc/ppc4xx_devs.c @@ -22,6 +22,7 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "cpu.h" #include "hw/hw.h" #include "hw/ppc/ppc.h" @@ -29,6 +30,7 @@ #include "hw/boards.h" #include "qemu/log.h" #include "exec/address-spaces.h" +#include "qemu/error-report.h" #define DEBUG_UIC @@ -353,25 +355,25 @@ static uint32_t sdram_bcr (hwaddr ram_base, uint32_t bcr; switch (ram_size) { - case (4 * 1024 * 1024): + case 4 * MiB: bcr = 0x00000000; break; - case (8 * 1024 * 1024): + case 8 * MiB: bcr = 0x00020000; break; - case (16 * 1024 * 1024): + case 16 * MiB: bcr = 0x00040000; break; - case (32 * 1024 * 1024): + case 32 * MiB: bcr = 0x00060000; break; - case (64 * 1024 * 1024): + case 64 * MiB: bcr = 0x00080000; break; - case (128 * 1024 * 1024): + case 128 * MiB: bcr = 0x000A0000; break; - case (256 * 1024 * 1024): + case 256 * MiB: bcr = 0x000C0000; break; default: @@ -399,7 +401,7 @@ static target_ulong sdram_size (uint32_t bcr) if (sh == 7) size = -1; else - size = (4 * 1024 * 1024) << sh; + size = (4 * MiB) << sh; return size; } @@ -702,8 +704,8 @@ ram_addr_t ppc4xx_sdram_adjust(ram_addr_t ram_size, int nr_banks, ram_size -= size_left; if (size_left) { - printf("Truncating memory to %d MiB to fit SDRAM controller limits.\n", - (int)(ram_size >> 20)); + error_report("Truncating memory to %" PRId64 " MiB to fit SDRAM" + " controller limits", ram_size / MiB); } memory_region_allocate_system_memory(ram, NULL, "ppc4xx.sdram", ram_size); diff --git a/hw/ppc/ppce500_spin.c b/hw/ppc/ppce500_spin.c index 69ca2d0e42..c45fc858de 100644 --- a/hw/ppc/ppce500_spin.c +++ b/hw/ppc/ppce500_spin.c @@ -28,6 +28,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "hw/hw.h" #include "hw/sysbus.h" #include "sysemu/hw_accel.h" @@ -89,7 +90,7 @@ static void spin_kick(CPUState *cs, run_on_cpu_data data) PowerPCCPU *cpu = POWERPC_CPU(cs); CPUPPCState *env = &cpu->env; SpinInfo *curspin = data.host_ptr; - hwaddr map_size = 64 * 1024 * 1024; + hwaddr map_size = 64 * MiB; hwaddr map_start; cpu_synchronize_state(cs); diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index 25ae53304c..6689407b3d 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -50,7 +50,7 @@ #include "exec/address-spaces.h" #include "trace.h" #include "elf.h" -#include "qemu/cutils.h" +#include "qemu/units.h" #include "kvm_ppc.h" /* SMP is not enabled, for now */ @@ -60,7 +60,7 @@ #define CFG_ADDR 0xf0000510 -#define BIOS_SIZE (1024 * 1024) +#define BIOS_SIZE (1 * MiB) #define BIOS_FILENAME "ppc_rom.bin" #define KERNEL_LOAD_ADDR 0x01000000 #define INITRD_LOAD_ADDR 0x01800000 diff --git a/hw/ppc/rs6000_mc.c b/hw/ppc/rs6000_mc.c index b6135650bd..45cb95e08a 100644 --- a/hw/ppc/rs6000_mc.c +++ b/hw/ppc/rs6000_mc.c @@ -18,6 +18,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "hw/isa/isa.h" #include "exec/address-spaces.h" #include "hw/boards.h" @@ -109,7 +110,7 @@ static void rs6000mc_port0820_write(void *opaque, uint32_t addr, uint32_t val) size = end_address - start_address; memory_region_set_enabled(&s->simm[socket - 1], size != 0); memory_region_set_address(&s->simm[socket - 1], - start_address * 8 * 1024 * 1024); + start_address * 8 * MiB); } } } @@ -140,7 +141,7 @@ static void rs6000mc_realize(DeviceState *dev, Error **errp) { RS6000MCState *s = RS6000MC_DEVICE(dev); int socket = 0; - unsigned int ram_size = s->ram_size / (1024 * 1024); + unsigned int ram_size = s->ram_size / MiB; while (socket < 6) { if (ram_size >= 64) { @@ -163,8 +164,8 @@ static void rs6000mc_realize(DeviceState *dev, Error **errp) char name[] = "simm.?"; name[5] = socket + '0'; memory_region_allocate_system_memory(&s->simm[socket], OBJECT(dev), - name, s->simm_size[socket] - * 1024 * 1024); + name, + s->simm_size[socket] * MiB); memory_region_add_subregion_overlap(get_system_memory(), 0, &s->simm[socket], socket); } @@ -172,8 +173,8 @@ static void rs6000mc_realize(DeviceState *dev, Error **errp) if (ram_size) { /* unable to push all requested RAM in SIMMs */ error_setg(errp, "RAM size incompatible with this board. " - "Try again with something else, like %d MB", - s->ram_size / 1024 / 1024 - ram_size); + "Try again with something else, like %" PRId64 " MB", + s->ram_size / MiB - ram_size); return; } diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c index 2a98c10664..ffe561fbc1 100644 --- a/hw/ppc/sam460ex.c +++ b/hw/ppc/sam460ex.c @@ -12,8 +12,8 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qemu-common.h" -#include "qemu/cutils.h" #include "qemu/error-report.h" #include "qapi/error.h" #include "hw/hw.h" @@ -46,7 +46,7 @@ /* from Sam460 U-Boot include/configs/Sam460ex.h */ #define FLASH_BASE 0xfff00000 #define FLASH_BASE_H 0x4 -#define FLASH_SIZE (1 << 20) +#define FLASH_SIZE (1 * MiB) #define UBOOT_LOAD_BASE 0xfff80000 #define UBOOT_SIZE 0x00080000 #define UBOOT_ENTRY 0xfffffffc @@ -71,7 +71,7 @@ /* FIXME: See u-boot.git 8ac41e, also fix in ppc440_uc.c */ static const unsigned int ppc460ex_sdram_bank_sizes[] = { - 1024 << 20, 512 << 20, 256 << 20, 128 << 20, 64 << 20, 32 << 20, 0 + 1 * GiB, 512 * MiB, 256 * MiB, 128 * MiB, 64 * MiB, 32 * MiB, 0 }; struct boot_info { @@ -225,7 +225,7 @@ static int sam460ex_load_uboot(void) fl_sectors = (bios_size + 65535) >> 16; if (!pflash_cfi01_register(base, NULL, "sam460ex.flash", bios_size, - blk, (64 * 1024), fl_sectors, + blk, 64 * KiB, fl_sectors, 1, 0x89, 0x18, 0x0000, 0x0, 1)) { error_report("qemu: Error registering flash memory."); /* XXX: return an error instead? */ @@ -359,14 +359,14 @@ static void main_cpu_reset(void *opaque) /* either we have a kernel to boot or we jump to U-Boot */ if (bi->entry != UBOOT_ENTRY) { - env->gpr[1] = (16 << 20) - 8; + env->gpr[1] = (16 * MiB) - 8; env->gpr[3] = FDT_ADDR; env->nip = bi->entry; /* Create a mapping for the kernel. */ mmubooke_create_initial_mapping(env, 0, 0); env->gpr[6] = tswap32(EPAPR_MAGIC); - env->gpr[7] = (16 << 20) - 8; /*bi->ima_size;*/ + env->gpr[7] = (16 * MiB) - 8; /* bi->ima_size; */ } else { env->nip = UBOOT_ENTRY; @@ -479,7 +479,7 @@ static void sam460ex_init(MachineState *machine) /* 256K of L2 cache as memory */ ppc4xx_l2sram_init(env); /* FIXME: remove this after fixing l2sram mapping in ppc440_uc.c? */ - memory_region_init_ram(l2cache_ram, NULL, "ppc440.l2cache_ram", 256 << 10, + memory_region_init_ram(l2cache_ram, NULL, "ppc440.l2cache_ram", 256 * KiB, &error_abort); memory_region_add_subregion(address_space_mem, 0x400000000LL, l2cache_ram); diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 6a2d8fcef0..d0390b35a0 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -2763,7 +2763,7 @@ static void spapr_machine_init(MachineState *machine) } } - if (spapr->rma_size < (MIN_RMA_SLOF << 20)) { + if (spapr->rma_size < (MIN_RMA_SLOF * MiB)) { error_report( "pSeries SLOF firmware requires >= %ldM guest RMA (Real Mode Area memory)", MIN_RMA_SLOF); diff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/virtex_ml507.c index b4bb90d50b..7891464cd9 100644 --- a/hw/ppc/virtex_ml507.c +++ b/hw/ppc/virtex_ml507.c @@ -23,6 +23,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "cpu.h" #include "hw/sysbus.h" #include "hw/hw.h" @@ -45,7 +46,7 @@ #include "ppc405.h" #define EPAPR_MAGIC (0x45504150) -#define FLASH_SIZE (16 * 1024 * 1024) +#define FLASH_SIZE (16 * MiB) #define INTC_BASEADDR 0x81800000 #define UART16550_BASEADDR 0x83e01003 @@ -127,7 +128,7 @@ static void main_cpu_reset(void *opaque) * r8: 0 * r9: 0 */ - env->gpr[1] = (16<<20) - 8; + env->gpr[1] = (16 * MiB) - 8; /* Provide a device-tree. */ env->gpr[3] = bi->fdt; env->nip = bi->bootstrap_pc; @@ -235,7 +236,7 @@ static void virtex_init(MachineState *machine) dinfo = drive_get(IF_PFLASH, 0, 0); pflash_cfi01_register(PFLASH_BASEADDR, NULL, "virtex.flash", FLASH_SIZE, dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, - (64 * 1024), FLASH_SIZE >> 16, + 64 * KiB, FLASH_SIZE >> 16, 1, 0x89, 0x18, 0x0000, 0x0, 1); cpu_irq = (qemu_irq *) &env->irq_inputs[PPC40x_INPUT_INT]; From patchwork Mon Jun 25 12:42:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934285 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="URoj+HCV"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41DqPQ38lyz9rvt for ; Mon, 25 Jun 2018 23:13:46 +1000 (AEST) Received: from localhost ([::1]:46816 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXRJP-0008PE-Vy for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 09:13:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54909) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQrS-0002Mb-Mj for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:44:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQrR-0008Cj-Jx for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:44:50 -0400 Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]:34661) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQrR-0008Cd-GC; Mon, 25 Jun 2018 08:44:49 -0400 Received: by mail-qt0-x243.google.com with SMTP id b20-v6so2518514qtp.1; Mon, 25 Jun 2018 05:44:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nl2wVyf/XTBmtPMPKkI5KWvauM3qwdoQuOM0UX7Duls=; b=URoj+HCV/GcUi4DYr6pQk0+HAshKJdvcdO/TwhNxMo9dgdkegMbfMbGxlbZm0lpEwW 2k1MNzmqZYY48i9QEIpq3r/oGImVwnpbgZjqLIzk9Z2N8NIgy3mECvBcu2hrxcUAZX0E IVni7rz5b/zUx84GPCV8mCtNsFAWBJFthmB2/WxppBH+nINvjZHoXf78z6zynft3duTT 7kg7XUit4/FRswohAIVGdVYkxWNxSdvNTiwxEAw7XZUwcSnOjiHnzNunIZGKxOawQnXO Tb1iU5mhI99r7ufEb6frQcwCrJeMNFLZwJqUWnJgQ3JchFl9PqsyD7HkPR4JZb5zDI0Z usiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=nl2wVyf/XTBmtPMPKkI5KWvauM3qwdoQuOM0UX7Duls=; b=ArtK2jo5Ic2WOlejkjROFtAszz96uHrv1i4BKYxH3bti9OfuU4tiD6wcpkXq4SN2Dr ioM5ZSDkjoSfxIcFCy5TW9Z0ZF8lrCmU26a4bZ+bzdBGIz2VZCyQn/HeE1//woNFUVkF 12424itu2pEIVOIMxsWOaaN6/1jJlQYSIQJVxaOsvW0hgxqWvQT6TubTPvHJz7LpNkN3 NiWTGd3rcfkXe7N70s3piT/+RPdmwxljg1onA4wn8ZOnJplA17jx6W5g/pBu1lD6JFf9 jqlwGDkU9maHPa5GI0kPPvW3EJdTbjmEaosGHB4bjMTfF0JoXrB/eQOUJ1NYdCoo8ht0 EvTg== X-Gm-Message-State: APt69E1E9LRVoF9ppI6S8hxYbu9X14p1ICUevu1R0mdbayedda8SzKQR LwlvzWpXVWjKKPQxjVoVWrU= X-Google-Smtp-Source: AAOMgpczFUMzhbmkCUlChOePj5Z4OSrjbh3D2Id16IWWpC4/h0waavwdjI8oH/McAw6floQ4jZ6jIA== X-Received: by 2002:a0c:a063:: with SMTP id b90-v6mr10714537qva.115.1529930688984; Mon, 25 Jun 2018 05:44:48 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.44.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:44:48 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil Date: Mon, 25 Jun 2018 09:42:26 -0300 Message-Id: <20180625124238.25339-35-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::243 Subject: [Qemu-devel] [PATCH v5 34/46] hw/net: Use the IEC binary prefix definitions 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: Dmitry Fleytman , qemu-trivial@nongnu.org, Jason Wang , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , qemu-devel@nongnu.org, Beniamino Galvani , "open list:Allwinner-a10" Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It eases code review, unit is explicit. Patch generated using: $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/ and modified manually. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Weil --- hw/net/ne2000.h | 5 +++-- include/hw/net/allwinner_emac.h | 5 +++-- hw/net/e1000e.c | 7 ++++--- hw/net/e1000x_common.c | 3 ++- hw/net/eepro100.c | 3 +-- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/hw/net/ne2000.h b/hw/net/ne2000.h index adb8021bd1..2cd193e4c6 100644 --- a/hw/net/ne2000.h +++ b/hw/net/ne2000.h @@ -1,11 +1,12 @@ #ifndef HW_NE2000_H #define HW_NE2000_H +#include "qemu/units.h" #include "hw/hw.h" #include "net/net.h" -#define NE2000_PMEM_SIZE (32*1024) -#define NE2000_PMEM_START (16*1024) +#define NE2000_PMEM_SIZE (32 * KiB) +#define NE2000_PMEM_START (16 * KiB) #define NE2000_PMEM_END (NE2000_PMEM_SIZE+NE2000_PMEM_START) #define NE2000_MEM_SIZE NE2000_PMEM_END diff --git a/include/hw/net/allwinner_emac.h b/include/hw/net/allwinner_emac.h index 4cc8aab7ec..905a43deb4 100644 --- a/include/hw/net/allwinner_emac.h +++ b/include/hw/net/allwinner_emac.h @@ -23,6 +23,7 @@ #ifndef ALLWINNER_EMAC_H #define ALLWINNER_EMAC_H +#include "qemu/units.h" #include "net/net.h" #include "qemu/fifo8.h" #include "hw/net/mii.h" @@ -125,8 +126,8 @@ #define EMAC_INT_RX (1 << 8) /* Due to lack of specifications, size of fifos is chosen arbitrarily */ -#define TX_FIFO_SIZE (4 * 1024) -#define RX_FIFO_SIZE (32 * 1024) +#define TX_FIFO_SIZE (4 * KiB) +#define RX_FIFO_SIZE (32 * KiB) #define NUM_TX_FIFOS 2 #define RX_HDR_SIZE 8 diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c index cda8d48333..510ddb3897 100644 --- a/hw/net/e1000e.c +++ b/hw/net/e1000e.c @@ -34,6 +34,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "net/net.h" #include "net/tap.h" #include "qemu/range.h" @@ -81,10 +82,10 @@ typedef struct E1000EState { #define E1000E_IO_IDX 2 #define E1000E_MSIX_IDX 3 -#define E1000E_MMIO_SIZE (128 * 1024) -#define E1000E_FLASH_SIZE (128 * 1024) +#define E1000E_MMIO_SIZE (128 * KiB) +#define E1000E_FLASH_SIZE (128 * KiB) #define E1000E_IO_SIZE (32) -#define E1000E_MSIX_SIZE (16 * 1024) +#define E1000E_MSIX_SIZE (16 * KiB) #define E1000E_MSIX_TABLE (0x0000) #define E1000E_MSIX_PBA (0x2000) diff --git a/hw/net/e1000x_common.c b/hw/net/e1000x_common.c index eb0e097137..09047806f2 100644 --- a/hw/net/e1000x_common.c +++ b/hw/net/e1000x_common.c @@ -23,6 +23,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "hw/hw.h" #include "hw/pci/pci.h" #include "net/net.h" @@ -111,7 +112,7 @@ bool e1000x_is_oversized(uint32_t *mac, size_t size) static const int maximum_ethernet_vlan_size = 1522; /* this is the size past which hardware will drop packets when setting LPE=1 */ - static const int maximum_ethernet_lpe_size = 16384; + static const int maximum_ethernet_lpe_size = 16 * KiB; if ((size > maximum_ethernet_lpe_size || (size > maximum_ethernet_vlan_size diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c index a07a63247e..e761daf551 100644 --- a/hw/net/eepro100.c +++ b/hw/net/eepro100.c @@ -41,6 +41,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "hw/hw.h" #include "hw/pci/pci.h" #include "net/net.h" @@ -60,8 +61,6 @@ * changed to pad short packets itself. */ #define CONFIG_PAD_RECEIVED_FRAMES -#define KiB 1024 - /* Debug EEPRO100 card. */ #if 0 # define DEBUG_EEPRO100 From patchwork Mon Jun 25 12:42:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934295 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="i9/+l0bA"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41DqT31gpzz9s2L for ; Mon, 25 Jun 2018 23:16:55 +1000 (AEST) Received: from localhost ([::1]:46839 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXRMS-0002fZ-MR for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 09:16:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54953) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQrW-0002Py-5H for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:44:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQrU-0008Dq-91 for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:44:54 -0400 Received: from mail-qk0-x229.google.com ([2607:f8b0:400d:c09::229]:34943) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQrU-0008De-4y; Mon, 25 Jun 2018 08:44:52 -0400 Received: by mail-qk0-x229.google.com with SMTP id u21-v6so1774738qku.2; Mon, 25 Jun 2018 05:44:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cT4R+V0+fb3Ve2pbM3Q3ZJUYFAn12RDM/rctRSApmKQ=; b=i9/+l0bAYdWydMKRlvyfbtGrHmnOyY5vb9mmXV1NGlJ0LdDuLuz5omcuMedeFSk2qN LeAUa9Pt2aKd9mYnZQZi6U0X7cELjfn4v1Sfm6FHoaHRzDaGx5GNy4GjVe9mjk5JgMDP 90AHn7DDjv+7dayOJb1u3W1uAygsokq9tekyVsKbu+SZyourmNiaU3wBP62vVM2Fxs6Q T4OpFOXmN65lQ2d8ZGy1qgFiyNTMP+TwQbXUF4ou8hEUHUJD+Z5uk2LlCiVz8rb+YMfm cuCkurH7bdvLYrb1RUp9va6DoqmkZC7eO8c4IFB/TBMjs7y/8FK+pLcFyCqhCqNcIr4Z mEmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=cT4R+V0+fb3Ve2pbM3Q3ZJUYFAn12RDM/rctRSApmKQ=; b=ObTv4aO12/XOrkJlyc2/ou6w7gTBAHGbx3E2PAPFiyarN2kGJbmfLCmrpcN9pyYNdt dwWfdTJDvGupnGQLmLEwVUIwpCjQXT0vp+auR+zyV6a2y0/AohpsrUFh3XyVBQeqGDn8 35wZET53GZ+TSqFsuvp7nCFPSIFKP4FAv9QGGWH9SlQc9mmYGdPg4ZZCOly4aQuDMifs I7R+9S/eT9H1ADtbYozCVZC/KwU3VQbUaVBwHVqFK5xatIwKKd2E/5Y+/6VcrWRvYsz/ uaGvnl9U3x8PfF4DMYmtCnONxWEBaGzyq5x8bCV6/RWQkM4OumWkwJ++pOoD334qdd6i DhAQ== X-Gm-Message-State: APt69E31tVCePcdid0ewhIbGizuaQyKNf3cZp0/NkgUo2J2ZZbScUCze VV8T++0tIx+t76w7wQ/env4= X-Google-Smtp-Source: AAOMgpc6+eFjLLxryE8CqvMAaTEyuLsr4KPsWuPs2H1ERkXCeZPRp6PERNim/XyplO0mj8Y39GB5/g== X-Received: by 2002:a37:7886:: with SMTP id t128-v6mr10389896qkc.367.1529930691596; Mon, 25 Jun 2018 05:44:51 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.44.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:44:51 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil Date: Mon, 25 Jun 2018 09:42:27 -0300 Message-Id: <20180625124238.25339-36-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::229 Subject: [Qemu-devel] [PATCH v5 35/46] hw/usb: Use the IEC binary prefix definitions 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: qemu-trivial@nongnu.org, Gerd Hoffmann , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It eases code review, unit is explicit. Patch generated using: $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/ and modified manually. Signed-off-by: Philippe Mathieu-Daudé --- hw/usb/ccid-card-passthru.c | 5 +++-- hw/usb/combined-packet.c | 3 ++- hw/usb/dev-smartcard-reader.c | 3 ++- hw/usb/redirect.c | 3 ++- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/hw/usb/ccid-card-passthru.c b/hw/usb/ccid-card-passthru.c index 25fb19b0d7..e75d433e56 100644 --- a/hw/usb/ccid-card-passthru.c +++ b/hw/usb/ccid-card-passthru.c @@ -9,6 +9,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include #include "chardev/char-fe.h" #include "qemu/error-report.h" @@ -40,7 +41,7 @@ static const uint8_t DEFAULT_ATR[] = { 0x13, 0x08 }; -#define VSCARD_IN_SIZE 65536 +#define VSCARD_IN_SIZE (64 * KiB) /* maximum size of ATR - from 7816-3 */ #define MAX_ATR_SIZE 40 @@ -276,7 +277,7 @@ static void ccid_card_vscard_read(void *opaque, const uint8_t *buf, int size) if (card->vscard_in_pos + size > VSCARD_IN_SIZE) { error_report( - "no room for data: pos %d + size %d > %d. dropping connection.", + "no room for data: pos %u + size %d > %ld. dropping connection.", card->vscard_in_pos, size, VSCARD_IN_SIZE); ccid_card_vscard_drop_connection(card); return; diff --git a/hw/usb/combined-packet.c b/hw/usb/combined-packet.c index 48cac87f6a..01a7ed0848 100644 --- a/hw/usb/combined-packet.c +++ b/hw/usb/combined-packet.c @@ -20,6 +20,7 @@ * along with this program; if not, see . */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qemu-common.h" #include "hw/usb.h" #include "qemu/iov.h" @@ -171,7 +172,7 @@ void usb_ep_combine_input_packets(USBEndpoint *ep) if ((p->iov.size % ep->max_packet_size) != 0 || !p->short_not_ok || next == NULL || /* Work around for Linux usbfs bulk splitting + migration */ - (totalsize == 16348 && p->int_req)) { + (totalsize == (16 * KiB - 36) && p->int_req)) { usb_device_handle_data(ep->dev, first); assert(first->status == USB_RET_ASYNC); if (first->combined) { diff --git a/hw/usb/dev-smartcard-reader.c b/hw/usb/dev-smartcard-reader.c index 13d0befd9c..8f716fc165 100644 --- a/hw/usb/dev-smartcard-reader.c +++ b/hw/usb/dev-smartcard-reader.c @@ -35,6 +35,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "qemu-common.h" #include "qemu/error-report.h" @@ -63,7 +64,7 @@ do { \ * or handle the migration complexity - VMState doesn't handle this case. * sizes are expected never to be exceeded, unless guest misbehaves. */ -#define BULK_OUT_DATA_SIZE 65536 +#define BULK_OUT_DATA_SIZE (64 * KiB) #define PENDING_ANSWERS_NUM 128 #define BULK_IN_BUF_SIZE 384 diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c index 58e8f7f5bd..99094a721e 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -26,6 +26,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "qemu-common.h" #include "qemu/timer.h" @@ -1298,7 +1299,7 @@ static int usbredir_chardev_can_read(void *opaque) } /* usbredir_parser_do_read will consume *all* data we give it */ - return 1024 * 1024; + return 1 * MiB; } static void usbredir_chardev_read(void *opaque, const uint8_t *buf, int size) From patchwork Mon Jun 25 12:42:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934304 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="CXN0PQCk"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41DqY14xp8z9rvt for ; Mon, 25 Jun 2018 23:20:21 +1000 (AEST) Received: from localhost ([::1]:46861 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXRPn-0005QH-9X for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 09:20:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54981) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQrX-0002RE-Ey for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:44:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQrW-0008F0-GQ for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:44:55 -0400 Received: from mail-qk0-x22a.google.com ([2607:f8b0:400d:c09::22a]:36331) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQrW-0008EQ-Ay; Mon, 25 Jun 2018 08:44:54 -0400 Received: by mail-qk0-x22a.google.com with SMTP id a132-v6so424480qkg.3; Mon, 25 Jun 2018 05:44:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qQqHj8f6hL24hFZB8G7iCb6VX3fY6vRHctkm2u7O/m4=; b=CXN0PQCkBCpMRcFtmJROYPXKZX3RpopiPZJaos3sXKPP04012tdfA1CaqUD91DSYVx 5UTMSalkDM82m/UFEeZRQVWD00ooscnJIObekgkqWE1e/nrlmqa97B3oHv8PmGP540iz 1B2tUdObGk5wqRkuSQZnbnBK7SrtQALYtaP+DHwVi2S1fm6RPp31tlMl5t2mT6/PbuRH iFAAsEvnz0pmcpaHM7zAM/n7uEzs570n8tPOeocukiUbtQwW/xfKxGjQQiHmHKsWXewq 935b6clUX9THeYRjZZvIJltQsB1vZCOxbacMlWXsxoutIEaw1omXjK1HYr/mE91ivqjf WPxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=qQqHj8f6hL24hFZB8G7iCb6VX3fY6vRHctkm2u7O/m4=; b=DTPWE+ARfdDzkzcqSGFbxQKZD+YiQUjHbT7pb93ye1nzwUdOTq5z+M3GUcvlrU4SYB N5V/ncfMZf0MLM4XcU/kzdOHgvyJtXIR4ig+GH+XGi+R6x4TtsUUpxRKfRwl9vScXUHQ 4Kmg81tk7IgDDUOnxrBC3gHKaqvlmSywfdcojx6/VIRX02hTtOVct9pyBGzfGRoXSGZD fYQ9ne8ftFOdoC7Ip4MeVB5dr2vDSE9MqLOITvztfxscCU6xDZBalT5epkF/cELNIIg2 GyN94BrUQlU0rDCnjYaur7t6O4WWbxT2pwd2T/lR2cgAeD4FpVeRRwrVAbJVMGsbmgRh qpiA== X-Gm-Message-State: APt69E3GN560LYbS/SkkHDP2poUxkiQCXROb7ARMzdgQVVCGAdu9lCjo qsLtdCosn2v7RyEnBNe6EQs= X-Google-Smtp-Source: AAOMgpfU6C4141qnMQmYhP9HTfuyg8p70I8yblleOCc2nP1sxcMYO4PTWz4JBoZOrqkJfocPNTFCTg== X-Received: by 2002:a37:5a47:: with SMTP id o68-v6mr10755619qkb.226.1529930693761; Mon, 25 Jun 2018 05:44:53 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.44.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:44:53 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil Date: Mon, 25 Jun 2018 09:42:28 -0300 Message-Id: <20180625124238.25339-37-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::22a Subject: [Qemu-devel] [PATCH v5 36/46] hw/sd: Use the IEC binary prefix definitions 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: qemu-trivial@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It eases code review, unit is explicit. Patch generated using: $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/ and modified manually. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/sd/sd.c | 4 ++-- hw/sd/sdhci.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 9a16b768ed..d4356e9b73 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -31,6 +31,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "hw/qdev.h" #include "hw/hw.h" #include "hw/registerfields.h" @@ -38,7 +39,6 @@ #include "hw/sd/sd.h" #include "qapi/error.h" #include "qemu/bitmap.h" -#include "qemu/cutils.h" #include "hw/qdev-properties.h" #include "qemu/error-report.h" #include "qemu/timer.h" @@ -403,7 +403,7 @@ static void sd_set_csd(SDState *sd, uint64_t size) ((HWBLOCK_SHIFT << 6) & 0xc0); sd->csd[14] = 0x00; /* File format group */ } else { /* SDHC */ - size /= 512 * 1024; + size /= 512 * KiB; size -= 1; sd->csd[0] = 0x40; sd->csd[1] = 0x0e; diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index a11e802485..643b39d306 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -23,6 +23,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qemu/error-report.h" #include "qapi/error.h" #include "hw/hw.h" @@ -32,7 +33,6 @@ #include "hw/sd/sdhci.h" #include "sdhci-internal.h" #include "qemu/log.h" -#include "qemu/cutils.h" #include "trace.h" #define TYPE_SDHCI_BUS "sdhci-bus" @@ -742,7 +742,7 @@ static void get_adma_description(SDHCIState *s, ADMADescr *dscr) if ((dscr->attr & SDHC_ADMA_ATTR_ACT_MASK) == SDHC_ADMA_ATTR_SET_LEN) { dscr->length = (uint16_t)extract32(adma1, 12, 16); } else { - dscr->length = 4096; + dscr->length = 4 * KiB; } break; case SDHC_CTRL_ADMA2_64: @@ -790,7 +790,7 @@ static void sdhci_do_adma(SDHCIState *s) return; } - length = dscr.length ? dscr.length : 65536; + length = dscr.length ? dscr.length : 64 * KiB; switch (dscr.attr & SDHC_ADMA_ATTR_ACT_MASK) { case SDHC_ADMA_ATTR_ACT_TRAN: /* data transfer */ From patchwork Mon Jun 25 12:42:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934308 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="LxtRpI+f"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41Dqc44XY1z9rvt for ; Mon, 25 Jun 2018 23:23:00 +1000 (AEST) Received: from localhost ([::1]:46914 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXRSM-0007z0-BB for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 09:22:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55038) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQra-0002UZ-D4 for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:45:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQrZ-0008GQ-6F for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:44:58 -0400 Received: from mail-qt0-x231.google.com ([2607:f8b0:400d:c0d::231]:43142) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQrZ-0008G6-1Q; Mon, 25 Jun 2018 08:44:57 -0400 Received: by mail-qt0-x231.google.com with SMTP id y89-v6so11731475qtd.10; Mon, 25 Jun 2018 05:44:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5NhtA11DFK/NbIj6IVOslmvAnwYcEY5l2w6PfZU8Vqc=; b=LxtRpI+ff9U/N1wkU/RksNNBI6dNn2tel+jIpoZz8lbvTtaGoGYoHIN7iM3ij5NMQ8 O33FxVXiRGFACiTu9sYXjy6h8jd7ityrhFgCQacJ/v1Ynch6M/jM4WCUVQS2UbBa97Px Rdnu+vjcIF6Yvo4fokZ6QX72zQil/sI3COb8fO2V9EED5OKTgVIHjeQlw9I8zMTu5JqV JtsRDzXVwuNLVgj+FtBDTPSt9LglZoJJ8tbOJMqtcP3fMBW61C+Eti6qVcoh54JJu2Zc gqSOu+phu/E8ebDzjR7ZYZ93DyRB5ivi2K/MCOU4ffnu7M1GDr0ljVuklswzi56SWji4 V1lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=5NhtA11DFK/NbIj6IVOslmvAnwYcEY5l2w6PfZU8Vqc=; b=QPSPge1MSeMbSNaKCdjc5l+XJNVpzppd44i9Kx5GkmfcAQZ6ZCO7Q9hyZFpDZNLp+L VKZszkpwLPmqdZCbvYCpN7tn7xl49HjGPAOTQrscSCWR181LuLoWi7+dZb7c49ILCbig Ka6Veek0wqkRHwZT2EDZn2ZP3riYLcMVHSWGZMwr+k31PZVVnTmh/Z0JeXXc5gO9YT24 n1iH3wGUpOjYu3EhT2QKiaweA3xXqfa7jhN4E8XbmnQxZlwAbQLDJYM4snTcC/JXfIiV 1eazVdZrrj4aoq9D/jv+wjGAucwxuBk10MZZT3YHvXkXS0rN/AFgedZu2OseUdqjpQCB 56Bw== X-Gm-Message-State: APt69E0wik5Kqoc41xp/jKdTo8P2Y9+jfBFGlbOnVO40C/3/FOx8eamM 7HmITablIB2u109e3SCQ5KM= X-Google-Smtp-Source: ADUXVKLLYohEKxJ+EYTXvupDuBLzhY854n3kZvwvc+rPGRKKKk/OfnBqeIfN6jtyjlEBcwvIZGHe/Q== X-Received: by 2002:aed:3f36:: with SMTP id p51-v6mr10527639qtf.213.1529930696484; Mon, 25 Jun 2018 05:44:56 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.44.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:44:56 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil Date: Mon, 25 Jun 2018 09:42:29 -0300 Message-Id: <20180625124238.25339-38-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::231 Subject: [Qemu-devel] [PATCH v5 37/46] hw/vfio: Use the IEC binary prefix definitions 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: qemu-trivial@nongnu.org, Alex Williamson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It eases code review, unit is explicit. Patch generated using: $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/ and modified manually. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/vfio/pci-quirks.c | 9 +++++---- hw/vfio/pci.c | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c index 061259b86b..481fd08df7 100644 --- a/hw/vfio/pci-quirks.c +++ b/hw/vfio/pci-quirks.c @@ -11,6 +11,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qemu/error-report.h" #include "qemu/main-loop.h" #include "qemu/range.h" @@ -1448,9 +1449,9 @@ static int vfio_igd_gtt_max(VFIOPCIDevice *vdev) ggms = 1 << ggms; } - ggms *= 1024 * 1024; + ggms *= MiB; - return (ggms / (4 * 1024)) * (gen < 8 ? 4 : 8); + return (ggms / (4 * KiB)) * (gen < 8 ? 4 : 8); } /* @@ -1705,7 +1706,7 @@ static void vfio_probe_igd_bar4_quirk(VFIOPCIDevice *vdev, int nr) igd->vdev = vdev; igd->index = ~0; igd->bdsm = vfio_pci_read_config(&vdev->pdev, IGD_BDSM, 4); - igd->bdsm &= ~((1 << 20) - 1); /* 1MB aligned */ + igd->bdsm &= ~((1 * MiB) - 1); /* 1MB aligned */ memory_region_init_io(&quirk->mem[0], OBJECT(vdev), &vfio_igd_index_quirk, igd, "vfio-igd-index-quirk", 4); @@ -1752,7 +1753,7 @@ static void vfio_probe_igd_bar4_quirk(VFIOPCIDevice *vdev, int nr) * config offset 0x5C. */ bdsm_size = g_malloc(sizeof(*bdsm_size)); - *bdsm_size = cpu_to_le64((ggms_mb + gms_mb) * 1024 * 1024); + *bdsm_size = cpu_to_le64((ggms_mb + gms_mb) * MiB); fw_cfg_add_file(fw_cfg_find(), "etc/igd-bdsm-size", bdsm_size, sizeof(*bdsm_size)); diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 18c493b49e..a1577dea7f 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -28,6 +28,7 @@ #include "qemu/error-report.h" #include "qemu/option.h" #include "qemu/range.h" +#include "qemu/units.h" #include "sysemu/kvm.h" #include "sysemu/sysemu.h" #include "pci.h" @@ -1417,7 +1418,7 @@ static void vfio_pci_relocate_msix(VFIOPCIDevice *vdev, Error **errp) } /* 2GB max size for 32-bit BARs, cannot double if already > 1G */ - if (vdev->bars[target_bar].size > (1 * 1024 * 1024 * 1024) && + if (vdev->bars[target_bar].size > 1 * GiB && !vdev->bars[target_bar].mem64) { error_setg(errp, "Invalid MSI-X relocation BAR %d, " "no space to extend 32-bit BAR", target_bar); From patchwork Mon Jun 25 12:42:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934311 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="rpSzEBNB"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41Dqcl4K4Nz9rvt for ; Mon, 25 Jun 2018 23:23:35 +1000 (AEST) Received: from localhost ([::1]:46923 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXRSv-0008P3-86 for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 09:23:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55062) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQrc-0002VB-Bx for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:45:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQrb-0008HW-LP for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:45:00 -0400 Received: from mail-qk0-x232.google.com ([2607:f8b0:400d:c09::232]:46904) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQrb-0008HK-H1; Mon, 25 Jun 2018 08:44:59 -0400 Received: by mail-qk0-x232.google.com with SMTP id o2-v6so7357118qkc.13; Mon, 25 Jun 2018 05:44:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jEdOJMrTQyDHwdwa2ZYHeouSFiuQ23P+sklzrRWqDtk=; b=rpSzEBNBxJj9YMWxUxHaAdnY0ATxTX7Wp76IuYXYOqOhqEAGah1DQSBJ70fFhP7sCG euuNCB/+Q/P6XwaD/TTIv1jr1Jd5Hd/Gv6JFuItet+QqdRW70gmo0o7gUr5oSex2zMvx gGqPn3AOXcFdV1LcvT8l5mX3WfGFQpi06EUIQkNoCJ89uXti4RwverkEgR+ol2d1Xtqh kldeK7RSCGCmJmTpXXzFP2Ae7hIVdruMq8w9VDJpIUWV/X1uHfJedBmmJzYPZHBDfF2r f+uZQ8Z+goelDpq0Jygw/9d+i3EEFgsxvSPoqt3HOqfUQ7Id+y94pWD2C0lZk0GSJCcM +0OQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=jEdOJMrTQyDHwdwa2ZYHeouSFiuQ23P+sklzrRWqDtk=; b=R+fWhO48AEpdwc3+M6VwtXglfyNGivs5gA9cjOV7WKwg/+oAD1qxkJDJdxM8+hkzVi a/Op51wC5eO+Lb6HST9M4jEUhWGABp7/nn7kEnndSk72Q+B3uxFd9pilZmYnyoIYtqzE frCYToosE+hSDU1n2Tp3Oygr1AecJGchq4x1fMCnmpB49YUEJN3rJ21wiRK9OIKZCide pEh/Junz2+bRZyArJKQn8A4KHvdqTTb494IZUQDJRi6Id3+AzHTabUJSPDqCDyuxvGfM TB6ogH1+DCLgO9CDB5vWoiYBHGfRbSACr4K4NHe97txruMAO+1PwtovHOGK9CaIiDENR jd9g== X-Gm-Message-State: APt69E0zAOMyaxUTKuIx8JpJSf9wRqeM5knA6yVSxHBQkN1lU/4Q/KH8 6XSjRWgQP5rDWQjsan6x6Ho= X-Google-Smtp-Source: AAOMgpcKpA3bGnBlONMHdEJjVvEUPvbvDJefEuWNKp152R10Ua0YejPn7vOg/tOCvtxXb4ErBORQ6A== X-Received: by 2002:a37:6086:: with SMTP id u128-v6mr9983385qkb.8.1529930698967; Mon, 25 Jun 2018 05:44:58 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.44.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:44:58 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil Date: Mon, 25 Jun 2018 09:42:30 -0300 Message-Id: <20180625124238.25339-39-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::232 Subject: [Qemu-devel] [PATCH v5 38/46] hw/virtio: Use the IEC binary prefix definitions 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: qemu-trivial@nongnu.org, "Michael S. Tsirkin" , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It eases code review, unit is explicit. Patch generated using: $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/ and modified manually. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/virtio/virtio-net.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/hw/virtio/virtio-net.h b/include/hw/virtio/virtio-net.h index 02484dc94c..4d7f3c82ca 100644 --- a/include/hw/virtio/virtio-net.h +++ b/include/hw/virtio/virtio-net.h @@ -14,6 +14,7 @@ #ifndef QEMU_VIRTIO_NET_H #define QEMU_VIRTIO_NET_H +#include "qemu/units.h" #include "standard-headers/linux/virtio_net.h" #include "hw/virtio/virtio.h" @@ -44,7 +45,7 @@ typedef struct virtio_net_conf } virtio_net_conf; /* Maximum packet size we can receive from tap device: header + 64k */ -#define VIRTIO_NET_MAX_BUFSIZE (sizeof(struct virtio_net_hdr) + (64 << 10)) +#define VIRTIO_NET_MAX_BUFSIZE (sizeof(struct virtio_net_hdr) + (64 * KiB)) typedef struct VirtIONetQueue { VirtQueue *rx_vq; From patchwork Mon Jun 25 12:42:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934316 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="IwqJOb+t"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41Dqgr3p0vz9rvt for ; Mon, 25 Jun 2018 23:26:16 +1000 (AEST) Received: from localhost ([::1]:46953 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXRVW-0002Eo-4L for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 09:26:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55090) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQrf-0002Yk-1w for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:45:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQre-0008IQ-1t for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:45:03 -0400 Received: from mail-qk0-x235.google.com ([2607:f8b0:400d:c09::235]:43591) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQrd-0008IA-Tk; Mon, 25 Jun 2018 08:45:01 -0400 Received: by mail-qk0-x235.google.com with SMTP id j124-v6so549769qka.10; Mon, 25 Jun 2018 05:45:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7XIA3npzlSEppAfPoDyv0y5tj3tPy6oCOhXRWiwn4gE=; b=IwqJOb+tWPHZyPWhAxL0X2sPq+yXzsoXeLjTc6DzZnJUCJyI2Oaybb2PMnWsLRTiSU MfJUJMjcfibxWKZP03l4gAKGHQEb37Uf1bj4vXfZEVAjIQxCS9FR0g8AOqCQ5VhWxZmU U0RfR11F9Mto6HehoquHaqo9l3TgucYXhC789G2aezQ1uFUl4IfDw7ZxAnSAaHWp7LO8 KODuIoyK85uuBCF4SMZ2jkR7TkSZJqXOOONHlBq6iM1QrHW5s4j0uj9syVjqS3qVV85B 0RhUoWfmkT0+4jPaAFRavrdfsMH9iFWz/kX1ra+ewSde/VY1PBWc0W8MIkzp0E7e7blZ rP3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=7XIA3npzlSEppAfPoDyv0y5tj3tPy6oCOhXRWiwn4gE=; b=Hd2EOMD9aTohsJWfXXh+ZkzKyD+pGlUTSjw9jTL91T3lEDWrPVKw3V7QIhlV99QCzY F0ILTTtRg8z8wIbSmt4VzeA6+4/HavJJa17RqdOY8iAXrXxhkTNPD5p8lPa7S0xsaX2G GKULAkbiXgXJptjgV8TINrCej+wR8QW7ywO55e0Od/ySY6AJIBafHN0ec1tnMFAAWehd ZE1I0lM0Yp2OO62PqlPOLutiILUtmYx4eY0ndjNy3xXqEHdEmQSFHobKMGCB5AoBfDqS jv1YrQISRt24PA4D7xXW7V/iRduRMwU5z2AVyF1N9fORfegUA5rRsQr6h0Bs5LEv99lL vT0Q== X-Gm-Message-State: APt69E0v+UYFjx9PY/VoDvNg6xnJOKjZnkBNiA0tLarKQZq4pj7BXuRP bwTWKGxdGZEZ28k/sXl/RC4= X-Google-Smtp-Source: ADUXVKKTiQMLJY5jv2E+Iygw9Kj5i4iSEoGJ8NbYdkBIjleebpZF668BneOgvR5JYuySaRscQtubWQ== X-Received: by 2002:ae9:e113:: with SMTP id g19-v6mr10685961qkm.9.1529930701432; Mon, 25 Jun 2018 05:45:01 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.44.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:45:01 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil Date: Mon, 25 Jun 2018 09:42:31 -0300 Message-Id: <20180625124238.25339-40-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::235 Subject: [Qemu-devel] [PATCH v5 39/46] hw/rdma: Use the IEC binary prefix definitions 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: qemu-trivial@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Yuval Shaia , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It eases code review, unit is explicit. Patch generated using: $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/ and modified manually. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Marcel Apfelbaum Reviewed-by: Yuval Shaia --- hw/rdma/vmw/pvrdma.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/rdma/vmw/pvrdma.h b/hw/rdma/vmw/pvrdma.h index 0b46dc5a9b..81e0e0e99c 100644 --- a/hw/rdma/vmw/pvrdma.h +++ b/hw/rdma/vmw/pvrdma.h @@ -16,6 +16,7 @@ #ifndef PVRDMA_PVRDMA_H #define PVRDMA_PVRDMA_H +#include "qemu/units.h" #include "hw/pci/pci.h" #include "hw/pci/msix.h" @@ -30,7 +31,7 @@ #define RDMA_MSIX_BAR_IDX 0 #define RDMA_REG_BAR_IDX 1 #define RDMA_UAR_BAR_IDX 2 -#define RDMA_BAR0_MSIX_SIZE (16 * 1024) +#define RDMA_BAR0_MSIX_SIZE (16 * KiB) #define RDMA_BAR1_REGS_SIZE 64 #define RDMA_BAR2_UAR_SIZE (0x1000 * MAX_UCS) /* each uc gets page */ From patchwork Mon Jun 25 12:42:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934315 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="CCSKh8/w"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41Dqfw3vk1z9rvt for ; Mon, 25 Jun 2018 23:25:28 +1000 (AEST) Received: from localhost ([::1]:46943 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXRUk-0001Yh-6H for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 09:25:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55149) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQrl-0002gm-Pp for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:45:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQrg-0008Kz-AK for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:45:09 -0400 Received: from mail-qk0-x22a.google.com ([2607:f8b0:400d:c09::22a]:43581) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQrg-0008Kc-5r; Mon, 25 Jun 2018 08:45:04 -0400 Received: by mail-qk0-x22a.google.com with SMTP id j124-v6so549835qka.10; Mon, 25 Jun 2018 05:45:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uqWOl+vIVIHulXa3fbBPY58euCpO03Rrza0JJwjDkZE=; b=CCSKh8/wLKnXvlaUCh2a+geZg7SGGsI+P1Qk8qhob2BQW78CnFBE9UBFgPfVCucrgU OcIzQ7AEtbhqrfrHg3MljzmrjWzzwbQ9RmCFJZO+8CgsP89I0ItGMO9tGGlvTrqGNwHf LZeCF6bnR0P2vaJ1LDUBCnlfSYYDloWHz0UvdtfMDCjiU5eZQr5ObFl/SIZYT99pJI7n s0FKCJRQ6D2S82rbhOfilkISmsYFv6/sO+9HHDKynY/4Z4sOjC5THxC2V8diijxIgrlX B+7Zay91WbrQkcoRyeJ8h6KyZilxGpdhINpvdX0tF3hNVVznKvgDor+eRSa0lbozedwm RHoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=uqWOl+vIVIHulXa3fbBPY58euCpO03Rrza0JJwjDkZE=; b=qSC5IbTiczcjpswycs7STQ/6uvrANpeN35ILyGUdvBN41S9wWmPZZa8oWa85qH52Jg xnoRhfXnO6+Q9aKQj8OWXQJ5uqg8JRmWEl6EvuKJp0Do3U8YdPZrFFuteO+JMlo60Knm 8UtuB1T9RIOyJsECOImeySXNQvYT0HhuJmeXJN4j0WPNCgZilZyCh1WRMX0BNFBPhOcB biLmDPnxckGSyGlZF/dtvFTImzsUZqLEorgaOvELzZD2W4vktdR5S+wxWwbk2v7ycfUQ bvinBbEd2/bfwXau2V853sEn+W/k7ZfzDsqVzXLuy8zs4KTy6ieuv/Nf4bKkjBC0tbv3 PBcw== X-Gm-Message-State: APt69E1rop5k76RUQENd5IzabtdHJ1wnIAPsWeESksrePCMXSqP2MuCA YAlhui0m3RYwHyTtxrOE1M0= X-Google-Smtp-Source: AAOMgpdArdwuLVB5NDnBcvmFMULmU7qdNsEOD6BVKCH0O+C150cv5EaCclXVPuP0ZEcdBtHi+bx7Xg== X-Received: by 2002:ae9:f449:: with SMTP id z9-v6mr969023qkl.410.1529930703694; Mon, 25 Jun 2018 05:45:03 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.45.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:45:03 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil Date: Mon, 25 Jun 2018 09:42:32 -0300 Message-Id: <20180625124238.25339-41-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::22a Subject: [Qemu-devel] [PATCH v5 40/46] cutils: Do not include "qemu/units.h" directly 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: qemu-trivial@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" All files using "qemu/units.h" definitions already include it directly, we can now remove it from "qemu/cutils.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Marcel Apfelbaum --- include/qemu/cutils.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/qemu/cutils.h b/include/qemu/cutils.h index 056e6629bb..cdb0f0db75 100644 --- a/include/qemu/cutils.h +++ b/include/qemu/cutils.h @@ -2,7 +2,6 @@ #define QEMU_CUTILS_H #include "qemu/fprintf-fn.h" -#include "qemu/units.h" /** * pstrcpy: From patchwork Mon Jun 25 12:42:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934282 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="VMIZ/bmN"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41DqKT2PMKz9rvt for ; Mon, 25 Jun 2018 23:10:20 +1000 (AEST) Received: from localhost ([::1]:46791 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXRG6-0005sO-CS for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 09:10:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55157) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQrn-0002j9-Sj for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:45:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQrj-0008Lv-PJ for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:45:11 -0400 Received: from mail-qt0-x22b.google.com ([2607:f8b0:400d:c0d::22b]:36334) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQrj-0008Lk-Kg; Mon, 25 Jun 2018 08:45:07 -0400 Received: by mail-qt0-x22b.google.com with SMTP id o9-v6so11749200qtp.3; Mon, 25 Jun 2018 05:45:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=W2c1BxIlBljpouZn/2l8+mbc2hEwvv4El7saaUaHAcs=; b=VMIZ/bmNI2aaQ/MWkvJu06/QXWuSaSruo+s92GhiATXHtVo1GPUCeYtC8K5U3BDH8y RRpIL8ylGJSoIsWm4nyHGpr9LaTOmNSKazjOgGL210+LFJkqKj7UxDPPnDqlDoyxALTd 0lKUzixeYxi+iZ7/j67M4o5bb8MN0p/1WL9kNRqZ9l/DMUXqO/lT/y8Z9MoEPaI3vJAp id5zrIGkhQEYqxF/owRYggwI4uHD3piuYYC/9OEUqSBEEhoWi3ycmqWkp7M3vMyMvGIz qyQBfcjk57D6Kdk5P4VHzUS86N9TrJKWni9q2k5epJ8WZpgAqJ3jpkIqvRToqX0G86Ig /7ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=W2c1BxIlBljpouZn/2l8+mbc2hEwvv4El7saaUaHAcs=; b=BQe+keOxrD5IgNn0lOoEucfoi9BEvdRlP1Kop9LeH0wbVFYn76XgAf94V8CEUnvE53 46GC4CAISkASMlt0CA4Zh2tImdN/RJJVHNgcDLEHBGbwE3YCju9GG7w6xgNTYORApTWC D2Y1yMdEG+vJPOvtG+SmW5KedHUSjAGNMq20v2reKyTZoVRYDO3BWxmHLbc8rM97/z0T UI1Yh9BteL5Z0+wMnBIWZFBzgf33bYRjSTPJ2x4z9XT/mqUk8eGWmAArUGC/8hfib8qp 8IMhjUgMi74ViYdMCB+Vnws0aOGZyXme/1jTUMmRkUBP7/GZy/3CRRLZdWb1N9K+qwEN qpWQ== X-Gm-Message-State: APt69E35HgJxN7k9vw9f4F6ic3L2S0Po5imdsAPFIyasFuX21r/rdAbx ZaMaWkCtKrvmFPdrRKGd4uA= X-Google-Smtp-Source: ADUXVKKFY75sjmb7ZdOSz1QaghpB2AyJyw6kPW+oQ7BfByh1zLPnzgnpdorMzAAsYjwS+V3nSYKzBA== X-Received: by 2002:ac8:2825:: with SMTP id 34-v6mr10928477qtq.377.1529930707052; Mon, 25 Jun 2018 05:45:07 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.45.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:45:06 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil , Eric Blake Date: Mon, 25 Jun 2018 09:42:33 -0300 Message-Id: <20180625124238.25339-42-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::22b Subject: [Qemu-devel] [PATCH v5 41/46] hw/ppc: Use the IEC binary prefix definitions 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: qemu-devel@nongnu.org, qemu-trivial@nongnu.org, Alexander Graf , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "open list:PowerPC" , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It eases code review, unit is explicit. Patch generated using: $ git grep -n '[<>][<>]= ?[1-5]0' and modified manually. Signed-off-by: Philippe Mathieu-Daudé Acked-by: David Gibson --- hw/ppc/sam460ex.c | 2 +- target/ppc/mmu_helper.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c index ffe561fbc1..c7c799b843 100644 --- a/hw/ppc/sam460ex.c +++ b/hw/ppc/sam460ex.c @@ -126,7 +126,7 @@ static void generate_eeprom_spd(uint8_t *eeprom, ram_addr_t ram_size) int i; /* work in terms of MB */ - ram_size >>= 20; + ram_size /= MiB; while ((ram_size >= 4) && (nbanks <= 2)) { int sz_log2 = MIN(31 - clz32(ram_size), 14); diff --git a/target/ppc/mmu_helper.c b/target/ppc/mmu_helper.c index 98ce17985b..e6739e6c24 100644 --- a/target/ppc/mmu_helper.c +++ b/target/ppc/mmu_helper.c @@ -17,6 +17,7 @@ * License along with this library; if not, see . */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "cpu.h" #include "exec/helper-proto.h" #include "sysemu/kvm.h" @@ -1090,11 +1091,10 @@ static void mmubooke_dump_mmu(FILE *f, fprintf_function cpu_fprintf, pa = entry->RPN & mask; /* Extend the physical address to 36 bits */ pa |= (hwaddr)(entry->RPN & 0xF) << 32; - size /= 1024; - if (size >= 1024) { - snprintf(size_buf, sizeof(size_buf), "%3" PRId64 "M", size / 1024); + if (size >= 1 * MiB) { + snprintf(size_buf, sizeof(size_buf), "%3" PRId64 "M", size / MiB); } else { - snprintf(size_buf, sizeof(size_buf), "%3" PRId64 "k", size); + snprintf(size_buf, sizeof(size_buf), "%3" PRId64 "k", size / KiB); } cpu_fprintf(f, "0x%016" PRIx64 " 0x%016" PRIx64 " %s %-5u %08x %08x\n", (uint64_t)ea, (uint64_t)pa, size_buf, (uint32_t)entry->PID, From patchwork Mon Jun 25 12:42:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934318 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Evcx+KVL"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41DqlC1Hg3z9rvt for ; Mon, 25 Jun 2018 23:29:11 +1000 (AEST) Received: from localhost ([::1]:46967 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXRYK-0004Qj-JP for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 09:29:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQrp-0002lC-S8 for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:45:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQrp-0008Na-2s for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:45:13 -0400 Received: from mail-qt0-x22d.google.com ([2607:f8b0:400d:c0d::22d]:46350) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQro-0008NT-UM; Mon, 25 Jun 2018 08:45:12 -0400 Received: by mail-qt0-x22d.google.com with SMTP id h5-v6so11725135qtm.13; Mon, 25 Jun 2018 05:45:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=P/WHvuMNKFdXdZIDHQZCrQXUyyr5st/qS2bWvd+UOMk=; b=Evcx+KVLrLycR8XRHHieczSiPgtIbQzvf4YbAG+XDLjqksHBFIPPjYztNrbDpbb0K6 px9rKrdz2lTiBcjZgA5yja6BGxMVgvW6pgPccq7zr8qtbJnt4oULscm3un3V3D3Qdm0P pJyLcE7Nktj4LX8C68HXECPflpZFJvrY4rD2UFsRx+qGJgjrqzdVNsazfar2JeXbqIwi OU6DfPUPLbmhS74vAUroHOyhkn5Jee7qH1Sl3m/gKiXgk6HUyN3t55So5FqNJbe5RLiQ cW1gDSTXiSyzanr69M1UIaLfOy+/SV9Pgr3Vnp4xM6TaJRCB73XVB7jbsSTSOAZr4rYr ejag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=P/WHvuMNKFdXdZIDHQZCrQXUyyr5st/qS2bWvd+UOMk=; b=maQ0iS0TI2EVU1+XvzAUcDuWaDBJ8ljP0FNWRY5VPQCpM6ZGeiCLTbeK2JZ5wJtVLb Gvc2aKvN8k3nfmeGY+/GBLs9PzleCLtZVZIUHBo6Uf7kb/imOWST2fZtsB3wGKuAyNKC SnpI/9DdIUWZlqDY5VJWTI60yTZfsDILbODa77qyo8lVcqFxRjiq2tZ2TRgE7eq4C5t9 sqcN+EDJnLqf8BMGaL91ckvRw/ghBTqOns8c5XcN2R+aYW/9A/jsQJD4bRBLOCUvf3gQ XTskjRQHr/MelSJd8Ghx/8a/xGuKaQWImzS1PUT1Rph8r3x3OnG7AMFfGbyWnmj41i35 7wwQ== X-Gm-Message-State: APt69E2BQMTcdomICvRGzJFxGPddcKR8HQAKhVYfvTX4OQck8rExieYG VzM82XwCEqKT3WsEijapYSEfgynDXag= X-Google-Smtp-Source: ADUXVKL+4Ad3kTWKKe7EfWAgCenOh8AjLRmQGntwiaHSUNqU4To2lPG0cgjiabtPCne5oBd44GOVUA== X-Received: by 2002:aed:24b0:: with SMTP id t45-v6mr4474093qtc.86.1529930712379; Mon, 25 Jun 2018 05:45:12 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.45.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:45:09 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil , Eric Blake Date: Mon, 25 Jun 2018 09:42:34 -0300 Message-Id: <20180625124238.25339-43-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::22d Subject: [Qemu-devel] [PATCH v5 42/46] monitor: Use the IEC binary prefix definitions 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: qemu-trivial@nongnu.org, Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Dr. David Alan Gilbert" , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It eases code review, unit is explicit. Patch generated using: $ git grep -n '[<>][<>]= ?[1-5]0' and modified manually. Suggested-by: Eric Blake Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- monitor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/monitor.c b/monitor.c index 0730a27172..ace14195d6 100644 --- a/monitor.c +++ b/monitor.c @@ -23,6 +23,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include #include "cpu.h" #include "hw/hw.h" @@ -3286,7 +3287,7 @@ static QDict *monitor_parse_arguments(Monitor *mon, monitor_printf(mon, "enter a positive value\n"); goto fail; } - val <<= 20; + val *= MiB; } qdict_put_int(qdict, key, val); } From patchwork Mon Jun 25 12:42:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934325 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="L9CpL5fX"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41DqpR2shWz9rvt for ; Mon, 25 Jun 2018 23:31:59 +1000 (AEST) Received: from localhost ([::1]:46987 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXRb3-0006cD-1K for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 09:31:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55208) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQrs-0002ny-Gy for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:45:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQrr-0008Of-Jj for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:45:16 -0400 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:46074) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQrr-0008OV-Fk; Mon, 25 Jun 2018 08:45:15 -0400 Received: by mail-qt0-x242.google.com with SMTP id i18-v6so11724322qtp.12; Mon, 25 Jun 2018 05:45:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=D4nySAKGchCydPN6hgkd0bKR5AnKkJFcTvXHvmuvR2s=; b=L9CpL5fXsadoolCCZEhSv8Pdqu0Rjm8j+GyZhu0Lt6/CchiyeR02ePQMl+nqBLcYY+ TPV8GNMr+yTLxMlseWjSWSddkdJ5gQ9hZQ5W9egsTwCx2kixS7Uxt5QPVOICoMjHpAjX guJYY/V05mjFUp3bzaCOO9FgLrNxY9h9893cjMYDpvx/ml7knQFn8sUYw82kSDvIptu7 M2/+0YMch3kpVFGDbcIHMpPvSMK8fnffR9Drb6hQLA4ZfTWmdxdunw8GpGlaTUkBaacb z8VjBbPv/bXGzbL4CQ8/Q4W3htVa2eH20H0eD2ekTAxeCedOyA1GyMUHk8KVZZ0PHT+A XdLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=D4nySAKGchCydPN6hgkd0bKR5AnKkJFcTvXHvmuvR2s=; b=XNILMnHXUwicPQlkuy5oTm0fjjT1Qt5OygHKrpC4bAML9GLH+U0qUP6LdSPLP5x84b 4H3zy8ywZC7BXrgptRs/2lveWSqEH74JftOOhiG4Cy51M6Ql8os2wCYjQBlVLf4CuIXz R7FZOGTJjRxXLZ2bYpTGYiSTtIb7qEcZ0+fZsMa14pEmkqMGAGs+AmkqSPJNNMsXnPK8 cbe4CUOpa/JzsOE2+MTzoJ2PPrZjsfCPxnHS/KNcHV7ti2MEqBj8uldu+557RXSBXkNM UQV2V6ZvTQ2FYett2Im7+ohpwaacW4uaxqqYE47Fx4wbh+DBEDF1zXEADqWsTEn6sO0I fzxQ== X-Gm-Message-State: APt69E2HrxzJ+Ef3thgpm+vbtAO0SmoQMstZskkSjS6ttpU+k592Tuab BvuTuok+umtqhHA24dteTGo= X-Google-Smtp-Source: AAOMgpekjX+Fxp0s5jVbB4E0PZcSrO9DhFcBANNs7ZabU1p/dVtFgm7xxXgpuWCYpfQ8ef2YYcQF/w== X-Received: by 2002:a0c:8e08:: with SMTP id v8-v6mr3993275qvb.182.1529930714939; Mon, 25 Jun 2018 05:45:14 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.45.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:45:14 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil , Eric Blake Date: Mon, 25 Jun 2018 09:42:35 -0300 Message-Id: <20180625124238.25339-44-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::242 Subject: [Qemu-devel] [PATCH v5 43/46] vl: Use the IEC binary prefix definitions 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: qemu-trivial@nongnu.org, Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It eases code review, unit is explicit. Patch generated using: $ git grep -n '[<>][<>]= ?[1-5]0' and modified manually. Suggested-by: Eric Blake Signed-off-by: Philippe Mathieu-Daudé --- vl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vl.c b/vl.c index d451f45dc5..7729ba390f 100644 --- a/vl.c +++ b/vl.c @@ -23,6 +23,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "qemu-version.h" #include "qemu/cutils.h" @@ -2790,7 +2791,7 @@ static void set_memory_options(uint64_t *ram_slots, ram_addr_t *maxram_size, if (g_ascii_isdigit(mem_str[strlen(mem_str) - 1])) { uint64_t overflow_check = sz; - sz <<= 20; + sz *= MiB; if ((sz >> 20) != overflow_check) { error_report("too large 'size' option value"); exit(EXIT_FAILURE); From patchwork Mon Jun 25 12:42:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934317 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="NNuZvtdk"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41Dqk12sj4z9ryk for ; Mon, 25 Jun 2018 23:28:09 +1000 (AEST) Received: from localhost ([::1]:46961 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXRXK-0003d5-UH for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 09:28:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55278) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQrx-0002sh-8O for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:45:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQru-0008Pn-I5 for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:45:21 -0400 Received: from mail-qk0-x229.google.com ([2607:f8b0:400d:c09::229]:40523) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQru-0008PS-2i; Mon, 25 Jun 2018 08:45:18 -0400 Received: by mail-qk0-x229.google.com with SMTP id b129-v6so7361430qke.7; Mon, 25 Jun 2018 05:45:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BCxunVxWmwIk0FC6wcum33vfzo3NHW+vyJKJixCB1Ls=; b=NNuZvtdkhsmwhoBikzH4F7yv3Zo9U0f6vazwKZvnr0GndKID0GLHJrCvH+eT2SjcLe xontHW5Y8aHjx/oTNOVzt8AH7I7+f/cJabFHJZyeUQ1aEeRdC2Du3cMetBFGrcmtv7GB BIACBxAefQv43Q0ODgDNiPtX/ZgaooknfllZyRimaLpbdNIWeS2huD5mIKT2SMTUyAyN WU3ns8gGZSd7qE76IegWrpGY0SEg2vz882OzLP42YQt7yicuckWCJYWxBtosOkEZxDhd rNgyS1B4v/8f4xTvD0RpRVSdJkX1E1574emSalum3IX0G1dhjd4VtEVPKYFsnpi1CSDP sfTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=BCxunVxWmwIk0FC6wcum33vfzo3NHW+vyJKJixCB1Ls=; b=IRzfNu16w3CC0nm97k23acPKXRNppTP+eTtiwLYNhVdIwhSrRTL0GhFT8lu1vcYlWx P0QwFNgXs3Tl/UaFkLsgtl3+LmYKvJldWSYZsUmlUbnZrHicg7JgHBOaE6HU+3DP6tI7 DXmdi3ZhuRL+SIIju87V8014wKilfWK+eBBS8Qe/p3i6uNoEQ0UFwkt9oOK/tIhBYMPU dsT9cKhqZOvUR7+c+QG9Czdgwj6tvTUFJl6109NjhnOUEKjOHqs1KTCjxYURwQ/YpG46 M0DAQnHmqyqr7r0D7zMcXBZZvaxjDZJgBtvzJy4snjJzNJRYsd/k4ZdVgrdSoEnIwsyU NEdA== X-Gm-Message-State: APt69E2T2f8bGHvzOA9ylCgf4G3NTXRXC8QcqUgIRp9SoKgH68rPMO+N qszIaXxycAJWBf1KVx+ns8I= X-Google-Smtp-Source: ADUXVKL942NhWWbs802rgHh6Q1ZmM5dQlN719c6JgYvB2qjTsDHcqMhHLfbyV23WXr8WhQKQviDXXQ== X-Received: by 2002:a37:c20b:: with SMTP id i11-v6mr10613722qkm.316.1529930717531; Mon, 25 Jun 2018 05:45:17 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.45.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:45:17 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil , Eric Blake Date: Mon, 25 Jun 2018 09:42:36 -0300 Message-Id: <20180625124238.25339-45-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::229 Subject: [Qemu-devel] [PATCH v5 44/46] tests/crypto: Use the IEC binary prefix definitions 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: qemu-trivial@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It eases code review, unit is explicit. Patch generated using: $ git grep -n '[<>][<>]= ?[1-5]0' and modified manually. Suggested-by: Eric Blake Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- tests/benchmark-crypto-cipher.c | 6 +++--- tests/benchmark-crypto-hash.c | 5 +++-- tests/benchmark-crypto-hmac.c | 6 +++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/tests/benchmark-crypto-cipher.c b/tests/benchmark-crypto-cipher.c index cf98443468..f5a0d0bc32 100644 --- a/tests/benchmark-crypto-cipher.c +++ b/tests/benchmark-crypto-cipher.c @@ -11,6 +11,7 @@ * top-level directory. */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "crypto/init.h" #include "crypto/cipher.h" @@ -56,8 +57,7 @@ static void test_cipher_speed(const void *opaque) total += chunk_size; } while (g_test_timer_elapsed() < 5.0); - total /= 1024 * 1024; /* to MB */ - + total /= MiB; g_print("cbc(aes128): "); g_print("Testing chunk_size %zu bytes ", chunk_size); g_print("done: %.2f MB in %.2f secs: ", total, g_test_timer_last()); @@ -78,7 +78,7 @@ int main(int argc, char **argv) g_test_init(&argc, &argv, NULL); g_assert(qcrypto_init(NULL) == 0); - for (i = 512; i <= (64 * 1204); i *= 2) { + for (i = 512; i <= 64 * KiB; i *= 2) { memset(name, 0 , sizeof(name)); snprintf(name, sizeof(name), "/crypto/cipher/speed-%zu", i); g_test_add_data_func(name, (void *)i, test_cipher_speed); diff --git a/tests/benchmark-crypto-hash.c b/tests/benchmark-crypto-hash.c index 122bfb6b85..9b6f7a9155 100644 --- a/tests/benchmark-crypto-hash.c +++ b/tests/benchmark-crypto-hash.c @@ -11,6 +11,7 @@ * top-level directory. */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "crypto/init.h" #include "crypto/hash.h" @@ -39,7 +40,7 @@ static void test_hash_speed(const void *opaque) total += chunk_size; } while (g_test_timer_elapsed() < 5.0); - total /= 1024 * 1024; /* to MB */ + total /= MiB; g_print("sha256: "); g_print("Testing chunk_size %zu bytes ", chunk_size); g_print("done: %.2f MB in %.2f secs: ", total, g_test_timer_last()); @@ -57,7 +58,7 @@ int main(int argc, char **argv) g_test_init(&argc, &argv, NULL); g_assert(qcrypto_init(NULL) == 0); - for (i = 512; i <= (64 * 1204); i *= 2) { + for (i = 512; i <= 64 * KiB; i *= 2) { memset(name, 0 , sizeof(name)); snprintf(name, sizeof(name), "/crypto/hash/speed-%zu", i); g_test_add_data_func(name, (void *)i, test_hash_speed); diff --git a/tests/benchmark-crypto-hmac.c b/tests/benchmark-crypto-hmac.c index c30250df3e..f1dfa240cb 100644 --- a/tests/benchmark-crypto-hmac.c +++ b/tests/benchmark-crypto-hmac.c @@ -11,6 +11,7 @@ * top-level directory. */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "crypto/init.h" #include "crypto/hmac.h" @@ -53,8 +54,7 @@ static void test_hmac_speed(const void *opaque) total += chunk_size; } while (g_test_timer_elapsed() < 5.0); - total /= 1024 * 1024; /* to MB */ - + total /= MiB; g_print("hmac(sha256): "); g_print("Testing chunk_size %zu bytes ", chunk_size); g_print("done: %.2f MB in %.2f secs: ", total, g_test_timer_last()); @@ -72,7 +72,7 @@ int main(int argc, char **argv) g_test_init(&argc, &argv, NULL); g_assert(qcrypto_init(NULL) == 0); - for (i = 512; i <= (64 * 1204); i *= 2) { + for (i = 512; i <= 64 * KiB; i *= 2) { memset(name, 0 , sizeof(name)); snprintf(name, sizeof(name), "/crypto/hmac/speed-%zu", i); g_test_add_data_func(name, (void *)i, test_hmac_speed); From patchwork Mon Jun 25 12:42:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934327 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="J9FDbxPk"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41DqrQ21qRz9rvt for ; Mon, 25 Jun 2018 23:33:42 +1000 (AEST) Received: from localhost ([::1]:46994 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXRci-0007q0-0J for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 09:33:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55365) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQs4-000303-6B for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:45:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQrx-0008SK-Pt for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:45:28 -0400 Received: from mail-qt0-x22f.google.com ([2607:f8b0:400d:c0d::22f]:43142) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQrx-0008RS-BM; Mon, 25 Jun 2018 08:45:21 -0400 Received: by mail-qt0-x22f.google.com with SMTP id y89-v6so11732709qtd.10; Mon, 25 Jun 2018 05:45:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sxONjbL6XqUn0XE0GloYBwbh60sF/GdBm3p9sx97vPM=; b=J9FDbxPkrdTDPmkQh+qyNZrcJ7hPPXiVMC8Io6vojY7eRMDPkqecEHyTRoWPKC98Xo l/KhJFFmunRxJHVY7w9gqMHgE+exvoKUPxT8XRH1uiRYP65ADELndgl8PYsqKlvjzyT7 m84Ta8TOEKRRrfclLgSgvyg9Sa9hm3cc0eAUNtpdKU6/Xwr/pP8YxNbb00vXqYzazkq+ 1ZQ2RtZ7MnhtVu0o9yp+/D6WDFyHIiWT98xryprNfQBoEhOYlY2SnyjTxFLulTBQ9dza NzhWXZ3q9S4Ic3zfyTPXcwbNRn4+DXY9MwFcUTP0Ty8mFmCINrl+hp2Nz3p7lcm87tVT 0s/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=sxONjbL6XqUn0XE0GloYBwbh60sF/GdBm3p9sx97vPM=; b=g28p+wd1SnntPTpbYZPjeaqcx5uU8bhFYkRiGHaJy1HrbfmxJJ7VuNB2WmIAa4cxE8 KitukO44TtcCVsdL7SShYfvh9auvXulpu+P6rsQP6KeFeZBQjgB6Hxmxgy1X5CKW2S+x 151QU2ZtYwykk/QZKJT3dG//6YlmSt4DjLCvsUTYxivungqR4znGV4HjflnkRvIrDV7u 0ogasr5MXUPRmnwIt1fuTcEJJ96Q+bSMJHuqESGnXi9h9dCMAH7QH5oadYo/azdIx0mw 9st+r5ehEabmAIWU5MuhTfloxXRw8SX60PM+JqjASixuyo7tu3X8BpH+izQZBabp0Y9i cOUg== X-Gm-Message-State: APt69E0nCwUfKpEWTY55GlZIM/lJ7mrN8iMKxf5flIj68sK1SZNtvHvo myb4LNJG62KiEKHw0gnqctEBSppu3Hk= X-Google-Smtp-Source: ADUXVKIvFMwYkJTs55J0FkGptk5Fx3yUCErlMKA1lScCRRw+tNwrfLm8F+XDaRdi0Nbc4taDsb1cgQ== X-Received: by 2002:ac8:4703:: with SMTP id f3-v6mr7489063qtp.176.1529930720743; Mon, 25 Jun 2018 05:45:20 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.45.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:45:20 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil , Eric Blake Date: Mon, 25 Jun 2018 09:42:37 -0300 Message-Id: <20180625124238.25339-46-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::22f Subject: [Qemu-devel] [PATCH v5 45/46] linux-user: Use the IEC binary prefix definitions 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: qemu-trivial@nongnu.org, Laurent Vivier , Riku Voipio , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It eases code review, unit is explicit. Patch generated using: $ git grep -n '[<>][<>]= ?[1-5]0' and modified manually. Suggested-by: Eric Blake Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Laurent Vivier --- linux-user/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/linux-user/main.c b/linux-user/main.c index 84e9ec9335..52b5a618fe 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -17,6 +17,7 @@ * along with this program; if not, see . */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qemu-version.h" #include #include @@ -274,9 +275,9 @@ static void handle_arg_stack_size(const char *arg) } if (*p == 'M') { - guest_stack_size *= 1024 * 1024; + guest_stack_size *= MiB; } else if (*p == 'k' || *p == 'K') { - guest_stack_size *= 1024; + guest_stack_size *= KiB; } } From patchwork Mon Jun 25 12:42:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 934322 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Vqw+czh1"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41Dqml04dmz9rvt for ; Mon, 25 Jun 2018 23:30:31 +1000 (AEST) Received: from localhost ([::1]:46977 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXRZc-0005QY-Kb for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2018 09:30:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55354) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQs1-0002xl-51 for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:45:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQrz-0008Vb-Vc for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:45:25 -0400 Received: from mail-qt0-x22e.google.com ([2607:f8b0:400d:c0d::22e]:46352) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQrz-0008UV-R7; Mon, 25 Jun 2018 08:45:23 -0400 Received: by mail-qt0-x22e.google.com with SMTP id h5-v6so11725688qtm.13; Mon, 25 Jun 2018 05:45:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OyYRKrBznhLkhc7aKyMdUTaMXJsj7r+u/HQ8VQcDDck=; b=Vqw+czh1s1N9GOv7qEacj+z3v4ba2gUGO4vr4XdDOgux1XW9vt7xEbIYklsGYO3pop IO5g9KTgkYIfZNOxXrudK5mHKhbZE4GhYfkLIjGKmtJPqCUgm4zPI3i+gs7fhaGyxfd0 khskMIP4f3+c0O/9rB56ytBRgstzIBZxG7iQVlwldC+m1zWox/S4WR5EdNnMiTSJyANn EGoacmvt51D3bv9UM4TWhiUhSFcC1K+rgkBXDAMyfwEHm0ZTAYHtzCRzMRcIyXciliJQ BBAkjVcg2tqzIUvaG85i8bra27+/rMxCB2E8F5GEjMinSg/Il2P3IRAM0t34D2Ttx/xX ktxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=OyYRKrBznhLkhc7aKyMdUTaMXJsj7r+u/HQ8VQcDDck=; b=iVVJfRg75LWyt1rCnLuwt0z+1/vh8/KCJeEEXZWtZi1tc2ZIGz2Q8F4zA0dBBS/pkm vNJQDT98oZV20hKjq/ZxbJrfa8PCCWliBTcwVILoltgo0D2AV4SVoRswAzGwh8rOw2j4 uWgs+a1aL2r0q8Mw3P5OzeAUk4KZ6LZWOZ+WvWJzxvsgpfoa/Le1KlhXMHkuu/tUIC3r vZLiXXKwjraXZ2WlKlHg/QWobMb1r9R88PzU+NXTXnMA893pp9Gnbb17mSTd8l4OG2Z3 26N94fA2eHucESXWGbMY7ig2Rv41RfBdizT8+nou1SJDcAcgCZoyCKLfrO2ioPCuePp5 B6Dg== X-Gm-Message-State: APt69E0PvJvjaakEDQ3X2LyJl5bNIX31GNN/RcirJWudagG4lU0zEhBP 6SUlkVqYFdR/II3eNrz2KM0= X-Google-Smtp-Source: ADUXVKLjKdq3cv3ruVgYgF4HkIxJYhbPhh3RXw2ir6RGZRqJVB/p8hGSdMRoO1MB7Pv9mc9eLl/PjQ== X-Received: by 2002:aed:39a1:: with SMTP id m30-v6mr10100984qte.328.1529930723203; Mon, 25 Jun 2018 05:45:23 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.45.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:45:22 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil , Eric Blake Date: Mon, 25 Jun 2018 09:42:38 -0300 Message-Id: <20180625124238.25339-47-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::22e Subject: [Qemu-devel] [PATCH v5 46/46] bsd-user: Use the IEC binary prefix definitions 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: qemu-trivial@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It eases code review, unit is explicit. Patch generated using: $ git grep -n '[<>][<>]= ?[1-5]0' and modified manually. Suggested-by: Eric Blake Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- bsd-user/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bsd-user/main.c b/bsd-user/main.c index da3b833975..0d3156974c 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -17,6 +17,7 @@ * along with this program; if not, see . */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qemu-version.h" #include @@ -795,9 +796,9 @@ int main(int argc, char **argv) if (x86_stack_size <= 0) usage(); if (*r == 'M') - x86_stack_size *= 1024 * 1024; + x86_stack_size *= MiB; else if (*r == 'k' || *r == 'K') - x86_stack_size *= 1024; + x86_stack_size *= KiB; } else if (!strcmp(r, "L")) { interp_prefix = argv[optind++]; } else if (!strcmp(r, "p")) {