From patchwork Mon Apr 29 00:31:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cao Jiaxi X-Patchwork-Id: 10921087 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A26AE1575 for ; Mon, 29 Apr 2019 00:52:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9165A286CC for ; Mon, 29 Apr 2019 00:52:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8F3742871A; Mon, 29 Apr 2019 00:52:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 199622872A for ; Mon, 29 Apr 2019 00:52:19 +0000 (UTC) Received: from localhost ([127.0.0.1]:50195 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hKuWp-0001Qc-93 for patchwork-qemu-devel@patchwork.kernel.org; Sun, 28 Apr 2019 20:52:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33681) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hKuIi-0007js-BJ for qemu-devel@nongnu.org; Sun, 28 Apr 2019 20:37:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hKuD7-0001yY-HK for qemu-devel@nongnu.org; Sun, 28 Apr 2019 20:31:59 -0400 Received: from smtpbgbr2.qq.com ([54.207.22.56]:50330) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hKuD4-0001j8-8I for qemu-devel@nongnu.org; Sun, 28 Apr 2019 20:31:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1556497901; bh=6oRnU2BcdGDtPE9iy7KsdHPQRg/PEb0sJ/jEVMvHFo0=; h=From:To:Subject:Date:Message-Id; b=aZIPijFX0X/7CgEsEL90yjccURgwOM/+A1pKpFOr9q319um6UeNaR2VG4TdbWPxw+ dYERMorMMhBsKk+uElURgIbYk5NAdtZC/DuGSxeI4riCv7uVMtE0dEgords5UTBRwp 4rGvJPYhaXMttx3hLVOPr04myk0QH+mGYaXAFeME= X-QQ-mid: esmtp6t1556497899t8yxfv82s Received: from localhost (unknown [183.63.119.27]) by esmtp4.qq.com (ESMTP) with id ; Mon, 29 Apr 2019 08:31:39 +0800 (CST) X-QQ-SSF: B100000000000030F7F00F00000000O X-QQ-FEAT: WzbxStTePJ13/a+InIYkATG89/rAYwUtroxFcvvVFG3Fyfhd+dJNlSIBtHQV4 bq/AIZaiNF8g0CUXwhq1Cxg2SAklzBRnAfmoe6lXpa7DhcBpHFZ2G6dez5WkjpwTeo2PBBd 2Son0pXglRkFQa1NVqIKwXL81JQ6M7La0leU7zKxRVaTmnZQMdauJehF0O0yHGXNP1IC43U qMo71gvSkKCjzxE0MHwtmtsJSAkvtkg3EGKs2TxvZOGJpPP9kqxsDoLYTaWSQS6VgO55ECA Ir2POVmy7y+ebaso1CrMi4KUp452oD+JO8UohQLcfPptsb X-QQ-GoodBg: 0 From: driver1998 To: samuel.thibault@ens-lyon.org, mst@redhat.com Date: Mon, 29 Apr 2019 00:31:12 +0000 Message-Id: <20190429003112.22808-1-driver1998@foxmail.com> X-Mailer: git-send-email 2.17.1 X-QQ-SENDSIZE: 520 Feedback-ID: esmtp:foxmail.com:bgforeign:bgforeign4 X-QQ-Bgrelay: 1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 54.207.22.56 X-Mailman-Approved-At: Sun, 28 Apr 2019 20:49:05 -0400 Subject: [Qemu-devel] [PATCH 1/4] Initial Windows on ARM (AArch64 64-Bit) host support 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: driver1998 , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP This series of patches is for initial support of Windows 10 on ARM as a QEMU host. Currently only TCG intepreter is working correctly, it crashes when TCG JIT is enabled. For now we assume it is built using the clang aarch64-w64-mingw32 toolchain, you can get a prebuilt toolchain at https://github.com/mstorsjo/llvm-mingw. QEMU_PACKED: Remove gcc_struct attribute in Windows non x86 targets This attribute is for x86 only, and it generates an warning on ARM64 Clang/MinGW targets. Signed-off-by: driver1998 --- contrib/libvhost-user/libvhost-user.h | 2 +- include/qemu/compiler.h | 2 +- scripts/cocci-macro-file.h | 7 ++++++- slirp/src/util.h | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/contrib/libvhost-user/libvhost-user.h b/contrib/libvhost-user/libvhost-user.h index 414ceb0a2f..78b33306e8 100644 --- a/contrib/libvhost-user/libvhost-user.h +++ b/contrib/libvhost-user/libvhost-user.h @@ -148,7 +148,7 @@ typedef struct VhostUserInflight { uint16_t queue_size; } VhostUserInflight; -#if defined(_WIN32) +#if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__)) # define VU_PACKED __attribute__((gcc_struct, packed)) #else # define VU_PACKED __attribute__((packed)) diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index 296b2fd572..09fc44cca4 100644 --- a/include/qemu/compiler.h +++ b/include/qemu/compiler.h @@ -28,7 +28,7 @@ #define QEMU_SENTINEL __attribute__((sentinel)) -#if defined(_WIN32) +#if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__)) # define QEMU_PACKED __attribute__((gcc_struct, packed)) #else # define QEMU_PACKED __attribute__((packed)) diff --git a/scripts/cocci-macro-file.h b/scripts/cocci-macro-file.h index e485cdccae..c6bbc05ba3 100644 --- a/scripts/cocci-macro-file.h +++ b/scripts/cocci-macro-file.h @@ -23,7 +23,12 @@ #define QEMU_NORETURN __attribute__ ((__noreturn__)) #define QEMU_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #define QEMU_SENTINEL __attribute__((sentinel)) -#define QEMU_PACKED __attribute__((gcc_struct, packed)) + +#if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__)) +# define QEMU_PACKED __attribute__((gcc_struct, packed)) +#else +# define QEMU_PACKED __attribute__((packed)) +#endif #define cat(x,y) x ## y #define cat2(x,y) cat(x,y) diff --git a/slirp/src/util.h b/slirp/src/util.h index 01f1e0e068..278828fe3f 100644 --- a/slirp/src/util.h +++ b/slirp/src/util.h @@ -43,7 +43,7 @@ #include #endif -#if defined(_WIN32) +#if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__)) # define SLIRP_PACKED __attribute__((gcc_struct, packed)) #else # define SLIRP_PACKED __attribute__((packed)) From patchwork Mon Apr 29 00:32:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cao Jiaxi X-Patchwork-Id: 10921083 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 66EAE15A6 for ; Mon, 29 Apr 2019 00:50:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5680A286DA for ; Mon, 29 Apr 2019 00:50:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 52C33286F1; Mon, 29 Apr 2019 00:50:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, UPPERCASE_50_75 autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EF706286DA for ; Mon, 29 Apr 2019 00:50:10 +0000 (UTC) Received: from localhost ([127.0.0.1]:50169 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hKuUk-0007lU-4N for patchwork-qemu-devel@patchwork.kernel.org; Sun, 28 Apr 2019 20:50:10 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33681) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hKuIg-0007js-4z for qemu-devel@nongnu.org; Sun, 28 Apr 2019 20:37:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hKuDu-0002s6-SY for qemu-devel@nongnu.org; Sun, 28 Apr 2019 20:32:47 -0400 Received: from smtpbgau1.qq.com ([54.206.16.166]:60015) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hKuDu-0002qf-7N for qemu-devel@nongnu.org; Sun, 28 Apr 2019 20:32:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1556497956; bh=gerxQDe02AMpDBIHhMgCswR4djHrmypAHaU/w5+GbGc=; h=From:To:Subject:Date:Message-Id; b=OAr3Lks0NwAd7taLLL3ZNiXCJyrsdwpVOEdE3X6L6Z9IIUFywNyq8w2CSwfnWAzY4 yyxg2WR9awFNbXxIUc9mNkcsRaSPQq1kORe5ol4cSmLJza7YN3qXrw6+YJXkU+jh3T 7askQ0heK/7wiqLYOzPsapIahOoy40GIPVFiDJNI= X-QQ-mid: esmtp5t1556497955tpz6kda8i Received: from localhost (unknown [183.63.119.27]) by esmtp4.qq.com (ESMTP) with id ; Mon, 29 Apr 2019 08:32:34 +0800 (CST) X-QQ-SSF: B100000000000030F7F00F00000000O X-QQ-FEAT: 6ugjij1k5i+U+MtU1Gig6Z/DKHduD8fjPl7gcoOWmCmUcIse7eLArPs2XM3wB QS7xxcEWrxf2j9+s40N2P68zs1u1sY9+IiGHZLP/aAj4c64RVyq16iN7RG/fHu8bAfALdo7 +paxam6vKJl/GsCxXRhXl8m9xicMNcGC/zH+D2m6h2P4wZuIv1HkKfAzxuFnZM9mTHFM7I5 0//U932Ihh6d0x6fBtlYrwLsPSVbKs84p4bFLEvhAvUy2o8d1A+Pt/67iIs6JPx9hmdEkun zrI++UTjH0DdEgwd6FqTBjrKaxIR5lmMplXg== X-QQ-GoodBg: 0 From: driver1998 To: mdroth@linux.vnet.ibm.com Date: Mon, 29 Apr 2019 00:32:23 +0000 Message-Id: <20190429003223.22856-1-driver1998@foxmail.com> X-Mailer: git-send-email 2.17.1 X-QQ-SENDSIZE: 520 Feedback-ID: esmtp:foxmail.com:bgforeign:bgforeign4 X-QQ-Bgrelay: 1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 54.206.16.166 X-Mailman-Approved-At: Sun, 28 Apr 2019 20:49:03 -0400 Subject: [Qemu-devel] [PATCH 2/4] qga: Fix an enum conversion warning in commands-win32.c, hit by clang. 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: driver1998 , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: driver1998 --- qga/commands-win32.c | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/qga/commands-win32.c b/qga/commands-win32.c index d40d61f605..4cdd2950bf 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win32.c @@ -458,23 +458,24 @@ void qmp_guest_file_flush(int64_t handle, Error **errp) #ifdef CONFIG_QGA_NTDDSCSI static STORAGE_BUS_TYPE win2qemu[] = { - [BusTypeUnknown] = GUEST_DISK_BUS_TYPE_UNKNOWN, - [BusTypeScsi] = GUEST_DISK_BUS_TYPE_SCSI, - [BusTypeAtapi] = GUEST_DISK_BUS_TYPE_IDE, - [BusTypeAta] = GUEST_DISK_BUS_TYPE_IDE, - [BusType1394] = GUEST_DISK_BUS_TYPE_IEEE1394, - [BusTypeSsa] = GUEST_DISK_BUS_TYPE_SSA, - [BusTypeFibre] = GUEST_DISK_BUS_TYPE_SSA, - [BusTypeUsb] = GUEST_DISK_BUS_TYPE_USB, - [BusTypeRAID] = GUEST_DISK_BUS_TYPE_RAID, - [BusTypeiScsi] = GUEST_DISK_BUS_TYPE_ISCSI, - [BusTypeSas] = GUEST_DISK_BUS_TYPE_SAS, - [BusTypeSata] = GUEST_DISK_BUS_TYPE_SATA, - [BusTypeSd] = GUEST_DISK_BUS_TYPE_SD, - [BusTypeMmc] = GUEST_DISK_BUS_TYPE_MMC, + [BusTypeUnknown] = (STORAGE_BUS_TYPE)GUEST_DISK_BUS_TYPE_UNKNOWN, + [BusTypeScsi] = (STORAGE_BUS_TYPE)GUEST_DISK_BUS_TYPE_SCSI, + [BusTypeAtapi] = (STORAGE_BUS_TYPE)GUEST_DISK_BUS_TYPE_IDE, + [BusTypeAta] = (STORAGE_BUS_TYPE)GUEST_DISK_BUS_TYPE_IDE, + [BusType1394] = (STORAGE_BUS_TYPE)GUEST_DISK_BUS_TYPE_IEEE1394, + [BusTypeSsa] = (STORAGE_BUS_TYPE)GUEST_DISK_BUS_TYPE_SSA, + [BusTypeFibre] = (STORAGE_BUS_TYPE)GUEST_DISK_BUS_TYPE_SSA, + [BusTypeUsb] = (STORAGE_BUS_TYPE)GUEST_DISK_BUS_TYPE_USB, + [BusTypeRAID] = (STORAGE_BUS_TYPE)GUEST_DISK_BUS_TYPE_RAID, + [BusTypeiScsi] = (STORAGE_BUS_TYPE)GUEST_DISK_BUS_TYPE_ISCSI, + [BusTypeSas] = (STORAGE_BUS_TYPE)GUEST_DISK_BUS_TYPE_SAS, + [BusTypeSata] = (STORAGE_BUS_TYPE)GUEST_DISK_BUS_TYPE_SATA, + [BusTypeSd] = (STORAGE_BUS_TYPE)GUEST_DISK_BUS_TYPE_SD, + [BusTypeMmc] = (STORAGE_BUS_TYPE)GUEST_DISK_BUS_TYPE_MMC, #if (_WIN32_WINNT >= 0x0601) - [BusTypeVirtual] = GUEST_DISK_BUS_TYPE_VIRTUAL, - [BusTypeFileBackedVirtual] = GUEST_DISK_BUS_TYPE_FILE_BACKED_VIRTUAL, + [BusTypeVirtual] = (STORAGE_BUS_TYPE)GUEST_DISK_BUS_TYPE_VIRTUAL, + [BusTypeFileBackedVirtual] = + (STORAGE_BUS_TYPE)GUEST_DISK_BUS_TYPE_FILE_BACKED_VIRTUAL, #endif }; @@ -483,7 +484,7 @@ static GuestDiskBusType find_bus_type(STORAGE_BUS_TYPE bus) if (bus >= ARRAY_SIZE(win2qemu) || (int)bus < 0) { return GUEST_DISK_BUS_TYPE_UNKNOWN; } - return win2qemu[(int)bus]; + return (GuestDiskBusType)win2qemu[(int)bus]; } DEFINE_GUID(GUID_DEVINTERFACE_DISK, From patchwork Mon Apr 29 00:33:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cao Jiaxi X-Patchwork-Id: 10921085 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 28B601395 for ; Mon, 29 Apr 2019 00:51:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 16A34286DB for ; Mon, 29 Apr 2019 00:51:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0AF7728725; Mon, 29 Apr 2019 00:51:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B33B3286DB for ; Mon, 29 Apr 2019 00:51:38 +0000 (UTC) Received: from localhost ([127.0.0.1]:50193 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hKuW9-0000za-Vy for patchwork-qemu-devel@patchwork.kernel.org; Sun, 28 Apr 2019 20:51:38 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35962) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hKuUu-0007yY-Sm for qemu-devel@nongnu.org; Sun, 28 Apr 2019 20:50:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hKuUt-0003Q6-DS for qemu-devel@nongnu.org; Sun, 28 Apr 2019 20:50:20 -0400 Received: from smtpbg444.qq.com ([183.3.255.70]:53817 helo=qq.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hKuUs-0003OX-PW for qemu-devel@nongnu.org; Sun, 28 Apr 2019 20:50:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1556499011; bh=dqvlNrFHF0QzJ9M/Wv6KFcc8KkDVEUdemKH5UxHNPkg=; h=From:To:Subject:Date:Message-Id; b=e2QDdsONAnJccJZ45g12j7Pi/sD6r7o+aHkGNPC5ZI26h9iH1CEgU6kMLAG0oW9wi bwqbPLnDyf3kCYB/WhUrAsSj43F1qrgcM29Qka7knSgaptUXBJAFZ9JjiSY+HjxqUz wWr4ER2QApM8cMnCxXcM21XPESGuPkeHA/3GTZIE= X-QQ-mid: esmtp7t1556498004tpl5bojps Received: from localhost (unknown [183.63.119.27]) by esmtp4.qq.com (ESMTP) with id ; Mon, 29 Apr 2019 08:33:23 +0800 (CST) X-QQ-SSF: B100000000000030F7F00F00000000O X-QQ-FEAT: 6ugjij1k5i9hVwgfwgz5ACZ6LpJ71RRgvOgafeJq5MsTn2uqeQQ4ZBl5/UASU yF4W4AHt803cFe9BVc7RTelwTGtIVlkVsotR+mAHGUgWARUKIcWk4MuqWIs1/qUv19R6TZS +APvePOfPG+n49DFmgqqPfupzk2swAWbPHkgyhUzX70wnGnZdMyiQwAbOPYJC8GXXyTyCrK vJPzrUUrDIkUJb2MNbC/pjym+iUB1Wo2go7XrZlMouVkC0V9UFwc6RwwBo2ZBcxWt4Z7e95 lfU3usJmMk1vjnb5ZLJjqvTRfITZhh0DgU2w== X-QQ-GoodBg: 0 From: driver1998 To: qemu-devel@nongnu.org Date: Mon, 29 Apr 2019 00:33:22 +0000 Message-Id: <20190429003322.22908-1-driver1998@foxmail.com> X-Mailer: git-send-email 2.17.1 X-QQ-SENDSIZE: 520 Feedback-ID: esmtp:foxmail.com:bgweb:bgweb117 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 183.3.255.70 Subject: [Qemu-devel] [PATCH 3/4] util/cacheinfo.c: Use uintptr_t instead of unsigned long in AArch64 arch_cache_info() 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: driver1998 Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Windows ARM64 uses LLP64 model, which breaks current assumptions. Signed-off-by: driver1998 --- util/cacheinfo.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/util/cacheinfo.c b/util/cacheinfo.c index 3cd080b83d..a815cb0722 100644 --- a/util/cacheinfo.c +++ b/util/cacheinfo.c @@ -107,7 +107,7 @@ static void sys_cache_info(int *isize, int *dsize) static void arch_cache_info(int *isize, int *dsize) { if (*isize == 0 || *dsize == 0) { - unsigned long ctr; + uintptr_t ctr; /* The real cache geometry is in CCSIDR_EL1/CLIDR_EL1/CSSELR_EL1, but (at least under Linux) these are marked protected by the @@ -120,6 +120,8 @@ static void arch_cache_info(int *isize, int *dsize) if (*dsize == 0) { *dsize = 4 << ((ctr >> 16) & 0xf); } + + printf("%d %d\n", *isize, *dsize); } } From patchwork Mon Apr 29 00:33:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cao Jiaxi X-Patchwork-Id: 10921081 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 230BD14D5 for ; Mon, 29 Apr 2019 00:50:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1087E286F3 for ; Mon, 29 Apr 2019 00:50:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 04E9C286D4; Mon, 29 Apr 2019 00:50:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 42AEA286E2 for ; Mon, 29 Apr 2019 00:50:08 +0000 (UTC) Received: from localhost ([127.0.0.1]:50161 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hKuUh-0007jL-74 for patchwork-qemu-devel@patchwork.kernel.org; Sun, 28 Apr 2019 20:50:07 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33681) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hKuIb-0007js-1v for qemu-devel@nongnu.org; Sun, 28 Apr 2019 20:37:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hKuEu-0003Di-QN for qemu-devel@nongnu.org; Sun, 28 Apr 2019 20:33:49 -0400 Received: from smtpbgeu2.qq.com ([18.194.254.142]:58104) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hKuEu-0003Co-HZ for qemu-devel@nongnu.org; Sun, 28 Apr 2019 20:33:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1556498021; bh=OQUpm2nii0l0T7ZEKjxuy7zi4jinxy/6ImWCIvZNhCk=; h=From:To:Subject:Date:Message-Id; b=G4Bra5hPvQagCaAqKfjYvKCZICN1tqByoUKirWHqNWgdOJYhq0PnTiTLVBxmZc1xU 5zkMv94XKLKQfmrGFaZowyGI9K83kFi3X2RSbngK+yEhLGvOjyu5X4PAq28EhPpMcK zA7gWyN78E7155higXW6SCSzeMn8OdtTsG1yhCFg= X-QQ-mid: esmtp6t1556498020t34rq6i76 Received: from localhost (unknown [183.63.119.27]) by esmtp4.qq.com (ESMTP) with id ; Mon, 29 Apr 2019 08:33:40 +0800 (CST) X-QQ-SSF: B100000000000030F7F00F00000000O X-QQ-FEAT: 7DSX613YSL5DqXSjOqoxYZ1SQOvSPGNf5qMZ+hWJ/Ke2KpWrdWBm722tMJbrO eS3QzTgT4A8fqPBBRp6JryMAB+66ziGLjii2cCdVO/Bi7eBrzCHjkWi3pO+Oycq69xESEEH Vz2N6L/LhzHKmvLxbG/wxlhjlLDH6CBRzBJbyi5ZxDkWpMYkKEo0nvl+Ey9DXiWglQbZ/Jz PKHarQLKJjDKAcyHO5OkUUnjXs6r2/S7d9M7PqzHTRpRM/3AQlFuQKfYOwmt8ZhSl9NgZb8 bUm1Y6GxB/aavMAva2cAKqHxrj/tzd17Q+gw== X-QQ-GoodBg: 0 From: driver1998 To: qemu-devel@nongnu.org Date: Mon, 29 Apr 2019 00:33:39 +0000 Message-Id: <20190429003339.22956-1-driver1998@foxmail.com> X-Mailer: git-send-email 2.17.1 X-QQ-SENDSIZE: 520 Feedback-ID: esmtp:foxmail.com:bgforeign:bgforeign4 X-QQ-Bgrelay: 1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 18.194.254.142 X-Mailman-Approved-At: Sun, 28 Apr 2019 20:49:02 -0400 Subject: [Qemu-devel] [PATCH 4/4] include/qemu/osdep.h: Move the __USE_MINGW_ANSI_STDIO define up to avoid confliction. 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: driver1998 Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: driver1998 --- include/qemu/osdep.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 303d315c5d..af2b91f0b8 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -85,17 +85,17 @@ extern int daemon(int, int); #endif #endif +/* enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later) */ +#ifdef __MINGW32__ +#define __USE_MINGW_ANSI_STDIO 1 +#endif + #include #include #include #include #include #include - -/* enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later) */ -#ifdef __MINGW32__ -#define __USE_MINGW_ANSI_STDIO 1 -#endif #include #include