From nobody Fri May 3 02:58:21 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1507235944620104.54478481817341; Thu, 5 Oct 2017 13:39:04 -0700 (PDT) Received: from localhost ([::1]:41946 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0Cuu-0002ek-LR for importer@patchew.org; Thu, 05 Oct 2017 16:38:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48723) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0Csx-0001TI-3i for qemu-devel@nongnu.org; Thu, 05 Oct 2017 16:36:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0Cst-000055-EN for qemu-devel@nongnu.org; Thu, 05 Oct 2017 16:36:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51730) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e0Cst-0008WA-8H for qemu-devel@nongnu.org; Thu, 05 Oct 2017 16:36:43 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4B5AF4A6EF; Thu, 5 Oct 2017 20:36:42 +0000 (UTC) Received: from localhost (ovpn-116-25.gru2.redhat.com [10.97.116.25]) by smtp.corp.redhat.com (Postfix) with ESMTP id D3F9660BE6; Thu, 5 Oct 2017 20:36:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4B5AF4A6EF Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Thu, 5 Oct 2017 17:36:30 -0300 Message-Id: <20171005203638.19255-2-ehabkost@redhat.com> In-Reply-To: <20171005203638.19255-1-ehabkost@redhat.com> References: <20171005203638.19255-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 05 Oct 2017 20:36:42 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/9] hw/acpi-build: Make assignment statement of next_base easy to read 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: Dou Liyang , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Dou Liyang It may be hard to read the assignment statement of "next_base", so S/next_base +=3D (1ULL << 32) - pcms->below_4g_mem_size; /next_base =3D mem_base + mem_len; ... for readability. No functionality change. Signed-off-by: Dou Liyang Message-Id: <1504231805-30957-3-git-send-email-douly.fnst@cn.fujitsu.com> Signed-off-by: Eduardo Habkost --- hw/i386/acpi-build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 2af37a9129..73e3443bce 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -2381,7 +2381,7 @@ build_srat(GArray *table_data, BIOSLinker *linker, Ma= chineState *machine) } mem_base =3D 1ULL << 32; mem_len =3D next_base - pcms->below_4g_mem_size; - next_base +=3D (1ULL << 32) - pcms->below_4g_mem_size; + next_base =3D mem_base + mem_len; } numamem =3D acpi_data_push(table_data, sizeof *numamem); build_srat_memory(numamem, mem_base, mem_len, i - 1, --=20 2.13.6 From nobody Fri May 3 02:58:21 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1507235939668793.2323392511054; Thu, 5 Oct 2017 13:38:59 -0700 (PDT) Received: from localhost ([::1]:41947 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0Cuy-0002h2-2M for importer@patchew.org; Thu, 05 Oct 2017 16:38:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48727) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0Csx-0001TL-As for qemu-devel@nongnu.org; Thu, 05 Oct 2017 16:36:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0Csv-00006O-CH for qemu-devel@nongnu.org; Thu, 05 Oct 2017 16:36:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53786) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e0Csv-00005z-3V for qemu-devel@nongnu.org; Thu, 05 Oct 2017 16:36:45 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 20C4AC047B63; Thu, 5 Oct 2017 20:36:44 +0000 (UTC) Received: from localhost (ovpn-116-25.gru2.redhat.com [10.97.116.25]) by smtp.corp.redhat.com (Postfix) with ESMTP id ABEB35D9CB; Thu, 5 Oct 2017 20:36:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 20C4AC047B63 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Thu, 5 Oct 2017 17:36:31 -0300 Message-Id: <20171005203638.19255-3-ehabkost@redhat.com> In-Reply-To: <20171005203638.19255-1-ehabkost@redhat.com> References: <20171005203638.19255-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 05 Oct 2017 20:36:44 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 2/9] ACPI/unit-test: Add a new testcase for RAM allocation in numa node 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: Dou Liyang , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Dou Liyang As QEMU supports the memory-less node, it is possible that there is no RAM in the first numa node(also be called as node0). eg: ... \ -m 128,slots=3D3,maxmem=3D1G \ -numa node -numa node,mem=3D128M \ But, this makes it hard for QEMU to build a known-to-work ACPI SRAT table. Only fixing it is not enough. Add a testcase for this situation to make sure the ACPI table is correct for guest. Suggested-by: Eduardo Habkost Signed-off-by: Dou Liyang Message-Id: <1504231805-30957-4-git-send-email-douly.fnst@cn.fujitsu.com> Signed-off-by: Eduardo Habkost --- tests/bios-tables-test.c | 24 ++++++++++++++++++++++++ tests/acpi-test-data/pc/DSDT.numamem | Bin 0 -> 5104 bytes tests/acpi-test-data/pc/SRAT.numamem | Bin 0 -> 224 bytes tests/acpi-test-data/q35/DSDT.numamem | Bin 0 -> 7788 bytes tests/acpi-test-data/q35/SRAT.numamem | Bin 0 -> 224 bytes 5 files changed, 24 insertions(+) create mode 100644 tests/acpi-test-data/pc/DSDT.numamem create mode 100644 tests/acpi-test-data/pc/SRAT.numamem create mode 100644 tests/acpi-test-data/q35/DSDT.numamem create mode 100644 tests/acpi-test-data/q35/SRAT.numamem diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c index 564da45f65..f0923152ff 100644 --- a/tests/bios-tables-test.c +++ b/tests/bios-tables-test.c @@ -808,6 +808,28 @@ static void test_acpi_piix4_tcg_memhp(void) free_test_data(&data); } =20 +static void test_acpi_q35_tcg_numamem(void) +{ + test_data data; + + memset(&data, 0, sizeof(data)); + data.machine =3D MACHINE_Q35; + data.variant =3D ".numamem"; + test_acpi_one(" -numa node -numa node,mem=3D128", &data); + free_test_data(&data); +} + +static void test_acpi_piix4_tcg_numamem(void) +{ + test_data data; + + memset(&data, 0, sizeof(data)); + data.machine =3D MACHINE_PC; + data.variant =3D ".numamem"; + test_acpi_one(" -numa node -numa node,mem=3D128", &data); + free_test_data(&data); +} + int main(int argc, char *argv[]) { const char *arch =3D qtest_get_arch(); @@ -830,6 +852,8 @@ int main(int argc, char *argv[]) qtest_add_func("acpi/q35/cpuhp", test_acpi_q35_tcg_cphp); qtest_add_func("acpi/piix4/memhp", test_acpi_piix4_tcg_memhp); qtest_add_func("acpi/q35/memhp", test_acpi_q35_tcg_memhp); + qtest_add_func("acpi/piix4/numamem", test_acpi_piix4_tcg_numamem); + qtest_add_func("acpi/q35/numamem", test_acpi_q35_tcg_numamem); } ret =3D g_test_run(); boot_sector_cleanup(disk); diff --git a/tests/acpi-test-data/pc/DSDT.numamem b/tests/acpi-test-data/pc= /DSDT.numamem new file mode 100644 index 0000000000000000000000000000000000000000..bc703d77ee48720af1b801c518b= 43511c95c852d GIT binary patch literal 5104 zcmb7IZExE~5}qX~n_5aXWizjC8^LKVXmL&SlDFc3gC$b76k9SQ%DEh9oG8b|DMfK1 z(gvt&6i`&ab^ERG;xE-sw(qx*XF!z}jjPX%ajXzq&jTQFq zw)Zd3`{YZHwS3rmsXyOp`CsgNTR@obq*UN7;@fd>bkHW>7wH}lOw3;x+kz<+;?^`Xya)uvf@QYk*O7srT^929^Z z(63x0Z^&J@d%=3DE?%?G|FWMJruoz0sP@PWP*8-tlj#VIsH94;*3Ze&b}dmP>U!{4qE z3%vBYS9|OW!Z=3Dat1=3D2Sc+mq77{0X)+xWdGVZ3hlYIS{M^y2LNdbhD6aE$wxA%i+Vt_OfTwcvY}08l4PJ2-Q=3D9}7b8sV#4=3De38#LcV|M*sM#V>#9yxmCRb#$#4_CDp-{qY)9{PBnYsRh0J+mH1 zKs}S1;o4VI5D$`V2fn5`9>Zs)r#)|D%xxO?Y1-|sO=3DFmt%;AAdU;&}>q~cmRsk40k zs~L#PG0akqe;WSnfH51ML2`oJGg3{f;=3Dt!L=3DAB?>mQFSF$)!L(*L3O*`??)^fz_;D zq4}Zp;)Hd~-`{LKJ7zr_SkIz=3DDIGuw@R^_6V|!(JIv?C%;y60xe4>R2=3Dlq2 zd27-a9i_3C|w1tG&gG0m!lrDl#mvgwr8 z(ulMQjkJ+yR%#X12by%d#rHOYDuup;{v`{hUCCs!8S)^!&tpc)Y%Kp(>hXg%?3tNN z=3D8;jJ!WveHyO%ewE8=3D3K7|D04M3d8K%m=3DS`@nBLx-urykbFZGztgZGvqZ*@#exD&W zNreoj@*CwD(=3DlsmR2a;AS0R=3DmO%QXqd#b^Er&k*f1@5QRp zE1#qa_VaWqE}!H=3DIC7mHXftCpr`KF31=3D~4|IsON`COWuCFqBfleh$@dgp$z zs!&?t8N&}|D5jR$rv$?!tQHz6jjNzi?}b{eNf}N_0me)dgVHE6Xg~T8Pway#7z>!u zD|V?_%H(j*g0_pYn>JcsS4b6{^{o(hA zOd*oHie0wr;nMt?1cN)JPMzd}SMZ7%*!jG(iRPVrb8bpu=3DroRRH0M+WyFu*pP`XJP z3PAtU@$$LdYs-HzmqQ2cm8u(<5II6mc&x|t7*#{P4F#GT1}X z4-mKeu9F=3DKxZV;N$d2or;7C)@cEqj)LA0tk`~stZF1wu*L;69tFKA zSh;}mNT^`N#0wqJqM)|~YeGO1kx;>!6wqW8^tND~5zv`Ps9?ngF!Xgc3VKJd>H?}q zLIrC|KvPlB_XX>mfX+oi1?#+k&PPEDf)z7A49kdw3f40MdL{~56s%_j^lT(lu$~jp zb5T%Ju$~vt^N~=3D&dO<)hL_saVdQm_xMnVPaf`BeWK}&-54FP>45-M2V6wo)Lpv!{w zEdhNi5-M0P3FxKMphkJYx?gKZy~J)C@6tW0b&mo;M**u@D5Oacnk5vlB88d`38YEx zwl%zn_Z%!MLrEfOq*GAB;xN>at(zkq8N(w!)RDDYBORH;gF4iaz1yUl-ECua#am?0 z!2>5`yhl(z*5hrm=3Dit#1dTbU@KGy3b;~^0GbRZw=3Dmq^BR7Wz&gAM1mNF)@W6FOxmT z9MeiGn0^Um-1d>aLo(`(OVoJae}w3#J#8W0bsKCru(jB1F=3DCg2*ZH@DxXmUE`z~9*2k!U%mXRq Yf~!ZCL8t>-1O^}2VG2>z!9?-X08OU~0RR91 literal 0 HcmV?d00001 diff --git a/tests/acpi-test-data/q35/DSDT.numamem b/tests/acpi-test-data/q= 35/DSDT.numamem new file mode 100644 index 0000000000000000000000000000000000000000..fcb18d947b28c09c8b5a4fa6569= 2efb41ef3a5d9 GIT binary patch literal 7788 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 EKkzjyY5)KL literal 0 HcmV?d00001 diff --git a/tests/acpi-test-data/q35/SRAT.numamem b/tests/acpi-test-data/q= 35/SRAT.numamem new file mode 100644 index 0000000000000000000000000000000000000000..dbc595d9cb85d3fcb5a4243153f= 42bb431c9de8f GIT binary patch literal 224 zcmWFzatwLEz`(%x#mV2jB1F=3DCg2*ZH@DxXmUE`z~9*2k!U%mXRq Yf~!ZCL8t>-1O^}2VG2>z!9?-X08OU~0RR91 literal 0 HcmV?d00001 --=20 2.13.6 From nobody Fri May 3 02:58:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1507235948497369.67731221180463; Thu, 5 Oct 2017 13:39:08 -0700 (PDT) Received: from localhost ([::1]:41948 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0Cuz-0002i3-E9 for importer@patchew.org; Thu, 05 Oct 2017 16:38:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48738) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0Csy-0001Tj-O2 for qemu-devel@nongnu.org; Thu, 05 Oct 2017 16:36:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0Csx-00007O-Bv for qemu-devel@nongnu.org; Thu, 05 Oct 2017 16:36:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45508) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e0Csx-00006p-3q for qemu-devel@nongnu.org; Thu, 05 Oct 2017 16:36:47 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1E5933B721; Thu, 5 Oct 2017 20:36:46 +0000 (UTC) Received: from localhost (ovpn-116-25.gru2.redhat.com [10.97.116.25]) by smtp.corp.redhat.com (Postfix) with ESMTP id 95E465D764; Thu, 5 Oct 2017 20:36:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1E5933B721 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Thu, 5 Oct 2017 17:36:32 -0300 Message-Id: <20171005203638.19255-4-ehabkost@redhat.com> In-Reply-To: <20171005203638.19255-1-ehabkost@redhat.com> References: <20171005203638.19255-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 05 Oct 2017 20:36:46 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 3/9] qom/cpu: move cpu_model null check to cpu_class_by_name() 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, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 and clean every implementation. Suggested-by: Eduardo Habkost Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20170917232842.14544-1-f4bug@amsat.org> Reviewed-by: Igor Mammedov Reviewed-by: Laurent Vivier Reviewed-by: Artyom Tarasenko Signed-off-by: Eduardo Habkost --- qom/cpu.c | 7 ++++++- target/alpha/cpu.c | 6 +----- target/arm/cpu.c | 4 ---- target/cris/cpu.c | 4 ---- target/lm32/cpu.c | 4 ---- target/m68k/cpu.c | 4 ---- target/mips/cpu.c | 4 ---- target/moxie/cpu.c | 8 +------- target/openrisc/cpu.c | 4 ---- target/sh4/cpu.c | 3 --- target/sparc/cpu.c | 4 ---- target/tricore/cpu.c | 4 ---- target/unicore32/cpu.c | 4 ---- target/xtensa/cpu.c | 4 ---- 14 files changed, 8 insertions(+), 56 deletions(-) diff --git a/qom/cpu.c b/qom/cpu.c index 94fa8fe005..54c9452b1c 100644 --- a/qom/cpu.c +++ b/qom/cpu.c @@ -316,7 +316,12 @@ static bool cpu_common_has_work(CPUState *cs) =20 ObjectClass *cpu_class_by_name(const char *typename, const char *cpu_model) { - CPUClass *cc =3D CPU_CLASS(object_class_by_name(typename)); + CPUClass *cc; + + if (!cpu_model) { + return NULL; + } + cc =3D CPU_CLASS(object_class_by_name(typename)); =20 return cc->class_by_name(cpu_model); } diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index e6c6aabdf0..b8a21f4e01 100644 --- a/target/alpha/cpu.c +++ b/target/alpha/cpu.c @@ -127,14 +127,10 @@ static const AlphaCPUAlias alpha_cpu_aliases[] =3D { =20 static ObjectClass *alpha_cpu_class_by_name(const char *cpu_model) { - ObjectClass *oc =3D NULL; + ObjectClass *oc; char *typename; int i; =20 - if (cpu_model =3D=3D NULL) { - return NULL; - } - oc =3D object_class_by_name(cpu_model); if (oc !=3D NULL && object_class_dynamic_cast(oc, TYPE_ALPHA_CPU) !=3D= NULL && !object_class_is_abstract(oc)) { diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 4300de66e2..4b81d07b9d 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -913,10 +913,6 @@ static ObjectClass *arm_cpu_class_by_name(const char *= cpu_model) char *typename; char **cpuname; =20 - if (!cpu_model) { - return NULL; - } - cpuname =3D g_strsplit(cpu_model, ",", 1); typename =3D g_strdup_printf(ARM_CPU_TYPE_NAME("%s"), cpuname[0]); oc =3D object_class_by_name(typename); diff --git a/target/cris/cpu.c b/target/cris/cpu.c index ceebfed79b..88d93f2d11 100644 --- a/target/cris/cpu.c +++ b/target/cris/cpu.c @@ -69,10 +69,6 @@ static ObjectClass *cris_cpu_class_by_name(const char *c= pu_model) ObjectClass *oc; char *typename; =20 - if (cpu_model =3D=3D NULL) { - return NULL; - } - #if defined(CONFIG_USER_ONLY) if (strcasecmp(cpu_model, "any") =3D=3D 0) { return object_class_by_name("crisv32-" TYPE_CRIS_CPU); diff --git a/target/lm32/cpu.c b/target/lm32/cpu.c index 2b8c36b6d0..bf081f56d2 100644 --- a/target/lm32/cpu.c +++ b/target/lm32/cpu.c @@ -246,10 +246,6 @@ static ObjectClass *lm32_cpu_class_by_name(const char = *cpu_model) ObjectClass *oc; char *typename; =20 - if (cpu_model =3D=3D NULL) { - return NULL; - } - typename =3D g_strdup_printf("%s-" TYPE_LM32_CPU, cpu_model); oc =3D object_class_by_name(typename); g_free(typename); diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index 55bf24bae6..8c70e0805c 100644 --- a/target/m68k/cpu.c +++ b/target/m68k/cpu.c @@ -87,10 +87,6 @@ static ObjectClass *m68k_cpu_class_by_name(const char *c= pu_model) ObjectClass *oc; char *typename; =20 - if (cpu_model =3D=3D NULL) { - return NULL; - } - typename =3D g_strdup_printf("%s-" TYPE_M68K_CPU, cpu_model); oc =3D object_class_by_name(typename); g_free(typename); diff --git a/target/mips/cpu.c b/target/mips/cpu.c index 1a9a3ed94d..c15b894362 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -166,10 +166,6 @@ static ObjectClass *mips_cpu_class_by_name(const char = *cpu_model) ObjectClass *oc; char *typename; =20 - if (cpu_model =3D=3D NULL) { - return NULL; - } - typename =3D mips_cpu_type_name(cpu_model); oc =3D object_class_by_name(typename); g_free(typename); diff --git a/target/moxie/cpu.c b/target/moxie/cpu.c index 748d02f29e..30bd44fcad 100644 --- a/target/moxie/cpu.c +++ b/target/moxie/cpu.c @@ -89,13 +89,7 @@ static void moxie_cpu_initfn(Object *obj) =20 static ObjectClass *moxie_cpu_class_by_name(const char *cpu_model) { - ObjectClass *oc; - - if (cpu_model =3D=3D NULL) { - return NULL; - } - - oc =3D object_class_by_name(cpu_model); + ObjectClass *oc =3D object_class_by_name(cpu_model); if (oc !=3D NULL && (!object_class_dynamic_cast(oc, TYPE_MOXIE_CPU) || object_class_is_abstract(oc))) { return NULL; diff --git a/target/openrisc/cpu.c b/target/openrisc/cpu.c index a979f0bf8b..af9cdcc102 100644 --- a/target/openrisc/cpu.c +++ b/target/openrisc/cpu.c @@ -108,10 +108,6 @@ static ObjectClass *openrisc_cpu_class_by_name(const c= har *cpu_model) ObjectClass *oc; char *typename; =20 - if (cpu_model =3D=3D NULL) { - return NULL; - } - typename =3D g_strdup_printf("%s-" TYPE_OPENRISC_CPU, cpu_model); oc =3D object_class_by_name(typename); g_free(typename); diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index 6ce7cba5a9..252440e019 100644 --- a/target/sh4/cpu.c +++ b/target/sh4/cpu.c @@ -133,9 +133,6 @@ static ObjectClass *superh_cpu_class_by_name(const char= *cpu_model) ObjectClass *oc; GSList *list, *item; =20 - if (cpu_model =3D=3D NULL) { - return NULL; - } if (strcasecmp(cpu_model, "any") =3D=3D 0) { return object_class_by_name(TYPE_SH7750R_CPU); } diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index 0806d699e6..beab90f3e6 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -730,10 +730,6 @@ static ObjectClass *sparc_cpu_class_by_name(const char= *cpu_model) ObjectClass *oc; char *typename; =20 - if (cpu_model =3D=3D NULL) { - return NULL; - } - typename =3D sparc_cpu_type_name(cpu_model); oc =3D object_class_by_name(typename); g_free(typename); diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c index 5ab5b56454..871eb35453 100644 --- a/target/tricore/cpu.c +++ b/target/tricore/cpu.c @@ -120,10 +120,6 @@ static ObjectClass *tricore_cpu_class_by_name(const ch= ar *cpu_model) ObjectClass *oc; char *typename; =20 - if (!cpu_model) { - return NULL; - } - typename =3D g_strdup_printf("%s-" TYPE_TRICORE_CPU, cpu_model); oc =3D object_class_by_name(typename); g_free(typename); diff --git a/target/unicore32/cpu.c b/target/unicore32/cpu.c index c9b78ce68e..138acc9dd8 100644 --- a/target/unicore32/cpu.c +++ b/target/unicore32/cpu.c @@ -44,10 +44,6 @@ static ObjectClass *uc32_cpu_class_by_name(const char *c= pu_model) ObjectClass *oc; char *typename; =20 - if (cpu_model =3D=3D NULL) { - return NULL; - } - typename =3D g_strdup_printf("%s-" TYPE_UNICORE32_CPU, cpu_model); oc =3D object_class_by_name(typename); g_free(typename); diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index 85897df0a8..dcdc765a86 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -83,10 +83,6 @@ static ObjectClass *xtensa_cpu_class_by_name(const char = *cpu_model) ObjectClass *oc; char *typename; =20 - if (cpu_model =3D=3D NULL) { - return NULL; - } - typename =3D g_strdup_printf("%s-" TYPE_XTENSA_CPU, cpu_model); oc =3D object_class_by_name(typename); g_free(typename); --=20 2.13.6 From nobody Fri May 3 02:58:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 15072360799591003.1344610769306; Thu, 5 Oct 2017 13:41:19 -0700 (PDT) Received: from localhost ([::1]:41959 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0CxB-0004aW-5I for importer@patchew.org; Thu, 05 Oct 2017 16:41:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48765) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0Ct0-0001Uy-5Z for qemu-devel@nongnu.org; Thu, 05 Oct 2017 16:36:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0Csz-00008Z-4o for qemu-devel@nongnu.org; Thu, 05 Oct 2017 16:36:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53950) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e0Csy-00007x-Tf for qemu-devel@nongnu.org; Thu, 05 Oct 2017 16:36:49 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F282DC047B66; Thu, 5 Oct 2017 20:36:47 +0000 (UTC) Received: from localhost (ovpn-116-25.gru2.redhat.com [10.97.116.25]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7BD3460618; Thu, 5 Oct 2017 20:36:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com F282DC047B66 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Thu, 5 Oct 2017 17:36:33 -0300 Message-Id: <20171005203638.19255-5-ehabkost@redhat.com> In-Reply-To: <20171005203638.19255-1-ehabkost@redhat.com> References: <20171005203638.19255-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 05 Oct 2017 20:36:48 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 4/9] machine: Add a valid_cpu_types property 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, Alistair Francis Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Alistair Francis This patch add a MachineClass element that can be set in the machine C code to specify a list of supported CPU types. If the supported CPU types are specified the user enter CPU (by -cpu at runtime) is checked against the supported types and QEMU exits if they aren't supported. Signed-off-by: Alistair Francis Message-Id: [ehabkost: removed assert(), rewrote comment] Signed-off-by: Eduardo Habkost --- include/hw/boards.h | 1 + hw/core/machine.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/include/hw/boards.h b/include/hw/boards.h index 156e0a5701..191a5b3cd8 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -191,6 +191,7 @@ struct MachineClass { bool has_hotpluggable_cpus; bool ignore_memory_transaction_failures; int numa_mem_align_shift; + const char **valid_cpu_types; void (*numa_auto_assign_ram)(MachineClass *mc, NodeInfo *nodes, int nb_nodes, ram_addr_t size); =20 diff --git a/hw/core/machine.c b/hw/core/machine.c index 80647edc2a..36c2fb069c 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -758,6 +758,38 @@ void machine_run_board_init(MachineState *machine) if (nb_numa_nodes) { machine_numa_finish_init(machine); } + + /* If the machine supports the valid_cpu_types check and the user + * specified a CPU with -cpu check here that the user CPU is supported. + */ + if (machine_class->valid_cpu_types && machine->cpu_type) { + ObjectClass *class =3D object_class_by_name(machine->cpu_type); + int i; + + for (i =3D 0; machine_class->valid_cpu_types[i]; i++) { + if (object_class_dynamic_cast(class, + machine_class->valid_cpu_types[i= ])) { + /* The user specificed CPU is in the valid field, we are + * good to go. + */ + break; + } + } + + if (!machine_class->valid_cpu_types[i]) { + /* The user specified CPU is not valid */ + error_report("Invalid CPU type: %s", machine->cpu_type); + error_printf("The valid types are: %s", + machine_class->valid_cpu_types[0]); + for (i =3D 1; machine_class->valid_cpu_types[i]; i++) { + error_printf(", %s", machine_class->valid_cpu_types[i]); + } + error_printf("\n"); + + exit(1); + } + } + machine_class->init(machine); } =20 --=20 2.13.6 From nobody Fri May 3 02:58:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 150723618894843.03770903193936; Thu, 5 Oct 2017 13:43:08 -0700 (PDT) Received: from localhost ([::1]:41965 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0Cz0-00063c-6P for importer@patchew.org; Thu, 05 Oct 2017 16:43:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48780) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0Ct1-0001Wf-Vu for qemu-devel@nongnu.org; Thu, 05 Oct 2017 16:36:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0Ct1-0000AJ-0q for qemu-devel@nongnu.org; Thu, 05 Oct 2017 16:36:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41218) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e0Ct0-00009a-Qk for qemu-devel@nongnu.org; Thu, 05 Oct 2017 16:36:50 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C3D6B2C96F4; Thu, 5 Oct 2017 20:36:49 +0000 (UTC) Received: from localhost (ovpn-116-25.gru2.redhat.com [10.97.116.25]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5E16D5D9C0; Thu, 5 Oct 2017 20:36:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C3D6B2C96F4 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Thu, 5 Oct 2017 17:36:34 -0300 Message-Id: <20171005203638.19255-6-ehabkost@redhat.com> In-Reply-To: <20171005203638.19255-1-ehabkost@redhat.com> References: <20171005203638.19255-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 05 Oct 2017 20:36:49 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 5/9] vl: Eliminate defconfig variable 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 Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Both -nodefconfig and -no-user-config options do the same thing today, we only need one variable to keep track of them. Suggested-by: Markus Armbruster Acked-by: Alistair Francis Reviewed-by: Markus Armbruster Signed-off-by: Eduardo Habkost Message-Id: <20171004030025.7866-2-ehabkost@redhat.com> Reviewed-by: Daniel P. Berrange Signed-off-by: Eduardo Habkost --- vl.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/vl.c b/vl.c index 3fed457921..ebea42e0ea 100644 --- a/vl.c +++ b/vl.c @@ -3111,7 +3111,6 @@ int main(int argc, char **argv, char **envp) const char *qtest_log =3D NULL; const char *pid_file =3D NULL; const char *incoming =3D NULL; - bool defconfig =3D true; bool userconfig =3D true; bool nographic =3D false; DisplayType display_type =3D DT_DEFAULT; @@ -3213,8 +3212,6 @@ int main(int argc, char **argv, char **envp) popt =3D lookup_opt(argc, argv, &optarg, &optind); switch (popt->index) { case QEMU_OPTION_nodefconfig: - defconfig =3D false; - break; case QEMU_OPTION_nouserconfig: userconfig =3D false; break; @@ -3222,7 +3219,7 @@ int main(int argc, char **argv, char **envp) } } =20 - if (defconfig && userconfig) { + if (userconfig) { if (qemu_read_default_config_file() < 0) { exit(1); } --=20 2.13.6 From nobody Fri May 3 02:58:21 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1507236143996389.75351603782985; Thu, 5 Oct 2017 13:42:23 -0700 (PDT) Received: from localhost ([::1]:41961 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0Cy7-0005MN-9I for importer@patchew.org; Thu, 05 Oct 2017 16:42:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48820) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0Ct8-0001eo-6L for qemu-devel@nongnu.org; Thu, 05 Oct 2017 16:36:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0Ct3-0000BU-5B for qemu-devel@nongnu.org; Thu, 05 Oct 2017 16:36:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54212) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e0Ct2-0000Ap-RI for qemu-devel@nongnu.org; Thu, 05 Oct 2017 16:36:53 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8E45AC047B63; Thu, 5 Oct 2017 20:36:51 +0000 (UTC) Received: from localhost (ovpn-116-25.gru2.redhat.com [10.97.116.25]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2375960619; Thu, 5 Oct 2017 20:36:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8E45AC047B63 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Thu, 5 Oct 2017 17:36:35 -0300 Message-Id: <20171005203638.19255-7-ehabkost@redhat.com> In-Reply-To: <20171005203638.19255-1-ehabkost@redhat.com> References: <20171005203638.19255-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 05 Oct 2017 20:36:51 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 6/9] qemu-options: Deprecate -nodefconfig 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, Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Since 2012 (commit ba6212d8 "Eliminate cpus-x86_64.conf file") we have no default config files that would be disabled using -nodefconfig. Update documentation and document -nodefconfig as deprecated. Cc: Markus Armbruster Acked-by: Alistair Francis Signed-off-by: Eduardo Habkost Message-Id: <20171004030025.7866-3-ehabkost@redhat.com> Reviewed-by: Markus Armbruster Reviewed-by: Daniel P. Berrange Signed-off-by: Eduardo Habkost --- qemu-doc.texi | 4 ++++ qemu-options.hx | 17 ++++------------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/qemu-doc.texi b/qemu-doc.texi index ecd186a159..d8bb2c664f 100644 --- a/qemu-doc.texi +++ b/qemu-doc.texi @@ -2496,6 +2496,10 @@ would automatically enable USB support on the machin= e type. If using the new syntax, USB support must be explicitly enabled via the ``-machine usb=3Don'' argument. =20 +@subsection -nodefconfig (since 2.11.0) + +The ``-nodefconfig`` argument is a synonym for ``-no-user-config``. + @section qemu-img command line arguments =20 @subsection convert -s (since 2.0.0) diff --git a/qemu-options.hx b/qemu-options.hx index 39225ae6c3..981742d191 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -4067,26 +4067,17 @@ Write device configuration to @var{file}. The @var{= file} can be either filename command line and device configuration into file or dash @code{-}) characte= r to print the output to stdout. This can be later used as input file for @code{-readconf= ig} option. ETEXI -DEF("nodefconfig", 0, QEMU_OPTION_nodefconfig, - "-nodefconfig\n" - " do not load default config files at startup\n", - QEMU_ARCH_ALL) -STEXI -@item -nodefconfig -@findex -nodefconfig -Normally QEMU loads configuration files from @var{sysconfdir} and @var{dat= adir} at startup. -The @code{-nodefconfig} option will prevent QEMU from loading any of those= config files. -ETEXI +HXCOMM Deprecated, same as -no-user-config +DEF("nodefconfig", 0, QEMU_OPTION_nodefconfig, "", QEMU_ARCH_ALL) DEF("no-user-config", 0, QEMU_OPTION_nouserconfig, "-no-user-config\n" - " do not load user-provided config files at startup\n", + " do not load default user-provided config files at sta= rtup\n", QEMU_ARCH_ALL) STEXI @item -no-user-config @findex -no-user-config The @code{-no-user-config} option makes QEMU not load any of the user-prov= ided -config files on @var{sysconfdir}, but won't make it skip the QEMU-provided= config -files from @var{datadir}. +config files on @var{sysconfdir}. ETEXI DEF("trace", HAS_ARG, QEMU_OPTION_trace, "-trace [[enable=3D]][,events=3D][,file=3D]\n" --=20 2.13.6 From nobody Fri May 3 02:58:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1507236300466634.6893659890312; Thu, 5 Oct 2017 13:45:00 -0700 (PDT) Received: from localhost ([::1]:41974 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0D0Z-0007DR-5b for importer@patchew.org; Thu, 05 Oct 2017 16:44:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48823) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0Ct8-0001er-7I for qemu-devel@nongnu.org; Thu, 05 Oct 2017 16:36:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0Ct4-0000D7-Kq for qemu-devel@nongnu.org; Thu, 05 Oct 2017 16:36:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52184) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e0Ct4-0000C8-Bw for qemu-devel@nongnu.org; Thu, 05 Oct 2017 16:36:54 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6A5004ACC7; Thu, 5 Oct 2017 20:36:53 +0000 (UTC) Received: from localhost (ovpn-116-25.gru2.redhat.com [10.97.116.25]) by smtp.corp.redhat.com (Postfix) with ESMTP id 02CD95D966; Thu, 5 Oct 2017 20:36:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6A5004ACC7 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Thu, 5 Oct 2017 17:36:36 -0300 Message-Id: <20171005203638.19255-8-ehabkost@redhat.com> In-Reply-To: <20171005203638.19255-1-ehabkost@redhat.com> References: <20171005203638.19255-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 05 Oct 2017 20:36:53 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 7/9] config: qemu_config_parse() return number of config groups 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 Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Change qemu_config_parse() to return the number of config groups in success and -EINVAL on error. This will allow callers of qemu_config_parse() to check if something was really loaded from the config file. All existing callers of qemu_config_parse() and qemu_read_config_file() only check if the return value was negative, so the change shouldn't affect them. Reviewed-by: Markus Armbruster Reviewed-by: Eric Blake Signed-off-by: Eduardo Habkost Message-Id: <20171004025043.3788-2-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- block/blkdebug.c | 1 - util/qemu-config.c | 15 +++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/block/blkdebug.c b/block/blkdebug.c index 46e53f2f09..dfdf9b91aa 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -244,7 +244,6 @@ static int read_config(BDRVBlkdebugState *s, const char= *filename, ret =3D qemu_config_parse(f, config_groups, filename); if (ret < 0) { error_setg(errp, "Could not parse blkdebug config file"); - ret =3D -EINVAL; goto fail; } } diff --git a/util/qemu-config.c b/util/qemu-config.c index 405dd1a1d7..99b0e46fa3 100644 --- a/util/qemu-config.c +++ b/util/qemu-config.c @@ -385,6 +385,7 @@ void qemu_config_write(FILE *fp) } } =20 +/* Returns number of config groups on success, -errno on error */ int qemu_config_parse(FILE *fp, QemuOptsList **lists, const char *fname) { char line[1024], group[64], id[64], arg[64], value[1024]; @@ -392,7 +393,8 @@ int qemu_config_parse(FILE *fp, QemuOptsList **lists, c= onst char *fname) QemuOptsList *list =3D NULL; Error *local_err =3D NULL; QemuOpts *opts =3D NULL; - int res =3D -1, lno =3D 0; + int res =3D -EINVAL, lno =3D 0; + int count =3D 0; =20 loc_push_none(&loc); while (fgets(line, sizeof(line), fp) !=3D NULL) { @@ -413,6 +415,7 @@ int qemu_config_parse(FILE *fp, QemuOptsList **lists, c= onst char *fname) goto out; } opts =3D qemu_opts_create(list, id, 1, NULL); + count++; continue; } if (sscanf(line, "[%63[^]]]", group) =3D=3D 1) { @@ -423,6 +426,7 @@ int qemu_config_parse(FILE *fp, QemuOptsList **lists, c= onst char *fname) goto out; } opts =3D qemu_opts_create(list, NULL, 0, &error_abort); + count++; continue; } value[0] =3D '\0'; @@ -447,7 +451,7 @@ int qemu_config_parse(FILE *fp, QemuOptsList **lists, c= onst char *fname) error_report("error reading file"); goto out; } - res =3D 0; + res =3D count; out: loc_pop(&loc); return res; @@ -464,12 +468,7 @@ int qemu_read_config_file(const char *filename) =20 ret =3D qemu_config_parse(f, vm_config_groups, filename); fclose(f); - - if (ret =3D=3D 0) { - return 0; - } else { - return -EINVAL; - } + return ret; } =20 static void config_parse_qdict_section(QDict *options, QemuOptsList *opts, --=20 2.13.6 From nobody Fri May 3 02:58:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1507236079935622.4876296976979; Thu, 5 Oct 2017 13:41:19 -0700 (PDT) Received: from localhost ([::1]:41960 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0CxF-0004ca-MN for importer@patchew.org; Thu, 05 Oct 2017 16:41:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48821) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0Ct8-0001eq-6g for qemu-devel@nongnu.org; Thu, 05 Oct 2017 16:36:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0Ct6-0000Ez-BH for qemu-devel@nongnu.org; Thu, 05 Oct 2017 16:36:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57690) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e0Ct6-0000E1-4F for qemu-devel@nongnu.org; Thu, 05 Oct 2017 16:36:56 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 337FF7AE97; Thu, 5 Oct 2017 20:36:55 +0000 (UTC) Received: from localhost (ovpn-116-25.gru2.redhat.com [10.97.116.25]) by smtp.corp.redhat.com (Postfix) with ESMTP id C1D8C5D764; Thu, 5 Oct 2017 20:36:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 337FF7AE97 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Thu, 5 Oct 2017 17:36:37 -0300 Message-Id: <20171005203638.19255-9-ehabkost@redhat.com> In-Reply-To: <20171005203638.19255-1-ehabkost@redhat.com> References: <20171005203638.19255-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 05 Oct 2017 20:36:55 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 8/9] qom: update doc comment for type_register[_static]() 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: Igor Mammedov , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Igor Mammedov type_register()/type_register_static() functions in current impl. can't fail returning 0, also none of the users check for error so update doc comment to reflect current behaviour. Suggested-by: Eduardo Habkost Signed-off-by: Igor Mammedov Message-Id: <1507111682-66171-2-git-send-email-imammedo@redhat.com> Reviewed-by: Eduardo Habkost Signed-off-by: Eduardo Habkost --- include/qom/object.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index e0d9824415..a707b67781 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -773,7 +773,7 @@ const char *object_get_typename(const Object *obj); * @info and all of the strings it points to should exist for the life time * that the type is registered. * - * Returns: 0 on failure, the new #Type on success. + * Returns: the new #Type. */ Type type_register_static(const TypeInfo *info); =20 @@ -784,7 +784,7 @@ Type type_register_static(const TypeInfo *info); * Unlike type_register_static(), this call does not require @info or its * string members to continue to exist after the call returns. * - * Returns: 0 on failure, the new #Type on success. + * Returns: the new #Type. */ Type type_register(const TypeInfo *info); =20 --=20 2.13.6 From nobody Fri May 3 02:58:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1507236243067263.5524491692254; Thu, 5 Oct 2017 13:44:03 -0700 (PDT) Received: from localhost ([::1]:41967 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0Czi-0006b2-34 for importer@patchew.org; Thu, 05 Oct 2017 16:43:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48840) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0Ct9-0001fq-6v for qemu-devel@nongnu.org; Thu, 05 Oct 2017 16:37:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0Ct8-0000GW-6m for qemu-devel@nongnu.org; Thu, 05 Oct 2017 16:36:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51804) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e0Ct8-0000Fv-1D for qemu-devel@nongnu.org; Thu, 05 Oct 2017 16:36:58 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 15E5A61464; Thu, 5 Oct 2017 20:36:57 +0000 (UTC) Received: from localhost (ovpn-116-25.gru2.redhat.com [10.97.116.25]) by smtp.corp.redhat.com (Postfix) with ESMTP id 938FB5D764; Thu, 5 Oct 2017 20:36:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 15E5A61464 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Thu, 5 Oct 2017 17:36:38 -0300 Message-Id: <20171005203638.19255-10-ehabkost@redhat.com> In-Reply-To: <20171005203638.19255-1-ehabkost@redhat.com> References: <20171005203638.19255-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 05 Oct 2017 20:36:57 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 9/9] x86: Correct translation of some rdgsbase and wrgsbase encodings 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, Todd Eisenberger Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Todd Eisenberger It looks like there was a transcription error when writing this code initially. The code previously only decoded src or dst of rax. This resolves https://bugs.launchpad.net/qemu/+bug/1719984. Signed-off-by: Todd Eisenberger Message-Id: Reviewed-by: Richard Henderson Signed-off-by: Eduardo Habkost --- target/i386/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/i386/translate.c b/target/i386/translate.c index a8986f4c1a..7b920115f9 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -8155,9 +8155,9 @@ static target_ulong disas_insn(DisasContext *s, CPUSt= ate *cpu) break; =20 case 0xc0 ... 0xc7: /* rdfsbase (f3 0f ae /0) */ - case 0xc8 ... 0xc8: /* rdgsbase (f3 0f ae /1) */ + case 0xc8 ... 0xcf: /* rdgsbase (f3 0f ae /1) */ case 0xd0 ... 0xd7: /* wrfsbase (f3 0f ae /2) */ - case 0xd8 ... 0xd8: /* wrgsbase (f3 0f ae /3) */ + case 0xd8 ... 0xdf: /* wrgsbase (f3 0f ae /3) */ if (CODE64(s) && (prefixes & PREFIX_REPZ) && !(prefixes & PREFIX_LOCK) --=20 2.13.6