From nobody Sun May 5 14:10:00 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.zoho.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 1493979331015891.6457525658108; Fri, 5 May 2017 03:15:31 -0700 (PDT) Received: from localhost ([::1]:46046 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aGn-0003Q9-IS for importer@patchew.org; Fri, 05 May 2017 06:15:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46997) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aF6-0002CL-KI for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6aF3-0006aP-V7 for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54088) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d6aF3-0006a7-LP for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:41 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A6A863D954; Fri, 5 May 2017 10:13:40 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-116-145.ams2.redhat.com [10.36.116.145]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v45ADbkI026855; Fri, 5 May 2017 06:13:39 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A6A863D954 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=pass smtp.mailfrom=pbonzini@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com A6A863D954 From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 5 May 2017 12:13:17 +0200 Message-Id: <20170505101337.4650-2-pbonzini@redhat.com> In-Reply-To: <20170505101337.4650-1-pbonzini@redhat.com> References: <20170505101337.4650-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 05 May 2017 10:13:40 +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 01/21] hw/i386: Use Rev3 FADT (ACPI 2.0) instead of Rev1 to improve guest OS 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: Phil Dennis-Jordan 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: Phil Dennis-Jordan This updates the FADT generated for x86/64 machine types from Revision 1 to= 3. (Based on ACPI standard 2.0 instead of 1.0) The intention is to expose = the reset register information to guest operating systems which require it,= specifically OS X/macOS. Revision 1 FADTs do not contain the fields relati= ng to the reset register. The new layout and contents remains backwards-compatible with operating sys= tems which only support ACPI 1.0, as the existing fields are not modified b= y this change, as the 64-bit and 32-bit variants are allowed to co-exist ac= cording to the ACPI 2.0 standard. No regressions became apparent in tests w= ith a range of Windows (XP-10) and Linux versions. The BIOS tables test suite's FADT checksum test has also been updated to re= flect the new FADT layout and content. Signed-off-by: Phil Dennis-Jordan Message-Id: <1489558827-28971-2-git-send-email-phil@philjordan.eu> Signed-off-by: Paolo Bonzini --- hw/i386/acpi-build.c | 32 +++++++++++++++++-- include/hw/acpi/acpi-defs.h | 77 +++++++++++++++++++++--------------------= ---- tests/acpi-utils.h | 10 ++++++ tests/bios-tables-test.c | 23 +++++++++++--- 4 files changed, 93 insertions(+), 49 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 2073108577..7997f06823 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -272,7 +272,7 @@ build_facs(GArray *table_data, BIOSLinker *linker) } =20 /* Load chipset information in FADT */ -static void fadt_setup(AcpiFadtDescriptorRev1 *fadt, AcpiPmInfo *pm) +static void fadt_setup(AcpiFadtDescriptorRev3 *fadt, AcpiPmInfo *pm) { fadt->model =3D 1; fadt->reserved1 =3D 0; @@ -304,6 +304,28 @@ static void fadt_setup(AcpiFadtDescriptorRev1 *fadt, A= cpiPmInfo *pm) fadt->flags |=3D cpu_to_le32(1 << ACPI_FADT_F_FORCE_APIC_CLUSTER_M= ODEL); } fadt->century =3D RTC_CENTURY; + + fadt->flags |=3D cpu_to_le32(1 << ACPI_FADT_F_RESET_REG_SUP); + fadt->reset_value =3D 0xf; + fadt->reset_register.space_id =3D AML_SYSTEM_IO; + fadt->reset_register.bit_width =3D 8; + fadt->reset_register.address =3D cpu_to_le64(ICH9_RST_CNT_IOPORT); + + fadt->xpm1a_event_block.space_id =3D AML_SYSTEM_IO; + fadt->xpm1a_event_block.bit_width =3D fadt->pm1_evt_len * 8; + fadt->xpm1a_event_block.address =3D cpu_to_le64(pm->io_base); + + fadt->xpm1a_control_block.space_id =3D AML_SYSTEM_IO; + fadt->xpm1a_control_block.bit_width =3D fadt->pm1_cnt_len * 8; + fadt->xpm1a_control_block.address =3D cpu_to_le64(pm->io_base + 0x4); + + fadt->xpm_timer_block.space_id =3D AML_SYSTEM_IO; + fadt->xpm_timer_block.bit_width =3D fadt->pm_tmr_len * 8; + fadt->xpm_timer_block.address =3D cpu_to_le64(pm->io_base + 0x8); + + fadt->xgpe0_block.space_id =3D AML_SYSTEM_IO; + fadt->xgpe0_block.bit_width =3D pm->gpe0_blk_len * 8; + fadt->xgpe0_block.address =3D cpu_to_le64(pm->gpe0_blk); } =20 =20 @@ -313,9 +335,10 @@ build_fadt(GArray *table_data, BIOSLinker *linker, Acp= iPmInfo *pm, unsigned facs_tbl_offset, unsigned dsdt_tbl_offset, const char *oem_id, const char *oem_table_id) { - AcpiFadtDescriptorRev1 *fadt =3D acpi_data_push(table_data, sizeof(*fa= dt)); + AcpiFadtDescriptorRev3 *fadt =3D acpi_data_push(table_data, sizeof(*fa= dt)); unsigned fw_ctrl_offset =3D (char *)&fadt->firmware_ctrl - table_data-= >data; unsigned dsdt_entry_offset =3D (char *)&fadt->dsdt - table_data->data; + unsigned xdsdt_entry_offset =3D (char *)&fadt->Xdsdt - table_data->dat= a; =20 /* FACS address to be filled by Guest linker */ bios_linker_loader_add_pointer(linker, @@ -327,9 +350,12 @@ build_fadt(GArray *table_data, BIOSLinker *linker, Acp= iPmInfo *pm, bios_linker_loader_add_pointer(linker, ACPI_BUILD_TABLE_FILE, dsdt_entry_offset, sizeof(fadt->dsdt), ACPI_BUILD_TABLE_FILE, dsdt_tbl_offset); + bios_linker_loader_add_pointer(linker, + ACPI_BUILD_TABLE_FILE, xdsdt_entry_offset, sizeof(fadt->Xdsdt), + ACPI_BUILD_TABLE_FILE, dsdt_tbl_offset); =20 build_header(linker, table_data, - (void *)fadt, "FACP", sizeof(*fadt), 1, oem_id, oem_table= _id); + (void *)fadt, "FACP", sizeof(*fadt), 3, oem_id, oem_table= _id); } =20 void pc_madt_cpu_entry(AcpiDeviceIf *adev, int uid, diff --git a/include/hw/acpi/acpi-defs.h b/include/hw/acpi/acpi-defs.h index 4cc3630e61..293ee4524b 100644 --- a/include/hw/acpi/acpi-defs.h +++ b/include/hw/acpi/acpi-defs.h @@ -131,17 +131,37 @@ typedef struct AcpiTableHeader AcpiTableHeader; uint8_t duty_width; /* Bit width of duty cycle field in p_cnt reg *= / \ uint8_t day_alrm; /* Index to day-of-month alarm in RTC CMOS RAM = */ \ uint8_t mon_alrm; /* Index to month-of-year alarm in RTC CMOS RAM= */ \ - uint8_t century; /* Index to century in RTC CMOS RAM */ - -struct AcpiFadtDescriptorRev1 -{ - ACPI_FADT_COMMON_DEF - uint8_t reserved4; /* Reserved */ - uint8_t reserved4a; /* Reserved */ - uint8_t reserved4b; /* Reserved */ - uint32_t flags; -} QEMU_PACKED; -typedef struct AcpiFadtDescriptorRev1 AcpiFadtDescriptorRev1; + uint8_t century; /* Index to century in RTC CMOS RAM */ \ + /* IA-PC Boot Architecture Flags (see below for individual flags) */ \ + uint16_t boot_flags; \ + uint8_t reserved; /* Reserved, must be zero */ \ + /* Miscellaneous flag bits (see below for individual flags) */ \ + uint32_t flags; \ + /* 64-bit address of the Reset register */ \ + struct AcpiGenericAddress reset_register; \ + /* Value to write to the reset_register port to reset the system */ \ + uint8_t reset_value; \ + /* ARM-Specific Boot Flags (see below for individual flags) (ACPI 5.1)= */ \ + uint16_t arm_boot_flags; \ + uint8_t minor_revision; /* FADT Minor Revision (ACPI 5.1) */ \ + uint64_t Xfacs; /* 64-bit physical address of FACS */ \ + uint64_t Xdsdt; /* 64-bit physical address of DSDT */ \ + /* 64-bit Extended Power Mgt 1a Event Reg Blk address */ \ + struct AcpiGenericAddress xpm1a_event_block; \ + /* 64-bit Extended Power Mgt 1b Event Reg Blk address */ \ + struct AcpiGenericAddress xpm1b_event_block; \ + /* 64-bit Extended Power Mgt 1a Control Reg Blk address */ \ + struct AcpiGenericAddress xpm1a_control_block; \ + /* 64-bit Extended Power Mgt 1b Control Reg Blk address */ \ + struct AcpiGenericAddress xpm1b_control_block; \ + /* 64-bit Extended Power Mgt 2 Control Reg Blk address */ \ + struct AcpiGenericAddress xpm2_control_block; \ + /* 64-bit Extended Power Mgt Timer Ctrl Reg Blk address */ \ + struct AcpiGenericAddress xpm_timer_block; \ + /* 64-bit Extended General Purpose Event 0 Reg Blk address */ \ + struct AcpiGenericAddress xgpe0_block; \ + /* 64-bit Extended General Purpose Event 1 Reg Blk address */ \ + struct AcpiGenericAddress xgpe1_block; \ =20 struct AcpiGenericAddress { uint8_t space_id; /* Address space where struct or register exi= sts */ @@ -151,38 +171,13 @@ struct AcpiGenericAddress { uint64_t address; /* 64-bit address of struct or register */ } QEMU_PACKED; =20 +struct AcpiFadtDescriptorRev3 { + ACPI_FADT_COMMON_DEF +} QEMU_PACKED; +typedef struct AcpiFadtDescriptorRev3 AcpiFadtDescriptorRev3; + struct AcpiFadtDescriptorRev5_1 { ACPI_FADT_COMMON_DEF - /* IA-PC Boot Architecture Flags (see below for individual flags) */ - uint16_t boot_flags; - uint8_t reserved; /* Reserved, must be zero */ - /* Miscellaneous flag bits (see below for individual flags) */ - uint32_t flags; - /* 64-bit address of the Reset register */ - struct AcpiGenericAddress reset_register; - /* Value to write to the reset_register port to reset the system */ - uint8_t reset_value; - /* ARM-Specific Boot Flags (see below for individual flags) (ACPI 5.1)= */ - uint16_t arm_boot_flags; - uint8_t minor_revision; /* FADT Minor Revision (ACPI 5.1) */ - uint64_t Xfacs; /* 64-bit physical address of FACS */ - uint64_t Xdsdt; /* 64-bit physical address of DSDT */ - /* 64-bit Extended Power Mgt 1a Event Reg Blk address */ - struct AcpiGenericAddress xpm1a_event_block; - /* 64-bit Extended Power Mgt 1b Event Reg Blk address */ - struct AcpiGenericAddress xpm1b_event_block; - /* 64-bit Extended Power Mgt 1a Control Reg Blk address */ - struct AcpiGenericAddress xpm1a_control_block; - /* 64-bit Extended Power Mgt 1b Control Reg Blk address */ - struct AcpiGenericAddress xpm1b_control_block; - /* 64-bit Extended Power Mgt 2 Control Reg Blk address */ - struct AcpiGenericAddress xpm2_control_block; - /* 64-bit Extended Power Mgt Timer Ctrl Reg Blk address */ - struct AcpiGenericAddress xpm_timer_block; - /* 64-bit Extended General Purpose Event 0 Reg Blk address */ - struct AcpiGenericAddress xgpe0_block; - /* 64-bit Extended General Purpose Event 1 Reg Blk address */ - struct AcpiGenericAddress xgpe1_block; /* 64-bit Sleep Control register (ACPI 5.0) */ struct AcpiGenericAddress sleep_control; /* 64-bit Sleep Status register (ACPI 5.0) */ diff --git a/tests/acpi-utils.h b/tests/acpi-utils.h index 348e4d7931..f8d87236c6 100644 --- a/tests/acpi-utils.h +++ b/tests/acpi-utils.h @@ -87,6 +87,16 @@ typedef struct { g_assert_cmpstr(ACPI_ASSERT_CMP_str, =3D=3D, expected); \ } while (0) =20 +#define ACPI_READ_GENERIC_ADDRESS(field, addr) \ + do { \ + ACPI_READ_FIELD((field).space_id, addr); \ + ACPI_READ_FIELD((field).bit_width, addr); \ + ACPI_READ_FIELD((field).bit_offset, addr); \ + ACPI_READ_FIELD((field).access_width, addr); \ + ACPI_READ_FIELD((field).address, addr); \ + } while (0); + + uint8_t acpi_calc_checksum(const uint8_t *data, int len); uint32_t acpi_find_rsdp_address(void); void acpi_parse_rsdp_table(uint32_t addr, AcpiRsdpDescriptor *rsdp_table); diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c index 88dbf97853..9c96a67053 100644 --- a/tests/bios-tables-test.c +++ b/tests/bios-tables-test.c @@ -29,7 +29,7 @@ typedef struct { uint32_t rsdp_addr; AcpiRsdpDescriptor rsdp_table; AcpiRsdtDescriptorRev1 rsdt_table; - AcpiFadtDescriptorRev1 fadt_table; + AcpiFadtDescriptorRev3 fadt_table; AcpiFacsDescriptorRev1 facs_table; uint32_t *rsdt_tables_addr; int rsdt_tables_nr; @@ -126,7 +126,7 @@ static void test_acpi_rsdt_table(test_data *data) =20 static void test_acpi_fadt_table(test_data *data) { - AcpiFadtDescriptorRev1 *fadt_table =3D &data->fadt_table; + AcpiFadtDescriptorRev3 *fadt_table =3D &data->fadt_table; uint32_t addr; =20 /* FADT table comes first */ @@ -168,10 +168,23 @@ static void test_acpi_fadt_table(test_data *data) ACPI_READ_FIELD(fadt_table->day_alrm, addr); ACPI_READ_FIELD(fadt_table->mon_alrm, addr); ACPI_READ_FIELD(fadt_table->century, addr); - ACPI_READ_FIELD(fadt_table->reserved4, addr); - ACPI_READ_FIELD(fadt_table->reserved4a, addr); - ACPI_READ_FIELD(fadt_table->reserved4b, addr); + ACPI_READ_FIELD(fadt_table->boot_flags, addr); + ACPI_READ_FIELD(fadt_table->reserved, addr); ACPI_READ_FIELD(fadt_table->flags, addr); + ACPI_READ_GENERIC_ADDRESS(fadt_table->reset_register, addr); + ACPI_READ_FIELD(fadt_table->reset_value, addr); + ACPI_READ_FIELD(fadt_table->arm_boot_flags, addr); + ACPI_READ_FIELD(fadt_table->minor_revision, addr); + ACPI_READ_FIELD(fadt_table->Xfacs, addr); + ACPI_READ_FIELD(fadt_table->Xdsdt, addr); + ACPI_READ_GENERIC_ADDRESS(fadt_table->xpm1a_event_block, addr); + ACPI_READ_GENERIC_ADDRESS(fadt_table->xpm1b_event_block, addr); + ACPI_READ_GENERIC_ADDRESS(fadt_table->xpm1a_control_block, addr); + ACPI_READ_GENERIC_ADDRESS(fadt_table->xpm1b_control_block, addr); + ACPI_READ_GENERIC_ADDRESS(fadt_table->xpm2_control_block, addr); + ACPI_READ_GENERIC_ADDRESS(fadt_table->xpm_timer_block, addr); + ACPI_READ_GENERIC_ADDRESS(fadt_table->xgpe0_block, addr); + ACPI_READ_GENERIC_ADDRESS(fadt_table->xgpe1_block, addr); =20 ACPI_ASSERT_CMP(fadt_table->signature, "FACP"); g_assert(!acpi_calc_checksum((uint8_t *)fadt_table, fadt_table->length= )); --=20 2.12.2 From nobody Sun May 5 14:10:00 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.zoho.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 1493979326556885.3603882116213; Fri, 5 May 2017 03:15:26 -0700 (PDT) Received: from localhost ([::1]:46041 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aGj-0003N1-4V for importer@patchew.org; Fri, 05 May 2017 06:15:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46999) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aF6-0002CN-KP for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6aF5-0006ai-0M for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41670) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d6aF4-0006aV-QB for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:42 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D12CA81229; Fri, 5 May 2017 10:13:41 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-116-145.ams2.redhat.com [10.36.116.145]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v45ADbkJ026855; Fri, 5 May 2017 06:13:41 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D12CA81229 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=pass smtp.mailfrom=pbonzini@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com D12CA81229 From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 5 May 2017 12:13:18 +0200 Message-Id: <20170505101337.4650-3-pbonzini@redhat.com> In-Reply-To: <20170505101337.4650-1-pbonzini@redhat.com> References: <20170505101337.4650-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 05 May 2017 10:13: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 02/21] hw/i386: Build-time assertion on pc/q35 reset register being identical. 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: Phil Dennis-Jordan 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: Phil Dennis-Jordan This adds a clarifying comment and build time assert to the FADT reset regi= ster field initialisation: the reset register is the same on both machine t= ypes. Signed-off-by: Phil Dennis-Jordan Message-Id: <1489558827-28971-3-git-send-email-phil@philjordan.eu> Signed-off-by: Paolo Bonzini --- hw/i386/acpi-build.c | 3 +++ hw/pci-host/piix.c | 6 ------ include/hw/i386/pc.h | 6 ++++++ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 7997f06823..1d8c645ed3 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -310,6 +310,9 @@ static void fadt_setup(AcpiFadtDescriptorRev3 *fadt, Ac= piPmInfo *pm) fadt->reset_register.space_id =3D AML_SYSTEM_IO; fadt->reset_register.bit_width =3D 8; fadt->reset_register.address =3D cpu_to_le64(ICH9_RST_CNT_IOPORT); + /* The above need not be conditional on machine type because the reset= port + * happens to be the same on PIIX (pc) and ICH9 (q35). */ + QEMU_BUILD_BUG_ON(ICH9_RST_CNT_IOPORT !=3D RCR_IOPORT); =20 fadt->xpm1a_event_block.space_id =3D AML_SYSTEM_IO; fadt->xpm1a_event_block.bit_width =3D fadt->pm1_evt_len * 8; diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c index f9218aa952..bf4221d4bf 100644 --- a/hw/pci-host/piix.c +++ b/hw/pci-host/piix.c @@ -58,12 +58,6 @@ typedef struct I440FXState { #define XEN_PIIX_NUM_PIRQS 128ULL #define PIIX_PIRQC 0x60 =20 -/* - * Reset Control Register: PCI-accessible ISA-Compatible Register at addre= ss - * 0xcf9, provided by the PCI/ISA bridge (PIIX3 PCI function 0, 8086:7000). - */ -#define RCR_IOPORT 0xcf9 - typedef struct PIIX3State { PCIDevice dev; =20 diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index f278b3ae89..416aaa56ea 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -303,6 +303,12 @@ typedef struct PCII440FXState PCII440FXState; =20 #define TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE "igd-passthrough-i440FX" =20 +/* + * Reset Control Register: PCI-accessible ISA-Compatible Register at addre= ss + * 0xcf9, provided by the PCI/ISA bridge (PIIX3 PCI function 0, 8086:7000). + */ +#define RCR_IOPORT 0xcf9 + PCIBus *i440fx_init(const char *host_type, const char *pci_type, PCII440FXState **pi440fx_state, int *piix_devfn, ISABus **isa_bus, qemu_irq *pic, --=20 2.12.2 From nobody Sun May 5 14:10:00 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.zoho.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 1493979487253779.6063540433845; Fri, 5 May 2017 03:18:07 -0700 (PDT) Received: from localhost ([::1]:46057 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aJJ-0005b4-Qs for importer@patchew.org; Fri, 05 May 2017 06:18:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47016) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aF7-0002CW-WA for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6aF6-0006b3-AQ for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41710) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d6aF6-0006ao-0n for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:44 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 138DA80E7D; Fri, 5 May 2017 10:13:43 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-116-145.ams2.redhat.com [10.36.116.145]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v45ADbkK026855; Fri, 5 May 2017 06:13:42 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 138DA80E7D 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=pass smtp.mailfrom=pbonzini@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 138DA80E7D From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 5 May 2017 12:13:19 +0200 Message-Id: <20170505101337.4650-4-pbonzini@redhat.com> In-Reply-To: <20170505101337.4650-1-pbonzini@redhat.com> References: <20170505101337.4650-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 05 May 2017 10:13:43 +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 03/21] char: Fix removing wrong GSource that be found by fd_in_tag 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: zhanghailiang 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: zhanghailiang We use fd_in_tag to find a GSource, fd_in_tag is return value of g_source_attach(GSource *source, GMainContext *context), the return value is unique only in the same context, so we may get the same values with different 'context' parameters. It is no problem to find the right fd_in_tag by using g_main_context_find_source_by_id(GMainContext *context, guint source_id) while there is only one default main context. But colo-compare tries to create/use its own context, and if we pass wrong 'context' parameter with right fd_in_tag, we will find a wrong GSource to h= andle. We tried to fix the related codes in commit b43decb015a6efeb9e3cdbdb80f6547= ad7248a4c, but it didn't fix the bug completely, because we still have some codes didn= 't pass *right* context parameter for remove_fd_in_watch(). Let's fix it by record the GSource directly instead of fd_in_tag. Signed-off-by: zhanghailiang Reviewed-by: Marc-Andr=C3=83=C2=A9 Lureau Message-Id: <1492564532-91680-1-git-send-email-zhang.zhanghailiang@huawei.c= om> Signed-off-by: Paolo Bonzini --- chardev/char-fd.c | 8 ++++---- chardev/char-io.c | 23 ++++++++--------------- chardev/char-io.h | 4 ++-- chardev/char-pty.c | 6 +++--- chardev/char-socket.c | 8 ++++---- chardev/char-udp.c | 8 ++++---- chardev/char.c | 2 +- include/sysemu/char.h | 2 +- 8 files changed, 27 insertions(+), 34 deletions(-) diff --git a/chardev/char-fd.c b/chardev/char-fd.c index 548dd4cdd9..0b182c552c 100644 --- a/chardev/char-fd.c +++ b/chardev/char-fd.c @@ -58,7 +58,7 @@ static gboolean fd_chr_read(QIOChannel *chan, GIOConditio= n cond, void *opaque) ret =3D qio_channel_read( chan, (gchar *)buf, len, NULL); if (ret =3D=3D 0) { - remove_fd_in_watch(chr, NULL); + remove_fd_in_watch(chr); qemu_chr_be_event(chr, CHR_EVENT_CLOSED); return FALSE; } @@ -89,9 +89,9 @@ static void fd_chr_update_read_handler(Chardev *chr, { FDChardev *s =3D FD_CHARDEV(chr); =20 - remove_fd_in_watch(chr, NULL); + remove_fd_in_watch(chr); if (s->ioc_in) { - chr->fd_in_tag =3D io_add_watch_poll(chr, s->ioc_in, + chr->gsource =3D io_add_watch_poll(chr, s->ioc_in, fd_chr_read_poll, fd_chr_read, chr, context); @@ -103,7 +103,7 @@ static void char_fd_finalize(Object *obj) Chardev *chr =3D CHARDEV(obj); FDChardev *s =3D FD_CHARDEV(obj); =20 - remove_fd_in_watch(chr, NULL); + remove_fd_in_watch(chr); if (s->ioc_in) { object_unref(OBJECT(s->ioc_in)); } diff --git a/chardev/char-io.c b/chardev/char-io.c index b4bb094ea3..b5708eef45 100644 --- a/chardev/char-io.c +++ b/chardev/char-io.c @@ -98,7 +98,7 @@ static GSourceFuncs io_watch_poll_funcs =3D { .finalize =3D io_watch_poll_finalize, }; =20 -guint io_add_watch_poll(Chardev *chr, +GSource *io_add_watch_poll(Chardev *chr, QIOChannel *ioc, IOCanReadHandler *fd_can_read, QIOChannelFunc fd_read, @@ -106,7 +106,6 @@ guint io_add_watch_poll(Chardev *chr, GMainContext *context) { IOWatchPoll *iwp; - int tag; char *name; =20 iwp =3D (IOWatchPoll *) g_source_new(&io_watch_poll_funcs, @@ -122,21 +121,15 @@ guint io_add_watch_poll(Chardev *chr, g_source_set_name((GSource *)iwp, name); g_free(name); =20 - tag =3D g_source_attach(&iwp->parent, context); + g_source_attach(&iwp->parent, context); g_source_unref(&iwp->parent); - return tag; + return (GSource *)iwp; } =20 -static void io_remove_watch_poll(guint tag, GMainContext *context) +static void io_remove_watch_poll(GSource *source) { - GSource *source; IOWatchPoll *iwp; =20 - g_return_if_fail(tag > 0); - - source =3D g_main_context_find_source_by_id(context, tag); - g_return_if_fail(source !=3D NULL); - iwp =3D io_watch_poll_from_source(source); if (iwp->src) { g_source_destroy(iwp->src); @@ -146,11 +139,11 @@ static void io_remove_watch_poll(guint tag, GMainCont= ext *context) g_source_destroy(&iwp->parent); } =20 -void remove_fd_in_watch(Chardev *chr, GMainContext *context) +void remove_fd_in_watch(Chardev *chr) { - if (chr->fd_in_tag) { - io_remove_watch_poll(chr->fd_in_tag, context); - chr->fd_in_tag =3D 0; + if (chr->gsource) { + io_remove_watch_poll(chr->gsource); + chr->gsource =3D NULL; } } =20 diff --git a/chardev/char-io.h b/chardev/char-io.h index 842be56bda..55973a7671 100644 --- a/chardev/char-io.h +++ b/chardev/char-io.h @@ -29,14 +29,14 @@ #include "sysemu/char.h" =20 /* Can only be used for read */ -guint io_add_watch_poll(Chardev *chr, +GSource *io_add_watch_poll(Chardev *chr, QIOChannel *ioc, IOCanReadHandler *fd_can_read, QIOChannelFunc fd_read, gpointer user_data, GMainContext *context); =20 -void remove_fd_in_watch(Chardev *chr, GMainContext *context); +void remove_fd_in_watch(Chardev *chr); =20 int io_channel_send(QIOChannel *ioc, const void *buf, size_t len); =20 diff --git a/chardev/char-pty.c b/chardev/char-pty.c index a6337be8aa..581ab34278 100644 --- a/chardev/char-pty.c +++ b/chardev/char-pty.c @@ -199,7 +199,7 @@ static void pty_chr_state(Chardev *chr, int connected) g_source_remove(s->open_tag); s->open_tag =3D 0; } - remove_fd_in_watch(chr, NULL); + remove_fd_in_watch(chr); s->connected =3D 0; /* (re-)connect poll interval for idle guests: once per second. * We check more frequently in case the guests sends data to @@ -215,8 +215,8 @@ static void pty_chr_state(Chardev *chr, int connected) s->connected =3D 1; s->open_tag =3D g_idle_add(qemu_chr_be_generic_open_func, chr); } - if (!chr->fd_in_tag) { - chr->fd_in_tag =3D io_add_watch_poll(chr, s->ioc, + if (!chr->gsource) { + chr->gsource =3D io_add_watch_poll(chr, s->ioc, pty_chr_read_poll, pty_chr_read, chr, NULL); diff --git a/chardev/char-socket.c b/chardev/char-socket.c index 36ab0d633a..d8de0518c5 100644 --- a/chardev/char-socket.c +++ b/chardev/char-socket.c @@ -327,7 +327,7 @@ static void tcp_chr_free_connection(Chardev *chr) } =20 tcp_set_msgfds(chr, NULL, 0); - remove_fd_in_watch(chr, NULL); + remove_fd_in_watch(chr); object_unref(OBJECT(s->sioc)); s->sioc =3D NULL; object_unref(OBJECT(s->ioc)); @@ -484,7 +484,7 @@ static void tcp_chr_connect(void *opaque) =20 s->connected =3D 1; if (s->ioc) { - chr->fd_in_tag =3D io_add_watch_poll(chr, s->ioc, + chr->gsource =3D io_add_watch_poll(chr, s->ioc, tcp_chr_read_poll, tcp_chr_read, chr, NULL); @@ -501,9 +501,9 @@ static void tcp_chr_update_read_handler(Chardev *chr, return; } =20 - remove_fd_in_watch(chr, NULL); + remove_fd_in_watch(chr); if (s->ioc) { - chr->fd_in_tag =3D io_add_watch_poll(chr, s->ioc, + chr->gsource =3D io_add_watch_poll(chr, s->ioc, tcp_chr_read_poll, tcp_chr_read, chr, context); diff --git a/chardev/char-udp.c b/chardev/char-udp.c index 804bd22efa..12240e528a 100644 --- a/chardev/char-udp.c +++ b/chardev/char-udp.c @@ -81,7 +81,7 @@ static gboolean udp_chr_read(QIOChannel *chan, GIOConditi= on cond, void *opaque) ret =3D qio_channel_read( s->ioc, (char *)s->buf, sizeof(s->buf), NULL); if (ret <=3D 0) { - remove_fd_in_watch(chr, NULL); + remove_fd_in_watch(chr); return FALSE; } s->bufcnt =3D ret; @@ -101,9 +101,9 @@ static void udp_chr_update_read_handler(Chardev *chr, { UdpChardev *s =3D UDP_CHARDEV(chr); =20 - remove_fd_in_watch(chr, NULL); + remove_fd_in_watch(chr); if (s->ioc) { - chr->fd_in_tag =3D io_add_watch_poll(chr, s->ioc, + chr->gsource =3D io_add_watch_poll(chr, s->ioc, udp_chr_read_poll, udp_chr_read, chr, context); @@ -115,7 +115,7 @@ static void char_udp_finalize(Object *obj) Chardev *chr =3D CHARDEV(obj); UdpChardev *s =3D UDP_CHARDEV(obj); =20 - remove_fd_in_watch(chr, NULL); + remove_fd_in_watch(chr); if (s->ioc) { object_unref(OBJECT(s->ioc)); } diff --git a/chardev/char.c b/chardev/char.c index 3df116350b..54cd5f4081 100644 --- a/chardev/char.c +++ b/chardev/char.c @@ -560,7 +560,7 @@ void qemu_chr_fe_set_handlers(CharBackend *b, cc =3D CHARDEV_GET_CLASS(s); if (!opaque && !fd_can_read && !fd_read && !fd_event) { fe_open =3D 0; - remove_fd_in_watch(s, context); + remove_fd_in_watch(s); } else { fe_open =3D 1; } diff --git a/include/sysemu/char.h b/include/sysemu/char.h index 450881d42c..84f5c2312c 100644 --- a/include/sysemu/char.h +++ b/include/sysemu/char.h @@ -93,7 +93,7 @@ struct Chardev { char *filename; int logfd; int be_open; - guint fd_in_tag; + GSource *gsource; DECLARE_BITMAP(features, QEMU_CHAR_FEATURE_LAST); QTAILQ_ENTRY(Chardev) next; }; --=20 2.12.2 From nobody Sun May 5 14:10:00 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.zoho.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 1493979480232749.2451442457748; Fri, 5 May 2017 03:18:00 -0700 (PDT) Received: from localhost ([::1]:46052 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aJC-0005V5-DJ for importer@patchew.org; Fri, 05 May 2017 06:17:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47031) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aF9-0002DE-La for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6aF7-0006bl-W7 for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:21835) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d6aF7-0006bT-Mx for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:45 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8E617C0467E5; Fri, 5 May 2017 10:13:44 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-116-145.ams2.redhat.com [10.36.116.145]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v45ADbkL026855; Fri, 5 May 2017 06:13:43 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8E617C0467E5 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=pass smtp.mailfrom=pbonzini@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 8E617C0467E5 From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 5 May 2017 12:13:20 +0200 Message-Id: <20170505101337.4650-5-pbonzini@redhat.com> In-Reply-To: <20170505101337.4650-1-pbonzini@redhat.com> References: <20170505101337.4650-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 05 May 2017 10:13: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 04/21] target/i386: Add GDB XML register description 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: Abdallah Bouassida 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: Abdallah Bouassida This patch implements XML target description support for X86 and X86-64 architectures in the GDB stub, as the way with ARM and PowerPC: - gdb-xml/32bit-core.xml & gdb-xml/64bit-core.xml: Adding the XML target description files, these files are picked from GDB source code. - configure: Define gdb_xml_files for X86 targets. - target/i386/cpu.c: Define gdb_core_xml_file and gdb_arch_name to add XML awareness for this architecture, modify the gdb_num_core_regs to fit the registers number defined in each XML file. Signed-off-by: Abdallah Bouassida Message-Id: <2b3c8119-1602-28c7-eab4-296593877103@lauterbach.com> Signed-off-by: Paolo Bonzini --- configure | 2 ++ gdb-xml/i386-32bit-core.xml | 65 ++++++++++++++++++++++++++++++++++++++++ gdb-xml/i386-64bit-core.xml | 73 +++++++++++++++++++++++++++++++++++++++++= ++++ target/i386/cpu.c | 21 ++++++++++--- 4 files changed, 157 insertions(+), 4 deletions(-) create mode 100644 gdb-xml/i386-32bit-core.xml create mode 100644 gdb-xml/i386-64bit-core.xml diff --git a/configure b/configure index 48a9370cc6..ff2c81f2c7 100755 --- a/configure +++ b/configure @@ -6023,9 +6023,11 @@ TARGET_ABI_DIR=3D"" =20 case "$target_name" in i386) + gdb_xml_files=3D"i386-32bit-core.xml" ;; x86_64) TARGET_BASE_ARCH=3Di386 + gdb_xml_files=3D"i386-64bit-core.xml" ;; alpha) mttcg=3D"yes" diff --git a/gdb-xml/i386-32bit-core.xml b/gdb-xml/i386-32bit-core.xml new file mode 100644 index 0000000000..7aeeeca3b2 --- /dev/null +++ b/gdb-xml/i386-32bit-core.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gdb-xml/i386-64bit-core.xml b/gdb-xml/i386-64bit-core.xml new file mode 100644 index 0000000000..5088d84ceb --- /dev/null +++ b/gdb-xml/i386-64bit-core.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 13c0985f11..7e87031fad 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -2577,6 +2577,15 @@ out: return ret; } =20 +static gchar *x86_gdb_arch_name(CPUState *cs) +{ +#ifdef TARGET_X86_64 + return g_strdup("i386:x86-64"); +#else + return g_strdup("i386"); +#endif +} + X86CPU *cpu_x86_init(const char *cpu_model) { return X86_CPU(cpu_generic_init(TYPE_X86_CPU, cpu_model)); @@ -4056,10 +4065,14 @@ static void x86_cpu_common_class_init(ObjectClass *= oc, void *data) cc->write_elf32_qemunote =3D x86_cpu_write_elf32_qemunote; cc->vmsd =3D &vmstate_x86_cpu; #endif - /* CPU_NB_REGS * 2 =3D general regs + xmm regs - * 25 =3D eip, eflags, 6 seg regs, st[0-7], fctrl,...,fop, mxcsr. - */ - cc->gdb_num_core_regs =3D CPU_NB_REGS * 2 + 25; + cc->gdb_arch_name =3D x86_gdb_arch_name; +#ifdef TARGET_X86_64 + cc->gdb_core_xml_file =3D "i386-64bit-core.xml"; + cc->gdb_num_core_regs =3D 40; +#else + cc->gdb_core_xml_file =3D "i386-32bit-core.xml"; + cc->gdb_num_core_regs =3D 32; +#endif #ifndef CONFIG_USER_ONLY cc->debug_excp_handler =3D breakpoint_handler; #endif --=20 2.12.2 From nobody Sun May 5 14:10:00 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.zoho.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 1493979707614308.90922206374694; Fri, 5 May 2017 03:21:47 -0700 (PDT) Received: from localhost ([::1]:46075 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aMs-0000Tz-7p for importer@patchew.org; Fri, 05 May 2017 06:21:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47039) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aFA-0002E9-L0 for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6aF9-0006c7-Ee for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49516) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d6aF9-0006bw-6A for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:47 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 173408050D; Fri, 5 May 2017 10:13:46 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-116-145.ams2.redhat.com [10.36.116.145]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v45ADbkM026855; Fri, 5 May 2017 06:13:44 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 173408050D Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=pbonzini@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 173408050D From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 5 May 2017 12:13:21 +0200 Message-Id: <20170505101337.4650-6-pbonzini@redhat.com> In-Reply-To: <20170505101337.4650-1-pbonzini@redhat.com> References: <20170505101337.4650-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 05 May 2017 10:13: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 05/21] use _Static_assert in QEMU_BUILD_BUG_ON 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: Andreas Grapentin 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: Andreas Grapentin QEMU_BUILD_BUG_ON should use C11's _Static_assert, if the compiler supports= it, to provide more readable messages on failure. We check for _Static_assert in configure, and set CONFIG_STATIC_ASSERT accordingly. QEMU_BUILD_BUG_ON invokes _Static_assert if CONFIG_STATIC_ASSE= RT is defined, and reverts to the old way otherwise. That way, systems without C11 conforming compiler will still have the old messages, as verified by intentionally breaking the configure check. the following example output was generated by inverting the condition in QEMU_BUILD_BUG_ON: without _Static_assert: > In file included from /qemu/include/qemu/osdep.h:36:0, > from /qemu/qga/commands.c:13: > /qemu/qga/commands.c: In function =C3=A2=E2=82=AC=CB=9Cqmp_guest_exec_sta= tus=C3=A2=E2=82=AC=E2=84=A2: > /qemu/include/qemu/compiler.h:89:12: error: negative width in bit-field = =C3=A2=E2=82=AC=CB=9C=C3=A2=E2=82=AC=E2=84=A2 > struct { \ > ^ > /qemu/include/qemu/compiler.h:96:38: note: in expansion of macro QEMU_BU= ILD_BUG_ON_STRUCT=C3=A2=E2=82=AC=E2=84=A2 > #define QEMU_BUILD_BUG_ON(x) typedef QEMU_BUILD_BUG_ON_STRUCT(x) \ > ^~~~~~~~~~~~~~~~~~~~~~~~ > /qemu/include/qemu/atomic.h:146:5: note: in expansion of macro =C3=A2=E2= =82=AC=CB=9CQEMU_BUILD_BUG_ON=C3=A2=E2=82=AC=E2=84=A2 > QEMU_BUILD_BUG_ON(sizeof(*ptr) > sizeof(void *)); \ > ^~~~~~~~~~~~~~~~~ > /qemu/include/qemu/atomic.h:417:5: note: in expansion of macro =C3=A2=E2= =82=AC=CB=9Catomic_load_acquire=C3=A2=E2=82=AC=E2=84=A2 > atomic_load_acquire(ptr) > ^~~~~~~~~~~~~~~~~~~ > /qemu/qga/commands.c:160:21: note: in expansion of macro =C3=A2=E2=82=AC= =CB=9Catomic_mb_read=C3=A2=E2=82=AC=E2=84=A2 > bool finished =3D atomic_mb_read(&gei->finished); > ^~~~~~~~~~~~~~ with _Static_assert: > In file included from /qemu/include/qemu/osdep.h:36:0, > from /qemu/qga/commands.c:13: > /qemu/qga/commands.c: In function =C3=A2=E2=82=AC=CB=9Cqmp_guest_exec_sta= tus=C3=A2=E2=82=AC=E2=84=A2: > /qemu/include/qemu/compiler.h:94:30: error: static assertion failed: "not= expecting: sizeof(*&gei->finished) > sizeof(void *)" > #define QEMU_BUILD_BUG_ON(x) _Static_assert((x), #x) > ^ > /qemu/include/qemu/atomic.h:146:5: note: in expansion of macro =C3=A2=E2= =82=AC=CB=9CQEMU_BUILD_BUG_ON=C3=A2=E2=82=AC=E2=84=A2 > QEMU_BUILD_BUG_ON(sizeof(*ptr) > sizeof(void *)); \ > ^~~~~~~~~~~~~~~~~ > /qemu/include/qemu/atomic.h:417:5: note: in expansion of macro =C3=A2=E2= =82=AC=CB=9Catomic_load_acquire=C3=A2=E2=82=AC=E2=84=A2 > atomic_load_acquire(ptr) > ^~~~~~~~~~~~~~~~~~~ > /qemu/qga/commands.c:160:21: note: in expansion of macro =C3=A2=E2=82=AC= =CB=9Catomic_mb_read=C3=A2=E2=82=AC=E2=84=A2 > bool finished =3D atomic_mb_read(&gei->finished); > ^~~~~~~~~~~~~~ Signed-off-by: Andreas Grapentin Message-Id: <20170314165953.18506-1-andreas@grapentin.org> Signed-off-by: Paolo Bonzini --- configure | 18 ++++++++++++++++++ include/qemu/compiler.h | 4 +++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/configure b/configure index ff2c81f2c7..7c020c076b 100755 --- a/configure +++ b/configure @@ -4853,6 +4853,20 @@ EOF fi =20 ########################################## +# check for _Static_assert() + +have_static_assert=3Dno +cat > $TMPC << EOF +_Static_assert(1, "success"); +int main(void) { + return 0; +} +EOF +if compile_prog "" "" ; then + have_static_assert=3Dyes +fi + +########################################## # End of CC checks # After here, no more $cc or $ld runs =20 @@ -5848,6 +5862,10 @@ if test "$have_sysmacros" =3D "yes" ; then echo "CONFIG_SYSMACROS=3Dy" >> $config_host_mak fi =20 +if test "$have_static_assert" =3D "yes" ; then + echo "CONFIG_STATIC_ASSERT=3Dy" >> $config_host_mak +fi + # Hold two types of flag: # CONFIG_THREAD_SETNAME_BYTHREAD - we've got a way of setting the name = on # a thread we have a handle to diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index 18e610083a..340e5fdc09 100644 --- a/include/qemu/compiler.h +++ b/include/qemu/compiler.h @@ -82,7 +82,9 @@ int:(x) ? -1 : 1; \ } =20 -#ifdef __COUNTER__ +#if defined(CONFIG_STATIC_ASSERT) +#define QEMU_BUILD_BUG_ON(x) _Static_assert(!(x), "not expecting: " #x) +#elif defined(__COUNTER__) #define QEMU_BUILD_BUG_ON(x) typedef QEMU_BUILD_BUG_ON_STRUCT(x) \ glue(qemu_build_bug_on__, __COUNTER__) __attribute__((unused)) #else --=20 2.12.2 From nobody Sun May 5 14:10:00 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.zoho.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 1493979331684914.3888631039175; Fri, 5 May 2017 03:15:31 -0700 (PDT) Received: from localhost ([::1]:46047 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aGo-0003QG-EJ for importer@patchew.org; Fri, 05 May 2017 06:15:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47051) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aFB-0002F4-Dm for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6aFA-0006ca-Ex for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58650) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d6aFA-0006cH-87 for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:48 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 492A461971 for ; Fri, 5 May 2017 10:13:47 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-116-145.ams2.redhat.com [10.36.116.145]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v45ADbkN026855; Fri, 5 May 2017 06:13:46 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 492A461971 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=pass smtp.mailfrom=pbonzini@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 492A461971 From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 5 May 2017 12:13:22 +0200 Message-Id: <20170505101337.4650-7-pbonzini@redhat.com> In-Reply-To: <20170505101337.4650-1-pbonzini@redhat.com> References: <20170505101337.4650-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 05 May 2017 10:13:47 +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 06/21] vl: deprecate the "-hdachs" option 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: Thomas Huth 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: Thomas Huth If the user needs to specify the disk geometry, the corresponding parameters of the "-device ide-hd" option should be used instead. "-hdachs" is considered as deprecated and might be removed soon. Signed-off-by: Thomas Huth Message-Id: <1493270454-1448-1-git-send-email-thuth@redhat.com> Signed-off-by: Paolo Bonzini --- qemu-options.hx | 4 ++-- vl.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/qemu-options.hx b/qemu-options.hx index 787b9c38da..f68829f3b0 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -803,8 +803,8 @@ STEXI Force hard disk 0 physical geometry (1 <=3D @var{c} <=3D 16383, 1 <=3D @var{h} <=3D 16, 1 <=3D @var{s} <=3D 63) and optionally force the BIOS translation mode (@var{t}=3Dnone, lba or auto). Usually QEMU can guess -all those parameters. This option is useful for old MS-DOS disk -images. +all those parameters. This option is deprecated, please use +@code{-device ide-hd,cyls=3Dc,heads=3Dh,secs=3Ds,...} instead. ETEXI =20 DEF("fsdev", HAS_ARG, QEMU_OPTION_fsdev, diff --git a/vl.c b/vl.c index f46e070e0d..42d4bce439 100644 --- a/vl.c +++ b/vl.c @@ -3231,6 +3231,8 @@ int main(int argc, char **argv, char **envp) } } } + error_report("'-hdachs' is deprecated, please use '-device" + " ide-hd,cyls=3Dc,heads=3Dh,secs=3Ds,...' ins= tead"); break; case QEMU_OPTION_numa: opts =3D qemu_opts_parse_noisily(qemu_find_opts("numa"), --=20 2.12.2 From nobody Sun May 5 14:10:00 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.zoho.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 1493979634451609.2964536752936; Fri, 5 May 2017 03:20:34 -0700 (PDT) Received: from localhost ([::1]:46069 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aLg-0007rt-Tk for importer@patchew.org; Fri, 05 May 2017 06:20:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47064) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aFC-0002GI-JO for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6aFB-0006cy-Hb for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32786) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d6aFB-0006cg-Aw for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:49 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5C963C054C5F; Fri, 5 May 2017 10:13:48 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-116-145.ams2.redhat.com [10.36.116.145]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v45ADbkO026855; Fri, 5 May 2017 06:13:47 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5C963C054C5F Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=pbonzini@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 5C963C054C5F From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 5 May 2017 12:13:23 +0200 Message-Id: <20170505101337.4650-8-pbonzini@redhat.com> In-Reply-To: <20170505101337.4650-1-pbonzini@redhat.com> References: <20170505101337.4650-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 05 May 2017 10:13: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 07/21] scsi: avoid an off-by-one error in megasas_mmio_write 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: Prasad J Pandit 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: Prasad J Pandit While reading magic sequence(MFI_SEQ) in megasas_mmio_write, an off-by-one error could occur as 's->adp_reset' index is not reset after reading the last sequence. Reported-by: YY Z Signed-off-by: Prasad J Pandit Message-Id: <20170424120634.12268-1-ppandit@redhat.com> Signed-off-by: Paolo Bonzini --- hw/scsi/megasas.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c index 84b8caf901..804122ab05 100644 --- a/hw/scsi/megasas.c +++ b/hw/scsi/megasas.c @@ -2138,15 +2138,15 @@ static void megasas_mmio_write(void *opaque, hwaddr= addr, case MFI_SEQ: trace_megasas_mmio_writel("MFI_SEQ", val); /* Magic sequence to start ADP reset */ - if (adp_reset_seq[s->adp_reset] =3D=3D val) { - s->adp_reset++; + if (adp_reset_seq[s->adp_reset++] =3D=3D val) { + if (s->adp_reset =3D=3D 6) { + s->adp_reset =3D 0; + s->diag =3D MFI_DIAG_WRITE_ENABLE; + } } else { s->adp_reset =3D 0; s->diag =3D 0; } - if (s->adp_reset =3D=3D 6) { - s->diag =3D MFI_DIAG_WRITE_ENABLE; - } break; case MFI_DIAG: trace_megasas_mmio_writel("MFI_DIAG", val); --=20 2.12.2 From nobody Sun May 5 14:10:00 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.zoho.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 1493979845639495.06021200400653; Fri, 5 May 2017 03:24:05 -0700 (PDT) Received: from localhost ([::1]:46086 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aP6-0002nZ-80 for importer@patchew.org; Fri, 05 May 2017 06:24:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47091) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aFG-0002KY-Kv for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6aFC-0006dH-K8 for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41862) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d6aFC-0006d3-Ah for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:50 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5575D7AE92 for ; Fri, 5 May 2017 10:13:49 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-116-145.ams2.redhat.com [10.36.116.145]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v45ADbkP026855 for ; Fri, 5 May 2017 06:13:48 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5575D7AE92 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=pass smtp.mailfrom=pbonzini@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 5575D7AE92 From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 5 May 2017 12:13:24 +0200 Message-Id: <20170505101337.4650-9-pbonzini@redhat.com> In-Reply-To: <20170505101337.4650-1-pbonzini@redhat.com> References: <20170505101337.4650-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 05 May 2017 10:13: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 08/21] sgabios: update for "fix wrong video attrs for int 10h, ah==13h" 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: , 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" Update the submodule and rebuild the binary. Signed-off-by: Paolo Bonzini --- pc-bios/sgabios.bin | Bin 4096 -> 4096 bytes roms/sgabios | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/pc-bios/sgabios.bin b/pc-bios/sgabios.bin index c3da4c3d0a34e4eca9b0cda38d0538b332f7b09e..6308f2e2d7064b52ff3c2e207b7= 1018710866c05 100644 GIT binary patch delta 1136 zcmX|6-E@2P{XGA^ z&+ndGkPC8}&S_1$SC{S@*Ys(ujdk_*I-7m`Eo1HBqeq6`f5Yz|s^tcUj&k*OZeZj% zS8ui1Eu6JkXlN346YA_ZF#b*JmsBrRYod8y>^YU-J6A=3Ds=3D7D6tNo|-IZZVgd^oWgK z7JMNVM>=3DJ~bZ+A32?pEEn3Zakc# z`8_JJDs%_Y!Y&6#FWnIsGJT6l?>ExndCEGM3D46K&IqweBRxx@$gi2m{nr1&@H`_` zkUAwX4->RRWqQ1xq|%NJs!D^AzC9Hb*CX>Ly?OR8gd0^Y)J-g^UaB_InQqeQCWWb> zUtJTJJxwj|s$bet8&D&wfQDC}*L9z;ZnKf*EGtG+^Q#yoqt z%$rU3;!oM_lo3npZj(0abb-0xXQwDX1H&b+CtY*j>2{gO+2Jl`G$#yx1S5rTmU@SI zacvD8_>`u0yIZLnE~aYOYpZ3>XfnFh+~Y}_+$1~Zcpbs-cv;gQXqL@a$tOJqpA@8e z=3D+8^-(38Kw!uf)=3DWcw-ISL$-XXQk*b-hIe#aKc~#b`>Ny*z?}klFrc^5G{<}P!?&g zh>r(LtZ0BX#b~Qyv?af0aYYxQuH-#vUEjElmWr2zy?Sy4l`uxc&q@pjd+?0*Df{1f z_$n`Tz@;297DA44gyuvhyg(=3DWK`y#FqqkyR`o1?`(Ve_0GU>WfFi#Vm#1%R|&{PcO zbtGyaswY}a)Ic;rw1Q}3(c^t&35SXU>FIyIUPNbP^79TOR&VBglRJ>_+%h6yA+VxA z3jv)1P6B@@;2~f@d`i6oy~pw&>vt+_L2Vx>fuIB}2(*M-6?US4l6NWWLCXqz5v*px zB8$1ic?4o^xP@Gf{mzNt1)SG)1SItTGyQrY;)tU)R!FIhG|<*L(loOfcj9{l37KpWCgSL9JGxAsg?vqqo~@rTSXC{rriC8cy}S<{|RP;PA+)5i&eDaIDWu`iD+b z30=3Doz;l-hof>1Bm>znH9n;PuG;jaBcokR;i-uLP4UZ#q$qC5PYj<_ePS>D>0=3D(UuZ zBc4`kvC#y4XpXqUq?#q+7NW@P=3D`9j#FXlErBw>rB6xb)8mRLj4+bFsNdpe)r3v!JZ z?kN?60btCR6N@Vt(FKygGD$J?!2UoM7@4&%(O#0`;&$ABx3>TP+HQ0yA+Gu{i47zR z+!bK{{A4uAio134BY|~b$<7vuU0f#|t^R>a?X|I^vy3#89-U>QN}7Z#Y;25y;7{q` zoqhkBqqAIe8;vtj?w*5#b(8)ud-@k^W|hE|J_Q7Ba{d|Xmutmozywrauje`nb-IFnpEqz z^g{RHxqP$^kLIFn*pr*$aVjqr?blPU7LRn`yT#Ctu4eF>9e6yCPv)bYxI5>1CE*xb z#&CXYS({^+m&^S{UN++ats+nq> z>Ncv41*eMyTFL-sWDffaeW?q7f4%@0RQf_az?-b1`=3DSlp6Tbn48VaaED+Qwl4hm}; zI4PJxOqSXp#EWN5)f(5pvu8DfXhth+8Yu76*a7D>e}~3S_+4Wc;IA1Zs+^5~0r+Ot z(@Gb_Uv&VsDQRPuZyNqPrq@J*EiqW-2_42FE6vcPD_bGAami%G_cL-D4`k!5fHzg# zla0RsxTNA!+4$>#*Hzq^z1OBY{ypG~N~e%W3_fUsIeIL>U)1PZcq>C9(-8csa4jgF zfuMK@bU3Htx-z%LUN;TnVjGa47z4C!;?>Rg5@5SZE=3Dug!3XZ5z0ezX^3LaPS9hH9e R_r6x_We2DHWj>Cv{sTIk(ntUR diff --git a/roms/sgabios b/roms/sgabios index 23d474943d..cbaee52287 160000 --- a/roms/sgabios +++ b/roms/sgabios @@ -1 +1 @@ -Subproject commit 23d474943dcd55d0550a3d20b3d30e9040a4f15b +Subproject commit cbaee52287e5f32373181cff50a00b6c4ac9015a --=20 2.12.2 From nobody Sun May 5 14:10:00 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.zoho.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 1493980077953311.7580844618677; Fri, 5 May 2017 03:27:57 -0700 (PDT) Received: from localhost ([::1]:46109 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aSq-00065R-Em for importer@patchew.org; Fri, 05 May 2017 06:27:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47092) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aFG-0002KZ-Kx for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6aFD-0006df-NN for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32822) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d6aFD-0006dS-Gk for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:51 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8EBA7C056790 for ; Fri, 5 May 2017 10:13:50 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-116-145.ams2.redhat.com [10.36.116.145]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v45ADbkQ026855; Fri, 5 May 2017 06:13:49 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8EBA7C056790 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=pbonzini@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 8EBA7C056790 From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 5 May 2017 12:13:25 +0200 Message-Id: <20170505101337.4650-10-pbonzini@redhat.com> In-Reply-To: <20170505101337.4650-1-pbonzini@redhat.com> References: <20170505101337.4650-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 05 May 2017 10:13:50 +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 09/21] vmw_pvscsi: check message ring page count at initialisation 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: P J P 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: P J P A guest could set the message ring page count to zero, resulting in infinite loop. Add check to avoid it. Reported-by: YY Z Signed-off-by: P J P Message-Id: <20170425130623.3649-1-ppandit@redhat.com> Reviewed-by: Dmitry Fleytman Signed-off-by: Paolo Bonzini --- hw/scsi/vmw_pvscsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c index 75575461e2..4a106da856 100644 --- a/hw/scsi/vmw_pvscsi.c +++ b/hw/scsi/vmw_pvscsi.c @@ -202,7 +202,7 @@ pvscsi_ring_init_msg(PVSCSIRingInfo *m, PVSCSICmdDescSe= tupMsgRing *ri) uint32_t len_log2; uint32_t ring_size; =20 - if (ri->numPages > PVSCSI_SETUP_MSG_RING_MAX_NUM_PAGES) { + if (!ri->numPages || ri->numPages > PVSCSI_SETUP_MSG_RING_MAX_NUM_PAGE= S) { return -1; } ring_size =3D ri->numPages * PVSCSI_MAX_NUM_MSG_ENTRIES_PER_PAGE; --=20 2.12.2 From nobody Sun May 5 14:10:00 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.zoho.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 14939799602951020.4323253116404; Fri, 5 May 2017 03:26:00 -0700 (PDT) Received: from localhost ([::1]:46098 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aQw-0004PM-NF for importer@patchew.org; Fri, 05 May 2017 06:25:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47093) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aFG-0002Ka-LW for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6aFE-0006e4-VD for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43650) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d6aFE-0006dn-Lv for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:52 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AFC48C04B945; Fri, 5 May 2017 10:13:51 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-116-145.ams2.redhat.com [10.36.116.145]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v45ADbkR026855; Fri, 5 May 2017 06:13:50 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com AFC48C04B945 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=pass smtp.mailfrom=pbonzini@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com AFC48C04B945 From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 5 May 2017 12:13:26 +0200 Message-Id: <20170505101337.4650-11-pbonzini@redhat.com> In-Reply-To: <20170505101337.4650-1-pbonzini@redhat.com> References: <20170505101337.4650-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 05 May 2017 10:13: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 10/21] trace: add qemu mutex lock and unlock trace events 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: Jose Ricardo Ziviani 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: Jose Ricardo Ziviani These trace events were very useful to help me to understand and find a reordering issue in vfio, for example: qemu_mutex_lock locked mutex 0x10905ad8 vfio_region_write (0001:03:00.0:region1+0xc0, 0x2020c, 4) qemu_mutex_unlock unlocked mutex 0x10905ad8 qemu_mutex_lock locked mutex 0x10905ad8 vfio_region_write (0001:03:00.0:region1+0xc4, 0xa0000, 4) qemu_mutex_unlock unlocked mutex 0x10905ad8 that also helped me to see the desired result after the fix: qemu_mutex_lock locked mutex 0x10905ad8 vfio_region_write (0001:03:00.0:region1+0xc0, 0x2000c, 4) vfio_region_write (0001:03:00.0:region1+0xc4, 0xb0000, 4) qemu_mutex_unlock unlocked mutex 0x10905ad8 So it could be a good idea to have these traces implemented. It's worth mentioning that they should be surgically enabled during the debugging, otherwise it can flood the trace logs with lock/unlock messages. How to use it: trace-event qemu_mutex_lock on|off trace-event qemu_mutex_unlock on|off or trace-event qemu_mutex* on|off Signed-off-by: Jose Ricardo Ziviani Message-Id: <1493054398-26013-1-git-send-email-joserz@linux.vnet.ibm.com> Reviewed-by: Fam Zheng [Also handle trylock, cond_wait and win32; trace "unlocked" while still in the critical section, so that "unlocked" always comes before the next "locked" tracepoint. - Paolo] Signed-off-by: Paolo Bonzini --- util/qemu-thread-posix.c | 18 +++++++++++++++++- util/qemu-thread-win32.c | 11 ++++++++++- util/trace-events | 4 ++++ 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/util/qemu-thread-posix.c b/util/qemu-thread-posix.c index 73e3a0edf5..eacd99e497 100644 --- a/util/qemu-thread-posix.c +++ b/util/qemu-thread-posix.c @@ -14,6 +14,7 @@ #include "qemu/thread.h" #include "qemu/atomic.h" #include "qemu/notify.h" +#include "trace.h" =20 static bool name_threads; =20 @@ -60,17 +61,30 @@ void qemu_mutex_lock(QemuMutex *mutex) err =3D pthread_mutex_lock(&mutex->lock); if (err) error_exit(err, __func__); + + trace_qemu_mutex_locked(mutex); } =20 int qemu_mutex_trylock(QemuMutex *mutex) { - return pthread_mutex_trylock(&mutex->lock); + int err; + + err =3D pthread_mutex_trylock(&mutex->lock); + if (err =3D=3D 0) { + trace_qemu_mutex_locked(mutex); + return 0; + } + if (err !=3D EBUSY) { + error_exit(err, __func__); + } + return -EBUSY; } =20 void qemu_mutex_unlock(QemuMutex *mutex) { int err; =20 + trace_qemu_mutex_unlocked(mutex); err =3D pthread_mutex_unlock(&mutex->lock); if (err) error_exit(err, __func__); @@ -130,7 +144,9 @@ void qemu_cond_wait(QemuCond *cond, QemuMutex *mutex) { int err; =20 + trace_qemu_mutex_unlocked(mutex); err =3D pthread_cond_wait(&cond->cond, &mutex->lock); + trace_qemu_mutex_locked(mutex); if (err) error_exit(err, __func__); } diff --git a/util/qemu-thread-win32.c b/util/qemu-thread-win32.c index 59befd5202..653f29f442 100644 --- a/util/qemu-thread-win32.c +++ b/util/qemu-thread-win32.c @@ -19,6 +19,7 @@ #include "qemu-common.h" #include "qemu/thread.h" #include "qemu/notify.h" +#include "trace.h" #include =20 static bool name_threads; @@ -55,6 +56,7 @@ void qemu_mutex_destroy(QemuMutex *mutex) void qemu_mutex_lock(QemuMutex *mutex) { AcquireSRWLockExclusive(&mutex->lock); + trace_qemu_mutex_locked(mutex); } =20 int qemu_mutex_trylock(QemuMutex *mutex) @@ -62,11 +64,16 @@ int qemu_mutex_trylock(QemuMutex *mutex) int owned; =20 owned =3D TryAcquireSRWLockExclusive(&mutex->lock); - return !owned; + if (owned) { + trace_qemu_mutex_locked(mutex); + return 0; + } + return -EBUSY; } =20 void qemu_mutex_unlock(QemuMutex *mutex) { + trace_qemu_mutex_unlocked(mutex); ReleaseSRWLockExclusive(&mutex->lock); } =20 @@ -118,7 +125,9 @@ void qemu_cond_broadcast(QemuCond *cond) =20 void qemu_cond_wait(QemuCond *cond, QemuMutex *mutex) { + trace_qemu_mutex_unlocked(mutex); SleepConditionVariableSRW(&cond->var, &mutex->lock, INFINITE, 0); + trace_qemu_mutex_locked(mutex); } =20 void qemu_sem_init(QemuSemaphore *sem, int init) diff --git a/util/trace-events b/util/trace-events index b44ef4f895..fa540c620b 100644 --- a/util/trace-events +++ b/util/trace-events @@ -55,3 +55,7 @@ lockcnt_futex_wait_prepare(const void *lockcnt, int expec= ted, int new) "lockcnt lockcnt_futex_wait(const void *lockcnt, int val) "lockcnt %p waiting on %d" lockcnt_futex_wait_resume(const void *lockcnt, int new) "lockcnt %p after = wait: %d" lockcnt_futex_wake(const void *lockcnt) "lockcnt %p waking up one waiter" + +# util/qemu-thread-posix.c +qemu_mutex_locked(void *lock) "locked mutex %p" +qemu_mutex_unlocked(void *lock) "unlocked mutex %p" --=20 2.12.2 From nobody Sun May 5 14:10:00 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.zoho.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 1493979483505371.64739065173944; Fri, 5 May 2017 03:18:03 -0700 (PDT) Received: from localhost ([::1]:46056 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aJG-0005Z5-3h for importer@patchew.org; Fri, 05 May 2017 06:18:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47110) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aFH-0002Lj-Tv for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6aFG-0006eL-4P for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60366) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d6aFF-0006e8-Td for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:54 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E80F815D9 for ; Fri, 5 May 2017 10:13:52 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-116-145.ams2.redhat.com [10.36.116.145]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v45ADbkS026855; Fri, 5 May 2017 06:13:52 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E80F815D9 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=pass smtp.mailfrom=pbonzini@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com E80F815D9 From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 5 May 2017 12:13:27 +0200 Message-Id: <20170505101337.4650-12-pbonzini@redhat.com> In-Reply-To: <20170505101337.4650-1-pbonzini@redhat.com> References: <20170505101337.4650-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 05 May 2017 10:13: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 11/21] checkpatch: Disallow glib asserts in main code 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: "Dr. David Alan Gilbert" 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: "Dr. David Alan Gilbert" Glib commit a6a875068779 (from 2013) made many of the glib assert macros non-fatal if a flag is set. This causes two problems: a) Compilers moan that your code is unsafe even though you've put an assert in before the point of use. b) Someone evil could, in a library, call g_test_set_nonfatal_assertions() and cause our assertions in important places not to fail and potentially allow memory overruns. Ban most of the glib assertion functions (basically everything except g_assert and g_assert_not_reached) except in tests/ This makes checkpatch gives an error such as: ERROR: Use g_assert or g_assert_not_reached #77: FILE: vl.c:4725: + g_assert_cmpstr("Chocolate", >, "Cheese"); Signed-off-by: Dr. David Alan Gilbert Message-Id: <20170427165526.19836-1-dgilbert@redhat.com> Signed-off-by: Paolo Bonzini --- scripts/checkpatch.pl | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index f084542934..73cee81b79 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2571,6 +2571,27 @@ sub process { if ($line =3D~ /\bbzero\(/) { ERROR("use memset() instead of bzero()\n" . $herecurr); } + my $non_exit_glib_asserts =3D qr{g_assert_cmpstr| + g_assert_cmpint| + g_assert_cmpuint| + g_assert_cmphex| + g_assert_cmpfloat| + g_assert_true| + g_assert_false| + g_assert_nonnull| + g_assert_null| + g_assert_no_error| + g_assert_error| + g_test_assert_expected_messages| + g_test_trap_assert_passed| + g_test_trap_assert_stdout| + g_test_trap_assert_stdout_unmatched| + g_test_trap_assert_stderr| + g_test_trap_assert_stderr_unmatched}x; + if ($realfile !~ /^tests\// && + $line =3D~ /\b(?:$non_exit_glib_asserts)\(/) { + ERROR("Use g_assert or g_assert_not_reached\n". $herecurr); + } } =20 # If we have no input at all, then there is nothing to report on --=20 2.12.2 From nobody Sun May 5 14:10:00 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.zoho.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 1493979481553133.86554226091835; Fri, 5 May 2017 03:18:01 -0700 (PDT) Received: from localhost ([::1]:46053 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aJD-0005Vn-5L for importer@patchew.org; Fri, 05 May 2017 06:17:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47116) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aFI-0002MT-FP for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6aFH-0006eq-Da for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41940) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d6aFH-0006eR-3X for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:55 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 12B9D7AE81; Fri, 5 May 2017 10:13:54 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-116-145.ams2.redhat.com [10.36.116.145]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v45ADbkT026855; Fri, 5 May 2017 06:13:53 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 12B9D7AE81 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=pass smtp.mailfrom=pbonzini@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 12B9D7AE81 From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 5 May 2017 12:13:28 +0200 Message-Id: <20170505101337.4650-13-pbonzini@redhat.com> In-Reply-To: <20170505101337.4650-1-pbonzini@redhat.com> References: <20170505101337.4650-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 05 May 2017 10:13:54 +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 12/21] hax: Fix memory mapping de-duplication logic 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: Yu Ning 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: Yu Ning hax_update_mapping() avoids unnecessary and potentially expensive calls to HAX_VM_IOCTL_SET_RAM by computing the net result (i.e. effective mapping changes) of each MemoryRegion transaction, with the help of a linked list of HAXMapping objects. However, when processing a new mapping that overlaps with an existing mapping in the list, it fails to handle the case where the start address of the new mapping is above that of the existing mapping in the guest physical address space. This happens when QEMU is launched with "-machine q35 -enable-hax", which involves the following MemoryRegion transaction for digging the VGA hole: region_del: 0x00000000->0x08000000 VA 05fa0000 ('pc.ram') region_add: 0x00000000->0x000a0000 VA 05fa0000 ('pc.ram') region_add: 0x000a0000->0x000c0000 VA 00000000 ('vga-lowmem') region_add: 0x000c0000->0x08000000 VA 06060000 ('pc.ram') where the third MemoryRegion is MMIO and is ignored. The current de-duplication logic handles the last MemoryRegion incorrectly and produces the following result: hax_mapping_dump_list updates: + 0x000c0000->0x08000000 VA 0x06060000 - 0x07fe0000->0x08000000 VA 0x0df80000 which is why VGA emulation does not work for Q35. With this patch, one can see VGA output as Q35 boots up. Note that Q35 support also requires a change to HAXM kernel module, which is not available in the current HAXM release (6.1.2). + Add a warning if the input MemoryRegion is a ROM device, which is not supported by HAXM kernel module at this time. Signed-off-by: Yu Ning Message-Id: <20170428072723.7036-1-yu.ning@linux.intel.com> Signed-off-by: Paolo Bonzini --- target/i386/hax-mem.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/target/i386/hax-mem.c b/target/i386/hax-mem.c index 2884040021..af090343f3 100644 --- a/target/i386/hax-mem.c +++ b/target/i386/hax-mem.c @@ -106,10 +106,10 @@ static void hax_update_mapping(uint64_t start_pa, uin= t32_t size, uint64_t host_va, uint8_t flags) { uint64_t end_pa =3D start_pa + size; - uint32_t chunk_sz; HAXMapping *entry, *next; =20 QTAILQ_FOREACH_SAFE(entry, &mappings, entry, next) { + uint32_t chunk_sz; if (start_pa >=3D entry->start_pa + entry->size) { continue; } @@ -121,7 +121,16 @@ static void hax_update_mapping(uint64_t start_pa, uint= 32_t size, start_pa +=3D chunk_sz; host_va +=3D chunk_sz; size -=3D chunk_sz; + } else if (start_pa > entry->start_pa) { + /* split the existing chunk at start_pa */ + chunk_sz =3D start_pa - entry->start_pa; + hax_insert_mapping_before(entry, entry->start_pa, chunk_sz, + entry->host_va, entry->flags); + entry->start_pa +=3D chunk_sz; + entry->host_va +=3D chunk_sz; + entry->size -=3D chunk_sz; } + /* now start_pa =3D=3D entry->start_pa */ chunk_sz =3D MIN(size, entry->size); if (chunk_sz) { bool nop =3D hax_mapping_is_opposite(entry, host_va, flags); @@ -165,8 +174,14 @@ static void hax_process_section(MemoryRegionSection *s= ection, uint8_t flags) unsigned int delta; uint64_t host_va; =20 - /* We only care about RAM pages */ + /* We only care about RAM and ROM regions */ if (!memory_region_is_ram(mr)) { + if (memory_region_is_romd(mr)) { + /* HAXM kernel module does not support ROMD yet */ + fprintf(stderr, "%s: Warning: Ignoring ROMD region 0x%016" PRI= x64 + "->0x%016" PRIx64 "\n", __func__, start_pa, + start_pa + size); + } return; } =20 --=20 2.12.2 From nobody Sun May 5 14:10:00 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.zoho.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 1493979633890962.1386404320237; Fri, 5 May 2017 03:20:33 -0700 (PDT) Received: from localhost ([::1]:46070 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aLg-0007sB-Bm for importer@patchew.org; Fri, 05 May 2017 06:20:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47130) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aFJ-0002Me-9r for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6aFI-0006fE-Gn for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50834) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d6aFI-0006ew-Ak for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:56 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4497161D11 for ; Fri, 5 May 2017 10:13:55 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-116-145.ams2.redhat.com [10.36.116.145]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v45ADbkU026855; Fri, 5 May 2017 06:13:54 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4497161D11 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=pass smtp.mailfrom=pbonzini@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 4497161D11 From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 5 May 2017 12:13:29 +0200 Message-Id: <20170505101337.4650-14-pbonzini@redhat.com> In-Reply-To: <20170505101337.4650-1-pbonzini@redhat.com> References: <20170505101337.4650-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 05 May 2017 10:13: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 13/21] dump: Acquire BQL around vm_start() in dump thread 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: Fam Zheng 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: Fam Zheng This fixes an assertion failure in the following backtrace: __GI___assert_fail memory_region_transaction_commit memory_region_add_eventfd virtio_pci_ioeventfd_assign virtio_bus_set_host_notifier virtio_blk_data_plane_start virtio_bus_start_ioeventfd virtio_vmstate_change vm_state_notify vm_prepare_start vm_start dump_cleanup dump_process dump_thread start_thread clone vm_start need BQL, acquire it if doing cleaning up from main thread. Signed-off-by: Fam Zheng Message-Id: <20170503072819.14462-1-famz@redhat.com> Signed-off-by: Paolo Bonzini --- dump.c | 7 +++++++ include/sysemu/dump.h | 1 + 2 files changed, 8 insertions(+) diff --git a/dump.c b/dump.c index f7b80d856b..d9090a24cc 100644 --- a/dump.c +++ b/dump.c @@ -77,7 +77,13 @@ static int dump_cleanup(DumpState *s) memory_mapping_list_free(&s->list); close(s->fd); if (s->resume) { + if (s->detached) { + qemu_mutex_lock_iothread(); + } vm_start(); + if (s->detached) { + qemu_mutex_unlock_iothread(); + } } =20 return 0; @@ -1804,6 +1810,7 @@ void qmp_dump_guest_memory(bool paging, const char *f= ile, =20 if (detach_p) { /* detached dump */ + s->detached =3D true; qemu_thread_create(&s->dump_thread, "dump_thread", dump_thread, s, QEMU_THREAD_DETACHED); } else { diff --git a/include/sysemu/dump.h b/include/sysemu/dump.h index ef931be469..2672a15f8b 100644 --- a/include/sysemu/dump.h +++ b/include/sysemu/dump.h @@ -157,6 +157,7 @@ typedef struct DumpState { uint32_t sh_info; bool have_section; bool resume; + bool detached; ssize_t note_size; hwaddr memory_offset; int fd; --=20 2.12.2 From nobody Sun May 5 14:10:00 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.zoho.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 1493979779546965.3477272008515; Fri, 5 May 2017 03:22:59 -0700 (PDT) Received: from localhost ([::1]:46079 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aO2-0001o6-3c for importer@patchew.org; Fri, 05 May 2017 06:22:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47145) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aFK-0002OQ-UE for qemu-devel@nongnu.org; Fri, 05 May 2017 06:14:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6aFJ-0006fj-N3 for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54450) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d6aFJ-0006fM-Df for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:57 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 720F03D974 for ; Fri, 5 May 2017 10:13:56 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-116-145.ams2.redhat.com [10.36.116.145]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v45ADbkV026855; Fri, 5 May 2017 06:13:55 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 720F03D974 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=pass smtp.mailfrom=pbonzini@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 720F03D974 From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 5 May 2017 12:13:30 +0200 Message-Id: <20170505101337.4650-15-pbonzini@redhat.com> In-Reply-To: <20170505101337.4650-1-pbonzini@redhat.com> References: <20170505101337.4650-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 05 May 2017 10:13:56 +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 14/21] Fix the -accel parameter and the documentation for 'hax' 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: Thomas Huth 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: Thomas Huth Since 'hax' is a possible accelerator nowadays, too, the '-accel' option should support it and we should mention this accelerator in the documentation, too. Signed-off-by: Thomas Huth Message-Id: <1493875481-16388-1-git-send-email-thuth@redhat.com> Signed-off-by: Paolo Bonzini --- qemu-options.hx | 18 +++++++++--------- vl.c | 23 +++++++++-------------- 2 files changed, 18 insertions(+), 23 deletions(-) diff --git a/qemu-options.hx b/qemu-options.hx index f68829f3b0..70c0ded12e 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -31,7 +31,7 @@ DEF("machine", HAS_ARG, QEMU_OPTION_machine, \ "-machine [type=3D]name[,prop[=3Dvalue][,...]]\n" " selects emulated machine ('-machine help' for list)\n" " property accel=3Daccel1[:accel2[:...]] selects accele= rator\n" - " supported accelerators are kvm, xen, tcg (default: tc= g)\n" + " supported accelerators are kvm, xen, hax or tcg (defa= ult: tcg)\n" " kernel_irqchip=3Don|off|split controls accelerated ir= qchip support (default=3Doff)\n" " vmport=3Don|off|auto controls emulation of vmport (de= fault: auto)\n" " kvm_shadow_mem=3Dsize of KVM shadow MMU in bytes\n" @@ -52,9 +52,9 @@ available machines. Supported machine properties are: @table @option @item accel=3D@var{accels1}[:@var{accels2}[:...]] This is used to enable an accelerator. Depending on the target architectur= e, -kvm, xen, or tcg can be available. By default, tcg is used. If there is mo= re -than one accelerator specified, the next one is used if the previous one f= ails -to initialize. +kvm, xen, hax or tcg can be available. By default, tcg is used. If there is +more than one accelerator specified, the next one is used if the previous = one +fails to initialize. @item kernel_irqchip=3Don|off Controls in-kernel irqchip support for the chosen accelerator when availab= le. @item gfx_passthru=3Don|off @@ -97,15 +97,15 @@ ETEXI =20 DEF("accel", HAS_ARG, QEMU_OPTION_accel, "-accel [accel=3D]accelerator[,thread=3Dsingle|multi]\n" - " select accelerator ('-accel help for list')\n" - " thread=3Dsingle|multi (enable multi-threaded TCG)", QE= MU_ARCH_ALL) + " select accelerator (kvm, xen, hax or tcg; use 'help' = for a list)\n" + " thread=3Dsingle|multi (enable multi-threaded TCG)", Q= EMU_ARCH_ALL) STEXI @item -accel @var{name}[,prop=3D@var{value}[,...]] @findex -accel This is used to enable an accelerator. Depending on the target architectur= e, -kvm, xen, or tcg can be available. By default, tcg is used. If there is mo= re -than one accelerator specified, the next one is used if the previous one f= ails -to initialize. +kvm, xen, hax or tcg can be available. By default, tcg is used. If there is +more than one accelerator specified, the next one is used if the previous = one +fails to initialize. @table @option @item thread=3Dsingle|multi Controls number of TCG threads. When the TCG is multi-threaded there will = be one diff --git a/vl.c b/vl.c index 42d4bce439..17b9a8ac2f 100644 --- a/vl.c +++ b/vl.c @@ -3727,26 +3727,21 @@ int main(int argc, char **argv, char **envp) qdev_prop_register_global(&kvm_pit_lost_tick_policy); break; } - case QEMU_OPTION_accel: + case QEMU_OPTION_accel: { + QemuOpts *accel_opts; + accel_opts =3D qemu_opts_parse_noisily(qemu_find_opts("acc= el"), optarg, true); optarg =3D qemu_opt_get(accel_opts, "accel"); - - olist =3D qemu_find_opts("machine"); - if (strcmp("kvm", optarg) =3D=3D 0) { - qemu_opts_parse_noisily(olist, "accel=3Dkvm", false); - } else if (strcmp("xen", optarg) =3D=3D 0) { - qemu_opts_parse_noisily(olist, "accel=3Dxen", false); - } else if (strcmp("tcg", optarg) =3D=3D 0) { - qemu_opts_parse_noisily(olist, "accel=3Dtcg", false); - } else { - if (!is_help_option(optarg)) { - error_printf("Unknown accelerator: %s", optarg); - } - error_printf("Supported accelerators: kvm, xen, tcg\n"= ); + if (!optarg || is_help_option(optarg)) { + error_printf("Possible accelerators: kvm, xen, hax, tc= g\n"); exit(1); } + accel_opts =3D qemu_opts_create(qemu_find_opts("machine"),= NULL, + false, &error_abort); + qemu_opt_set(accel_opts, "accel", optarg, &error_abort); break; + } case QEMU_OPTION_usb: olist =3D qemu_find_opts("machine"); qemu_opts_parse_noisily(olist, "usb=3Don", false); --=20 2.12.2 From nobody Sun May 5 14:10:00 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.zoho.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 1493979780799574.1643087420899; Fri, 5 May 2017 03:23:00 -0700 (PDT) Received: from localhost ([::1]:46081 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aO3-0001oS-8u for importer@patchew.org; Fri, 05 May 2017 06:22:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47151) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aFL-0002PC-Hz for qemu-devel@nongnu.org; Fri, 05 May 2017 06:14:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6aFK-0006gA-Ot for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51120) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d6aFK-0006fv-IN for qemu-devel@nongnu.org; Fri, 05 May 2017 06:13:58 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 856F68048C; Fri, 5 May 2017 10:13:57 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-116-145.ams2.redhat.com [10.36.116.145]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v45ADbkW026855; Fri, 5 May 2017 06:13:56 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 856F68048C Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=pbonzini@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 856F68048C From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 5 May 2017 12:13:31 +0200 Message-Id: <20170505101337.4650-16-pbonzini@redhat.com> In-Reply-To: <20170505101337.4650-1-pbonzini@redhat.com> References: <20170505101337.4650-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 05 May 2017 10:13: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 15/21] MAINTAINERS: Add "R:" tag for self-appointed reviewers 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: "Paul E. McKenney" 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: "Paul E. McKenney" Some people are not content with the amount of mail they get, and would like to be CCed on patches for areas they do not maintain. Let them satisfy their own appetite for qemu-devel messages. Seriously: the purpose here is a bit different from the Linux kernel. While Linux uses "R" to designate non-maintainers for reviewing patches in a given area, in QEMU I would also like to use "R" so that people can delegate sending pull requests while keeping some degree of oversight. Based on Linux commit eafbaac3093760d1fd3b2a5b9f016362dd68af36. Signed-off-by: Paul E. McKenney Reviewed-by: Thomas Huth Signed-off-by: Paolo Bonzini --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index a1d2b3a4d3..46cf4870f9 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -12,6 +12,8 @@ consult qemu-devel and not any specific individual privat= ely. Descriptions of section entries: =20 M: Mail patches to: FullName + R: Designated reviewer: FullName + These reviewers should be CCed on patches. L: Mailing list that is relevant to this area W: Web-page with status/info Q: Patchwork web based patch tracking system site --=20 2.12.2 From nobody Sun May 5 14:10:00 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.zoho.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 1493979904153324.8097267594103; Fri, 5 May 2017 03:25:04 -0700 (PDT) Received: from localhost ([::1]:46090 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aQ2-0003ZQ-H1 for importer@patchew.org; Fri, 05 May 2017 06:25:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47193) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aFQ-0002Ua-9R for qemu-devel@nongnu.org; Fri, 05 May 2017 06:14:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6aFM-0006ge-97 for qemu-devel@nongnu.org; Fri, 05 May 2017 06:14:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60530) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d6aFM-0006gL-0D for qemu-devel@nongnu.org; Fri, 05 May 2017 06:14:00 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D696C37F1F; Fri, 5 May 2017 10:13:58 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-116-145.ams2.redhat.com [10.36.116.145]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v45ADbkX026855; Fri, 5 May 2017 06:13:57 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D696C37F1F 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=pass smtp.mailfrom=pbonzini@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com D696C37F1F From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 5 May 2017 12:13:32 +0200 Message-Id: <20170505101337.4650-17-pbonzini@redhat.com> In-Reply-To: <20170505101337.4650-1-pbonzini@redhat.com> References: <20170505101337.4650-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 05 May 2017 10:13:59 +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 16/21] get_maintainer: Teach get_maintainer.pl about the new "R:" tag 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 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: Joe Perches We can now designate reviewers in the MAINTAINERS file with the new "R:" tag, so this commit teaches get_maintainers.pl to add their email addresses. Cherry picked from Linux commit c1c3f2c906e35bcb6e4cdf5b8e077660fead14fe, with fixes to avoid \C as in QEMU commit ba10f729f1 ("get_maintainer.pl: \C is deprecated", 2015-09-25). Signed-off-by: Joe Perches Reviewed-by: Thomas Huth Signed-off-by: Paolo Bonzini --- scripts/get_maintainer.pl | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index 8261bcb1ad..c1146ca194 100755 --- a/scripts/get_maintainer.pl +++ b/scripts/get_maintainer.pl @@ -21,6 +21,7 @@ my $lk_path =3D "./"; my $email =3D 1; my $email_usename =3D 1; my $email_maintainer =3D 1; +my $email_reviewer =3D 1; my $email_list =3D 1; my $email_subscriber_list =3D 0; my $email_git =3D 0; @@ -180,6 +181,7 @@ if (!GetOptions( 'remove-duplicates!' =3D> \$email_remove_duplicates, 'mailmap!' =3D> \$email_use_mailmap, 'm!' =3D> \$email_maintainer, + 'r!' =3D> \$email_reviewer, 'n!' =3D> \$email_usename, 'l!' =3D> \$email_list, 's!' =3D> \$email_subscriber_list, @@ -238,7 +240,8 @@ if ($sections) { } =20 if ($email && - ($email_maintainer + $email_list + $email_subscriber_list + + ($email_maintainer + $email_reviewer + + $email_list + $email_subscriber_list + $email_git + $email_git_blame) =3D=3D 0) { die "$P: Please select at least 1 email option\n"; } @@ -718,6 +721,7 @@ MAINTAINER field selection options: --hg-since =3D> hg history to use (default: $email_hg_since) --interactive =3D> display a menu (mostly useful if used with the --gi= t option) --m =3D> include maintainer(s) if any + --r =3D> include reviewer(s) if any --n =3D> include name 'Full Name ' --l =3D> include list(s) if any --s =3D> include subscriber only list(s) if any @@ -1022,6 +1026,22 @@ sub add_categories { my $role =3D get_maintainer_role($i); push_email_addresses($pvalue, $role); } + } elsif ($ptype eq "R") { + my ($name, $address) =3D parse_email($pvalue); + if ($name eq "") { + if ($i > 0) { + my $tv =3D $typevalue[$i - 1]; + if ($tv =3D~ m/^(.):\s*(.*)/) { + if ($1 eq "P") { + $name =3D $2; + $pvalue =3D format_email($name, $address, $email_usename); + } + } + } + } + if ($email_reviewer) { + push_email_addresses($pvalue, 'reviewer'); + } } elsif ($ptype eq "T") { push(@scm, $pvalue); } elsif ($ptype eq "W") { --=20 2.12.2 From nobody Sun May 5 14:10:00 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.zoho.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 1493980170391946.3868029273125; Fri, 5 May 2017 03:29:30 -0700 (PDT) Received: from localhost ([::1]:46117 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aUL-0007Mf-1m for importer@patchew.org; Fri, 05 May 2017 06:29:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47192) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aFQ-0002UZ-9S for qemu-devel@nongnu.org; Fri, 05 May 2017 06:14:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6aFN-0006gy-5r for qemu-devel@nongnu.org; Fri, 05 May 2017 06:14:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33044) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d6aFM-0006gj-VU for qemu-devel@nongnu.org; Fri, 05 May 2017 06:14:01 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 07A9BC056790; Fri, 5 May 2017 10:14:00 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-116-145.ams2.redhat.com [10.36.116.145]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v45ADbkY026855; Fri, 5 May 2017 06:13:59 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 07A9BC056790 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=pbonzini@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 07A9BC056790 From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 5 May 2017 12:13:33 +0200 Message-Id: <20170505101337.4650-18-pbonzini@redhat.com> In-Reply-To: <20170505101337.4650-1-pbonzini@redhat.com> References: <20170505101337.4650-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 05 May 2017 10:14:00 +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 17/21] get_maintainer: it's '--pattern-depth', not '-pattern-depth' 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: Brian Norris 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: Brian Norris Though it appears that Perl's GetOptions will take either, the latter is not documented in the options listing. Cherry picked from Linux commit cc7ff0ef6eca3deeea4a424ca47a67c8450d5424. Signed-off-by: Brian Norris Reviewed-by: Thomas Huth Signed-off-by: Paolo Bonzini --- scripts/get_maintainer.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index c1146ca194..1f637ff076 100755 --- a/scripts/get_maintainer.pl +++ b/scripts/get_maintainer.pl @@ -748,7 +748,7 @@ Other options: --help =3D> show this help information =20 Default options: - [--email --nogit --git-fallback --m --n --l --multiline -pattern-depth= =3D0 + [--email --nogit --git-fallback --m --n --l --multiline --pattern-depth= =3D0 --remove-duplicates --rolestats] =20 Notes: --=20 2.12.2 From nobody Sun May 5 14:10:00 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.zoho.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 1493979638318823.2045631498954; Fri, 5 May 2017 03:20:38 -0700 (PDT) Received: from localhost ([::1]:46071 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aLl-0007xL-18 for importer@patchew.org; Fri, 05 May 2017 06:20:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47191) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aFQ-0002UY-9T for qemu-devel@nongnu.org; Fri, 05 May 2017 06:14:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6aFO-0006hb-Cc for qemu-devel@nongnu.org; Fri, 05 May 2017 06:14:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46114) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d6aFO-0006h2-6J for qemu-devel@nongnu.org; Fri, 05 May 2017 06:14:02 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2EB6C80C06; Fri, 5 May 2017 10:14:01 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-116-145.ams2.redhat.com [10.36.116.145]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v45ADbkZ026855; Fri, 5 May 2017 06:14:00 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2EB6C80C06 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=pbonzini@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 2EB6C80C06 From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 5 May 2017 12:13:34 +0200 Message-Id: <20170505101337.4650-19-pbonzini@redhat.com> In-Reply-To: <20170505101337.4650-1-pbonzini@redhat.com> References: <20170505101337.4650-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 05 May 2017 10:14:01 +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 18/21] get_maintainer: --r (list reviewer) is on by default 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: Brian Norris 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: Brian Norris We don't consistenly document the default value next to the option listing, but we do have a list of defaults here, so let's keep it up to date. Cherry picked from Linux commit 4f07510df2e8c47fd65b8ffaaf6c5d334d59d598. Signed-off-by: Brian Norris Reviewed-by: Thomas Huth Signed-off-by: Paolo Bonzini --- scripts/get_maintainer.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index 1f637ff076..c7cb197a27 100755 --- a/scripts/get_maintainer.pl +++ b/scripts/get_maintainer.pl @@ -748,7 +748,7 @@ Other options: --help =3D> show this help information =20 Default options: - [--email --nogit --git-fallback --m --n --l --multiline --pattern-depth= =3D0 + [--email --nogit --git-fallback --m --r --n --l --multiline --pattern-de= pth=3D0 --remove-duplicates --rolestats] =20 Notes: --=20 2.12.2 From nobody Sun May 5 14:10:00 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.zoho.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 1493980018914301.6592254467947; Fri, 5 May 2017 03:26:58 -0700 (PDT) Received: from localhost ([::1]:46105 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aRt-00058y-Ak for importer@patchew.org; Fri, 05 May 2017 06:26:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47197) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aFQ-0002Ul-HH for qemu-devel@nongnu.org; Fri, 05 May 2017 06:14:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6aFP-0006hw-K6 for qemu-devel@nongnu.org; Fri, 05 May 2017 06:14:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33112) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d6aFP-0006hh-D8 for qemu-devel@nongnu.org; Fri, 05 May 2017 06:14:03 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 564CBC05678F; Fri, 5 May 2017 10:14:02 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-116-145.ams2.redhat.com [10.36.116.145]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v45ADbka026855; Fri, 5 May 2017 06:14:01 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 564CBC05678F Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=pbonzini@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 564CBC05678F From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 5 May 2017 12:13:35 +0200 Message-Id: <20170505101337.4650-20-pbonzini@redhat.com> In-Reply-To: <20170505101337.4650-1-pbonzini@redhat.com> References: <20170505101337.4650-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 05 May 2017 10:14:02 +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 19/21] get_maintainer: add subsystem to reviewer output 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 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: Joe Perches Reviewer output currently does not include the subsystem that matched. Add it. Miscellanea: o Add a get_subsystem_name routine to centralize this Cherry picked from Linux commit 2a7cb1dc82fc2a52e747b4c496c13f6575fb1790. Signed-off-by: Joe Perches Reviewed-by: Thomas Huth Signed-off-by: Paolo Bonzini --- scripts/get_maintainer.pl | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index c7cb197a27..96e66a80a0 100755 --- a/scripts/get_maintainer.pl +++ b/scripts/get_maintainer.pl @@ -896,20 +896,29 @@ sub find_ending_index { return $index; } =20 -sub get_maintainer_role { +sub get_subsystem_name { my ($index) =3D @_; =20 - my $i; my $start =3D find_starting_index($index); - my $end =3D find_ending_index($index); =20 - my $role =3D "unknown"; my $subsystem =3D $typevalue[$start]; if (length($subsystem) > 20) { $subsystem =3D substr($subsystem, 0, 17); $subsystem =3D~ s/\s*$//; $subsystem =3D $subsystem . "..."; } + return $subsystem; +} + +sub get_maintainer_role { + my ($index) =3D @_; + + my $i; + my $start =3D find_starting_index($index); + my $end =3D find_ending_index($index); + + my $role =3D "unknown"; + my $subsystem =3D get_subsystem_name($index); =20 for ($i =3D $start + 1; $i < $end; $i++) { my $tv =3D $typevalue[$i]; @@ -943,16 +952,7 @@ sub get_maintainer_role { sub get_list_role { my ($index) =3D @_; =20 - my $i; - my $start =3D find_starting_index($index); - my $end =3D find_ending_index($index); - - my $subsystem =3D $typevalue[$start]; - if (length($subsystem) > 20) { - $subsystem =3D substr($subsystem, 0, 17); - $subsystem =3D~ s/\s*$//; - $subsystem =3D $subsystem . "..."; - } + my $subsystem =3D get_subsystem_name($index); =20 if ($subsystem eq "THE REST") { $subsystem =3D ""; @@ -1040,7 +1040,8 @@ sub add_categories { } } if ($email_reviewer) { - push_email_addresses($pvalue, 'reviewer'); + my $subsystem =3D get_subsystem_name($i); + push_email_addresses($pvalue, "reviewer:$subsystem"); } } elsif ($ptype eq "T") { push(@scm, $pvalue); --=20 2.12.2 From nobody Sun May 5 14:10:00 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.zoho.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 14939801271511019.4802301980759; Fri, 5 May 2017 03:28:47 -0700 (PDT) Received: from localhost ([::1]:46115 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aTb-0006r6-Q0 for importer@patchew.org; Fri, 05 May 2017 06:28:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47229) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aFR-0002WC-SK for qemu-devel@nongnu.org; Fri, 05 May 2017 06:14:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6aFQ-0006ia-NH for qemu-devel@nongnu.org; Fri, 05 May 2017 06:14:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60654) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d6aFQ-0006i4-Hz for qemu-devel@nongnu.org; Fri, 05 May 2017 06:14:04 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8A96E37F1F; Fri, 5 May 2017 10:14:03 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-116-145.ams2.redhat.com [10.36.116.145]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v45ADbkb026855; Fri, 5 May 2017 06:14:02 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8A96E37F1F 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=pass smtp.mailfrom=pbonzini@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 8A96E37F1F From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 5 May 2017 12:13:36 +0200 Message-Id: <20170505101337.4650-21-pbonzini@redhat.com> In-Reply-To: <20170505101337.4650-1-pbonzini@redhat.com> References: <20170505101337.4650-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 05 May 2017 10:14:03 +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 20/21] libvhost-user: replace vasprintf() to fix build 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: Felipe Franciosi 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: Felipe Franciosi On gcc 3.4 and newer, simply using (void) in front of WUR functions is not sufficient to ignore the return value. That prevents a build when handling warnings as errors. libvhost-user had a usage of (void)vasprintf() which triggered such a condition. This fixes it by replacing this call with g_strdup_vprintf() which aborts on OOM. Signed-off-by: Felipe Franciosi Message-Id: <1488479153-21203-2-git-send-email-felipe@nutanix.com> Reviewed-by: Eric Blake --- contrib/libvhost-user/libvhost-user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-user/= libvhost-user.c index af4faad60b..61e1657e41 100644 --- a/contrib/libvhost-user/libvhost-user.c +++ b/contrib/libvhost-user/libvhost-user.c @@ -81,7 +81,7 @@ vu_panic(VuDev *dev, const char *msg, ...) va_list ap; =20 va_start(ap, msg); - (void)vasprintf(&buf, msg, ap); + buf =3D g_strdup_vprintf(msg, ap); va_end(ap); =20 dev->broken =3D true; --=20 2.12.2 From nobody Sun May 5 14:10:00 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.zoho.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 1493980217879981.9625361341381; Fri, 5 May 2017 03:30:17 -0700 (PDT) Received: from localhost ([::1]:46120 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aV6-0007sr-ET for importer@patchew.org; Fri, 05 May 2017 06:30:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47247) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6aFU-0002ZE-LJ for qemu-devel@nongnu.org; Fri, 05 May 2017 06:14:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6aFS-0006k9-7F for qemu-devel@nongnu.org; Fri, 05 May 2017 06:14:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60690) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d6aFR-0006il-Sr for qemu-devel@nongnu.org; Fri, 05 May 2017 06:14:06 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E1FD719D00C; Fri, 5 May 2017 10:14:04 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-116-145.ams2.redhat.com [10.36.116.145]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v45ADbkc026855; Fri, 5 May 2017 06:14:03 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E1FD719D00C 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=pass smtp.mailfrom=pbonzini@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com E1FD719D00C From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 5 May 2017 12:13:37 +0200 Message-Id: <20170505101337.4650-22-pbonzini@redhat.com> In-Reply-To: <20170505101337.4650-1-pbonzini@redhat.com> References: <20170505101337.4650-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 05 May 2017 10:14:05 +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 21/21] vhost-scsi: create a vhost-scsi-common abstraction 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: Felipe Franciosi 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: Felipe Franciosi In order to introduce a new vhost-user-scsi host device type, it makes sense to abstract part of vhost-scsi into a common parent class. This commit does exactly that. Signed-off-by: Felipe Franciosi Message-Id: <1488479153-21203-3-git-send-email-felipe@nutanix.com> --- hw/scsi/Makefile.objs | 2 +- hw/scsi/vhost-scsi-common.c | 143 +++++++++++++++++++++++++ hw/scsi/vhost-scsi.c | 194 ++++++++++--------------------= ---- include/hw/virtio/vhost-scsi-common.h | 48 +++++++++ include/hw/virtio/vhost-scsi.h | 11 +- include/hw/virtio/virtio-scsi.h | 2 + 6 files changed, 252 insertions(+), 148 deletions(-) create mode 100644 hw/scsi/vhost-scsi-common.c create mode 100644 include/hw/virtio/vhost-scsi-common.h diff --git a/hw/scsi/Makefile.objs b/hw/scsi/Makefile.objs index 5a2248be36..54d8754e9a 100644 --- a/hw/scsi/Makefile.objs +++ b/hw/scsi/Makefile.objs @@ -10,5 +10,5 @@ obj-$(CONFIG_PSERIES) +=3D spapr_vscsi.o =20 ifeq ($(CONFIG_VIRTIO),y) obj-y +=3D virtio-scsi.o virtio-scsi-dataplane.o -obj-$(CONFIG_VHOST_SCSI) +=3D vhost-scsi.o +obj-$(CONFIG_VHOST_SCSI) +=3D vhost-scsi-common.o vhost-scsi.o endif diff --git a/hw/scsi/vhost-scsi-common.c b/hw/scsi/vhost-scsi-common.c new file mode 100644 index 0000000000..e41c0314db --- /dev/null +++ b/hw/scsi/vhost-scsi-common.c @@ -0,0 +1,143 @@ +/* + * vhost-scsi-common + * + * Copyright (c) 2016 Nutanix Inc. All rights reserved. + * + * Author: + * Felipe Franciosi + * + * This work is largely based on the "vhost-scsi" implementation by: + * Stefan Hajnoczi + * Nicholas Bellinger + * + * This work is licensed under the terms of the GNU LGPL, version 2 or lat= er. + * See the COPYING.LIB file in the top-level directory. + * + */ + +#include "qemu/osdep.h" +#include +#include "qapi/error.h" +#include "qemu/error-report.h" +#include "migration/migration.h" +#include "hw/virtio/vhost.h" +#include "hw/virtio/vhost-scsi-common.h" +#include "hw/virtio/virtio-scsi.h" +#include "hw/virtio/virtio-bus.h" +#include "hw/virtio/virtio-access.h" +#include "hw/fw-path-provider.h" + +int vhost_scsi_common_start(VHostSCSICommon *vsc) +{ + int ret, i; + VirtIODevice *vdev =3D VIRTIO_DEVICE(vsc); + BusState *qbus =3D BUS(qdev_get_parent_bus(DEVICE(vdev))); + VirtioBusClass *k =3D VIRTIO_BUS_GET_CLASS(qbus); + + if (!k->set_guest_notifiers) { + error_report("binding does not support guest notifiers"); + return -ENOSYS; + } + + ret =3D vhost_dev_enable_notifiers(&vsc->dev, vdev); + if (ret < 0) { + return ret; + } + + ret =3D k->set_guest_notifiers(qbus->parent, vsc->dev.nvqs, true); + if (ret < 0) { + error_report("Error binding guest notifier"); + goto err_host_notifiers; + } + + vsc->dev.acked_features =3D vdev->guest_features; + ret =3D vhost_dev_start(&vsc->dev, vdev); + if (ret < 0) { + error_report("Error start vhost dev"); + goto err_guest_notifiers; + } + + /* guest_notifier_mask/pending not used yet, so just unmask + * everything here. virtio-pci will do the right thing by + * enabling/disabling irqfd. + */ + for (i =3D 0; i < vsc->dev.nvqs; i++) { + vhost_virtqueue_mask(&vsc->dev, vdev, vsc->dev.vq_index + i, false= ); + } + + return ret; + +err_guest_notifiers: + k->set_guest_notifiers(qbus->parent, vsc->dev.nvqs, false); +err_host_notifiers: + vhost_dev_disable_notifiers(&vsc->dev, vdev); + return ret; +} + +void vhost_scsi_common_stop(VHostSCSICommon *vsc) +{ + VirtIODevice *vdev =3D VIRTIO_DEVICE(vsc); + BusState *qbus =3D BUS(qdev_get_parent_bus(DEVICE(vdev))); + VirtioBusClass *k =3D VIRTIO_BUS_GET_CLASS(qbus); + int ret =3D 0; + + vhost_dev_stop(&vsc->dev, vdev); + + if (k->set_guest_notifiers) { + ret =3D k->set_guest_notifiers(qbus->parent, vsc->dev.nvqs, false); + if (ret < 0) { + error_report("vhost guest notifier cleanup failed: %d", re= t); + } + } + assert(ret >=3D 0); + + vhost_dev_disable_notifiers(&vsc->dev, vdev); +} + +uint64_t vhost_scsi_common_get_features(VirtIODevice *vdev, uint64_t featu= res, + Error **errp) +{ + VHostSCSICommon *vsc =3D VHOST_SCSI_COMMON(vdev); + + return vhost_get_features(&vsc->dev, vsc->feature_bits, features); +} + +void vhost_scsi_common_set_config(VirtIODevice *vdev, const uint8_t *confi= g) +{ + VirtIOSCSIConfig *scsiconf =3D (VirtIOSCSIConfig *)config; + VirtIOSCSICommon *vs =3D VIRTIO_SCSI_COMMON(vdev); + + if ((uint32_t)virtio_ldl_p(vdev, &scsiconf->sense_size) !=3D vs->sense= _size || + (uint32_t)virtio_ldl_p(vdev, &scsiconf->cdb_size) !=3D vs->cdb_siz= e) { + error_report("vhost-scsi does not support changing the sense data = and " + "CDB sizes"); + exit(1); + } +} + +/* + * Implementation of an interface to adjust firmware path + * for the bootindex property handling. + */ +char *vhost_scsi_common_get_fw_dev_path(FWPathProvider *p, BusState *bus, + DeviceState *dev) +{ + VHostSCSICommon *vsc =3D VHOST_SCSI_COMMON(dev); + /* format: /channel@channel/vhost-scsi@target,lun */ + return g_strdup_printf("/channel@%x/%s@%x,%x", vsc->channel, + qdev_fw_name(dev), vsc->target, vsc->lun); +} + +static const TypeInfo vhost_scsi_common_info =3D { + .name =3D TYPE_VHOST_SCSI_COMMON, + .parent =3D TYPE_VIRTIO_SCSI_COMMON, + .instance_size =3D sizeof(VHostSCSICommon), + .abstract =3D true, +}; + +static void virtio_register_types(void) +{ + type_register_static(&vhost_scsi_common_info); +} + +type_init(virtio_register_types) diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c index f53bc179da..8f53ac3795 100644 --- a/hw/scsi/vhost-scsi.c +++ b/hw/scsi/vhost-scsi.c @@ -42,13 +42,14 @@ static const int kernel_feature_bits[] =3D { static int vhost_scsi_set_endpoint(VHostSCSI *s) { VirtIOSCSICommon *vs =3D VIRTIO_SCSI_COMMON(s); - const VhostOps *vhost_ops =3D s->dev.vhost_ops; + VHostSCSICommon *vsc =3D VHOST_SCSI_COMMON(s); + const VhostOps *vhost_ops =3D vsc->dev.vhost_ops; struct vhost_scsi_target backend; int ret; =20 memset(&backend, 0, sizeof(backend)); pstrcpy(backend.vhost_wwpn, sizeof(backend.vhost_wwpn), vs->conf.wwpn); - ret =3D vhost_ops->vhost_scsi_set_endpoint(&s->dev, &backend); + ret =3D vhost_ops->vhost_scsi_set_endpoint(&vsc->dev, &backend); if (ret < 0) { return -errno; } @@ -58,130 +59,62 @@ static int vhost_scsi_set_endpoint(VHostSCSI *s) static void vhost_scsi_clear_endpoint(VHostSCSI *s) { VirtIOSCSICommon *vs =3D VIRTIO_SCSI_COMMON(s); + VHostSCSICommon *vsc =3D VHOST_SCSI_COMMON(s); struct vhost_scsi_target backend; - const VhostOps *vhost_ops =3D s->dev.vhost_ops; + const VhostOps *vhost_ops =3D vsc->dev.vhost_ops; =20 memset(&backend, 0, sizeof(backend)); pstrcpy(backend.vhost_wwpn, sizeof(backend.vhost_wwpn), vs->conf.wwpn); - vhost_ops->vhost_scsi_clear_endpoint(&s->dev, &backend); + vhost_ops->vhost_scsi_clear_endpoint(&vsc->dev, &backend); } =20 static int vhost_scsi_start(VHostSCSI *s) { - int ret, abi_version, i; - VirtIODevice *vdev =3D VIRTIO_DEVICE(s); - BusState *qbus =3D BUS(qdev_get_parent_bus(DEVICE(vdev))); - VirtioBusClass *k =3D VIRTIO_BUS_GET_CLASS(qbus); - const VhostOps *vhost_ops =3D s->dev.vhost_ops; - - if (!k->set_guest_notifiers) { - error_report("binding does not support guest notifiers"); - return -ENOSYS; - } + int ret, abi_version; + VHostSCSICommon *vsc =3D VHOST_SCSI_COMMON(s); + const VhostOps *vhost_ops =3D vsc->dev.vhost_ops; =20 - ret =3D vhost_ops->vhost_scsi_get_abi_version(&s->dev, &abi_version); + ret =3D vhost_ops->vhost_scsi_get_abi_version(&vsc->dev, &abi_version); if (ret < 0) { return -errno; } if (abi_version > VHOST_SCSI_ABI_VERSION) { error_report("vhost-scsi: The running tcm_vhost kernel abi_version= :" - " %d is greater than vhost_scsi userspace supports: %= d, please" - " upgrade your version of QEMU", abi_version, + " %d is greater than vhost_scsi userspace supports: %= d," + " please upgrade your version of QEMU", abi_version, VHOST_SCSI_ABI_VERSION); return -ENOSYS; } =20 - ret =3D vhost_dev_enable_notifiers(&s->dev, vdev); + ret =3D vhost_scsi_common_start(vsc); if (ret < 0) { return ret; } =20 - s->dev.acked_features =3D vdev->guest_features; - ret =3D vhost_dev_start(&s->dev, vdev); - if (ret < 0) { - error_report("Error start vhost dev"); - goto err_notifiers; - } - ret =3D vhost_scsi_set_endpoint(s); if (ret < 0) { - error_report("Error set vhost-scsi endpoint"); - goto err_vhost_stop; - } - - ret =3D k->set_guest_notifiers(qbus->parent, s->dev.nvqs, true); - if (ret < 0) { - error_report("Error binding guest notifier"); - goto err_endpoint; - } - - /* guest_notifier_mask/pending not used yet, so just unmask - * everything here. virtio-pci will do the right thing by - * enabling/disabling irqfd. - */ - for (i =3D 0; i < s->dev.nvqs; i++) { - vhost_virtqueue_mask(&s->dev, vdev, s->dev.vq_index + i, false); + error_report("Error setting vhost-scsi endpoint"); + vhost_scsi_common_stop(vsc); } =20 return ret; - -err_endpoint: - vhost_scsi_clear_endpoint(s); -err_vhost_stop: - vhost_dev_stop(&s->dev, vdev); -err_notifiers: - vhost_dev_disable_notifiers(&s->dev, vdev); - return ret; } =20 static void vhost_scsi_stop(VHostSCSI *s) { - VirtIODevice *vdev =3D VIRTIO_DEVICE(s); - BusState *qbus =3D BUS(qdev_get_parent_bus(DEVICE(vdev))); - VirtioBusClass *k =3D VIRTIO_BUS_GET_CLASS(qbus); - int ret =3D 0; - - if (k->set_guest_notifiers) { - ret =3D k->set_guest_notifiers(qbus->parent, s->dev.nvqs, false); - if (ret < 0) { - error_report("vhost guest notifier cleanup failed: %d", re= t); - } - } - assert(ret >=3D 0); + VHostSCSICommon *vsc =3D VHOST_SCSI_COMMON(s); =20 vhost_scsi_clear_endpoint(s); - vhost_dev_stop(&s->dev, vdev); - vhost_dev_disable_notifiers(&s->dev, vdev); -} - -static uint64_t vhost_scsi_get_features(VirtIODevice *vdev, - uint64_t features, - Error **errp) -{ - VHostSCSI *s =3D VHOST_SCSI(vdev); - - return vhost_get_features(&s->dev, kernel_feature_bits, features); -} - -static void vhost_scsi_set_config(VirtIODevice *vdev, - const uint8_t *config) -{ - VirtIOSCSIConfig *scsiconf =3D (VirtIOSCSIConfig *)config; - VirtIOSCSICommon *vs =3D VIRTIO_SCSI_COMMON(vdev); - - if ((uint32_t) virtio_ldl_p(vdev, &scsiconf->sense_size) !=3D vs->sens= e_size || - (uint32_t) virtio_ldl_p(vdev, &scsiconf->cdb_size) !=3D vs->cdb_si= ze) { - error_report("vhost-scsi does not support changing the sense data = and CDB sizes"); - exit(1); - } + vhost_scsi_common_stop(vsc); } =20 static void vhost_scsi_set_status(VirtIODevice *vdev, uint8_t val) { - VHostSCSI *s =3D (VHostSCSI *)vdev; + VHostSCSI *s =3D VHOST_SCSI(vdev); + VHostSCSICommon *vsc =3D VHOST_SCSI_COMMON(s); bool start =3D (val & VIRTIO_CONFIG_S_DRIVER_OK); =20 - if (s->dev.started =3D=3D start) { + if (vsc->dev.started =3D=3D start) { return; } =20 @@ -190,10 +123,7 @@ static void vhost_scsi_set_status(VirtIODevice *vdev, = uint8_t val) =20 ret =3D vhost_scsi_start(s); if (ret < 0) { - error_report("virtio-scsi: unable to start vhost: %s", - strerror(-ret)); - - /* There is no userspace virtio-scsi fallback so exit */ + error_report("unable to start vhost-scsi: %s", strerror(-ret)); exit(1); } } else { @@ -208,7 +138,7 @@ static void vhost_dummy_handle_output(VirtIODevice *vde= v, VirtQueue *vq) static void vhost_scsi_realize(DeviceState *dev, Error **errp) { VirtIOSCSICommon *vs =3D VIRTIO_SCSI_COMMON(dev); - VHostSCSI *s =3D VHOST_SCSI(dev); + VHostSCSICommon *vsc =3D VHOST_SCSI_COMMON(dev); Error *err =3D NULL; int vhostfd =3D -1; int ret; @@ -243,21 +173,21 @@ static void vhost_scsi_realize(DeviceState *dev, Erro= r **errp) goto close_fd; } =20 - error_setg(&s->migration_blocker, + error_setg(&vsc->migration_blocker, "vhost-scsi does not support migration"); - migrate_add_blocker(s->migration_blocker, &err); + migrate_add_blocker(vsc->migration_blocker, &err); if (err) { error_propagate(errp, err); - error_free(s->migration_blocker); + error_free(vsc->migration_blocker); goto close_fd; } =20 - s->dev.nvqs =3D VHOST_SCSI_VQ_NUM_FIXED + vs->conf.num_queues; - s->dev.vqs =3D g_new(struct vhost_virtqueue, s->dev.nvqs); - s->dev.vq_index =3D 0; - s->dev.backend_features =3D 0; + vsc->dev.nvqs =3D VHOST_SCSI_VQ_NUM_FIXED + vs->conf.num_queues; + vsc->dev.vqs =3D g_new(struct vhost_virtqueue, vsc->dev.nvqs); + vsc->dev.vq_index =3D 0; + vsc->dev.backend_features =3D 0; =20 - ret =3D vhost_dev_init(&s->dev, (void *)(uintptr_t)vhostfd, + ret =3D vhost_dev_init(&vsc->dev, (void *)(uintptr_t)vhostfd, VHOST_BACKEND_TYPE_KERNEL, 0); if (ret < 0) { error_setg(errp, "vhost-scsi: vhost initialization failed: %s", @@ -266,16 +196,16 @@ static void vhost_scsi_realize(DeviceState *dev, Erro= r **errp) } =20 /* At present, channel and lun both are 0 for bootable vhost-scsi disk= */ - s->channel =3D 0; - s->lun =3D 0; + vsc->channel =3D 0; + vsc->lun =3D 0; /* Note: we can also get the minimum tpgt from kernel */ - s->target =3D vs->conf.boot_tpgt; + vsc->target =3D vs->conf.boot_tpgt; =20 return; =20 free_vqs: - migrate_del_blocker(s->migration_blocker); - g_free(s->dev.vqs); + migrate_del_blocker(vsc->migration_blocker); + g_free(vsc->dev.vqs); close_fd: close(vhostfd); return; @@ -284,42 +214,28 @@ static void vhost_scsi_realize(DeviceState *dev, Erro= r **errp) static void vhost_scsi_unrealize(DeviceState *dev, Error **errp) { VirtIODevice *vdev =3D VIRTIO_DEVICE(dev); - VHostSCSI *s =3D VHOST_SCSI(dev); + VHostSCSICommon *vsc =3D VHOST_SCSI_COMMON(dev); =20 - migrate_del_blocker(s->migration_blocker); - error_free(s->migration_blocker); + migrate_del_blocker(vsc->migration_blocker); + error_free(vsc->migration_blocker); =20 /* This will stop vhost backend. */ vhost_scsi_set_status(vdev, 0); =20 - vhost_dev_cleanup(&s->dev); - g_free(s->dev.vqs); + vhost_dev_cleanup(&vsc->dev); + g_free(vsc->dev.vqs); =20 virtio_scsi_common_unrealize(dev, errp); } =20 -/* - * Implementation of an interface to adjust firmware path - * for the bootindex property handling. - */ -static char *vhost_scsi_get_fw_dev_path(FWPathProvider *p, BusState *bus, - DeviceState *dev) -{ - VHostSCSI *s =3D VHOST_SCSI(dev); - /* format: channel@channel/vhost-scsi@target,lun */ - return g_strdup_printf("/channel@%x/%s@%x,%x", s->channel, - qdev_fw_name(dev), s->target, s->lun); -} - static Property vhost_scsi_properties[] =3D { - DEFINE_PROP_STRING("vhostfd", VHostSCSI, parent_obj.conf.vhostfd), - DEFINE_PROP_STRING("wwpn", VHostSCSI, parent_obj.conf.wwpn), - DEFINE_PROP_UINT32("boot_tpgt", VHostSCSI, parent_obj.conf.boot_tpgt, = 0), - DEFINE_PROP_UINT32("num_queues", VHostSCSI, parent_obj.conf.num_queues= , 1), - DEFINE_PROP_UINT32("max_sectors", VHostSCSI, parent_obj.conf.max_secto= rs, - 0xFFFF), - DEFINE_PROP_UINT32("cmd_per_lun", VHostSCSI, parent_obj.conf.cmd_per_l= un, - 128), + DEFINE_PROP_STRING("vhostfd", VirtIOSCSICommon, conf.vhostfd), + DEFINE_PROP_STRING("wwpn", VirtIOSCSICommon, conf.wwpn), + DEFINE_PROP_UINT32("boot_tpgt", VirtIOSCSICommon, conf.boot_tpgt, 0), + DEFINE_PROP_UINT32("num_queues", VirtIOSCSICommon, conf.num_queues, 1), + DEFINE_PROP_UINT32("max_sectors", VirtIOSCSICommon, conf.max_sectors, + 0xFFFF), + DEFINE_PROP_UINT32("cmd_per_lun", VirtIOSCSICommon, conf.cmd_per_lun, = 128), DEFINE_PROP_END_OF_LIST(), }; =20 @@ -333,23 +249,25 @@ static void vhost_scsi_class_init(ObjectClass *klass,= void *data) set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); vdc->realize =3D vhost_scsi_realize; vdc->unrealize =3D vhost_scsi_unrealize; - vdc->get_features =3D vhost_scsi_get_features; - vdc->set_config =3D vhost_scsi_set_config; + vdc->get_features =3D vhost_scsi_common_get_features; + vdc->set_config =3D vhost_scsi_common_set_config; vdc->set_status =3D vhost_scsi_set_status; - fwc->get_dev_path =3D vhost_scsi_get_fw_dev_path; + fwc->get_dev_path =3D vhost_scsi_common_get_fw_dev_path; } =20 static void vhost_scsi_instance_init(Object *obj) { - VHostSCSI *dev =3D VHOST_SCSI(obj); + VHostSCSICommon *vsc =3D VHOST_SCSI_COMMON(obj); + + vsc->feature_bits =3D kernel_feature_bits; =20 - device_add_bootindex_property(obj, &dev->bootindex, "bootindex", NULL, - DEVICE(dev), NULL); + device_add_bootindex_property(obj, &vsc->bootindex, "bootindex", NULL, + DEVICE(vsc), NULL); } =20 static const TypeInfo vhost_scsi_info =3D { .name =3D TYPE_VHOST_SCSI, - .parent =3D TYPE_VIRTIO_SCSI_COMMON, + .parent =3D TYPE_VHOST_SCSI_COMMON, .instance_size =3D sizeof(VHostSCSI), .class_init =3D vhost_scsi_class_init, .instance_init =3D vhost_scsi_instance_init, diff --git a/include/hw/virtio/vhost-scsi-common.h b/include/hw/virtio/vhos= t-scsi-common.h new file mode 100644 index 0000000000..4553be4bc3 --- /dev/null +++ b/include/hw/virtio/vhost-scsi-common.h @@ -0,0 +1,48 @@ +/* + * vhost_scsi host device + * + * Copyright (c) 2016 Nutanix Inc. All rights reserved. + * + * Author: + * Felipe Franciosi + * + * This work is licensed under the terms of the GNU LGPL, version 2 or lat= er. + * See the COPYING.LIB file in the top-level directory. + * + */ + +#ifndef VHOST_SCSI_COMMON_H +#define VHOST_SCSI_COMMON_H + +#include "qemu-common.h" +#include "hw/qdev.h" +#include "hw/virtio/virtio-scsi.h" +#include "hw/virtio/vhost.h" +#include "hw/fw-path-provider.h" + +#define TYPE_VHOST_SCSI_COMMON "vhost-scsi-common" +#define VHOST_SCSI_COMMON(obj) \ + OBJECT_CHECK(VHostSCSICommon, (obj), TYPE_VHOST_SCSI_COMMON) + +typedef struct VHostSCSICommon { + VirtIOSCSICommon parent_obj; + + Error *migration_blocker; + + struct vhost_dev dev; + const int *feature_bits; + int32_t bootindex; + int channel; + int target; + int lun; +} VHostSCSICommon; + +int vhost_scsi_common_start(VHostSCSICommon *vsc); +void vhost_scsi_common_stop(VHostSCSICommon *vsc); +char *vhost_scsi_common_get_fw_dev_path(FWPathProvider *p, BusState *bus, + DeviceState *dev); +void vhost_scsi_common_set_config(VirtIODevice *vdev, const uint8_t *confi= g); +uint64_t vhost_scsi_common_get_features(VirtIODevice *vdev, uint64_t featu= res, + Error **errp); + +#endif /* VHOST_SCSI_COMMON_H */ diff --git a/include/hw/virtio/vhost-scsi.h b/include/hw/virtio/vhost-scsi.h index 9fd63df12e..04658d14f5 100644 --- a/include/hw/virtio/vhost-scsi.h +++ b/include/hw/virtio/vhost-scsi.h @@ -18,6 +18,7 @@ #include "hw/qdev.h" #include "hw/virtio/virtio-scsi.h" #include "hw/virtio/vhost.h" +#include "hw/virtio/vhost-scsi-common.h" =20 enum vhost_scsi_vq_list { VHOST_SCSI_VQ_CONTROL =3D 0, @@ -30,15 +31,7 @@ enum vhost_scsi_vq_list { OBJECT_CHECK(VHostSCSI, (obj), TYPE_VHOST_SCSI) =20 typedef struct VHostSCSI { - VirtIOSCSICommon parent_obj; - - Error *migration_blocker; - - struct vhost_dev dev; - int32_t bootindex; - int channel; - int target; - int lun; + VHostSCSICommon parent_obj; } VHostSCSI; =20 #endif diff --git a/include/hw/virtio/virtio-scsi.h b/include/hw/virtio/virtio-scs= i.h index 8c8453cf19..eac2013ddd 100644 --- a/include/hw/virtio/virtio-scsi.h +++ b/include/hw/virtio/virtio-scsi.h @@ -49,8 +49,10 @@ struct VirtIOSCSIConf { uint32_t num_queues; uint32_t max_sectors; uint32_t cmd_per_lun; +#ifdef CONFIG_VHOST_SCSI char *vhostfd; char *wwpn; +#endif uint32_t boot_tpgt; IOThread *iothread; }; --=20 2.12.2