From nobody Mon Apr 29 05:39:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1571885324; cv=none; d=zoho.com; s=zohoarc; b=i2OisAyq3lf8NRuU8/Qu2XCjATFRwhVRYR7izjmRFJs1oNegp0Jpu+bcN3obzuTWw0SWlTfLPBUcnWSwbNDOhtYsJFAnOTBMAC17Y7t1ZpOdvUOtKJdG/+fB1tzFrR/jpTT4MzfxDDJvf4s5QQtGB+qmNN+eogwhhkcAuyoA1MU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571885324; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ZK90+vbCO6GnsdT6pnZGbmzaA0RFAc4Ab5sfaZRk6bY=; b=Kf6agCQygcPMjP85I0A2Cw+bXOdhuy4ffUg+U5YHB3A8FNZCWFekXwsvgd56hCMwwAO0+zRNXtq/qELRmQnrcAny4FCryTWvOsyhpGbXK+nKBwP4+p9ArkPiUuIhGWsRBypI7HEybI33x024HU58VfNLQncMfB7ja/WSr9/YdcY= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1571885324405301.5657201732464; Wed, 23 Oct 2019 19:48:44 -0700 (PDT) Received: from localhost ([::1]:56448 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNTB0-0005s1-Ev for importer@patchew.org; Wed, 23 Oct 2019 22:48:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41346) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNT90-0002bH-UQ for qemu-devel@nongnu.org; Wed, 23 Oct 2019 22:46:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNT8y-0005bJ-Mf for qemu-devel@nongnu.org; Wed, 23 Oct 2019 22:46:33 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:59064 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iNT8y-0005ab-F6 for qemu-devel@nongnu.org; Wed, 23 Oct 2019 22:46:32 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-358-hEulMcHnPK-31ecT_VDpqA-1; Wed, 23 Oct 2019 22:46:29 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D6C15800D5E; Thu, 24 Oct 2019 02:46:27 +0000 (UTC) Received: from localhost (ovpn-116-56.gru2.redhat.com [10.97.116.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 641E1100164D; Thu, 24 Oct 2019 02:46:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571885191; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZK90+vbCO6GnsdT6pnZGbmzaA0RFAc4Ab5sfaZRk6bY=; b=Nxq4GNBolTdIVYBOM6y3+YzaxdpNwGOSv6JbBaSvAHX50q61HfjrpypUQDDziff6VI27GK +W99ZaVdJg4EdI3X8Rw7uMcU6ZYkAJ3kGwiFDWro3qMgB2geHmr7xTECM6n1iftygdHMX7 DcoI7Zq5A2qjHX4w73ovMsUPY8mXZ8Y= From: Eduardo Habkost To: Paolo Bonzini , Richard Henderson , Peter Maydell , Marcel Apfelbaum , qemu-devel@nongnu.org, Igor Mammedov Subject: [PULL 1/4] target/i386: Introduce Denverton CPU model Date: Wed, 23 Oct 2019 23:46:20 -0300 Message-Id: <20191024024623.18848-2-ehabkost@redhat.com> In-Reply-To: <20191024024623.18848-1-ehabkost@redhat.com> References: <20191024024623.18848-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: hEulMcHnPK-31ecT_VDpqA-1 X-Mimecast-Spam-Score: 0 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: 205.139.110.61 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tao Xu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Tao Xu Denverton is the Atom Processor of Intel Harrisonville platform. For more information: https://ark.intel.com/content/www/us/en/ark/products/\ codename/63508/denverton.html Signed-off-by: Tao Xu Message-Id: <20190718073405.28301-1-tao3.xu@intel.com> Signed-off-by: Eduardo Habkost --- target/i386/cpu.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 47200b40c1..0de8a22e1e 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -2724,6 +2724,53 @@ static X86CPUDefinition builtin_x86_defs[] =3D { .xlevel =3D 0x80000008, .model_id =3D "Intel Xeon Processor (Icelake)", }, + { + .name =3D "Denverton", + .level =3D 21, + .vendor =3D CPUID_VENDOR_INTEL, + .family =3D 6, + .model =3D 95, + .stepping =3D 1, + .features[FEAT_1_EDX] =3D + CPUID_FP87 | CPUID_VME | CPUID_DE | CPUID_PSE | CPUID_TSC | + CPUID_MSR | CPUID_PAE | CPUID_MCE | CPUID_CX8 | CPUID_APIC | + CPUID_SEP | CPUID_MTRR | CPUID_PGE | CPUID_MCA | CPUID_CMOV | + CPUID_PAT | CPUID_PSE36 | CPUID_CLFLUSH | CPUID_MMX | CPUID_FX= SR | + CPUID_SSE | CPUID_SSE2, + .features[FEAT_1_ECX] =3D + CPUID_EXT_SSE3 | CPUID_EXT_PCLMULQDQ | CPUID_EXT_MONITOR | + CPUID_EXT_SSSE3 | CPUID_EXT_CX16 | CPUID_EXT_SSE41 | + CPUID_EXT_SSE42 | CPUID_EXT_X2APIC | CPUID_EXT_MOVBE | + CPUID_EXT_POPCNT | CPUID_EXT_TSC_DEADLINE_TIMER | + CPUID_EXT_AES | CPUID_EXT_XSAVE | CPUID_EXT_RDRAND, + .features[FEAT_8000_0001_EDX] =3D + CPUID_EXT2_SYSCALL | CPUID_EXT2_NX | CPUID_EXT2_PDPE1GB | + CPUID_EXT2_RDTSCP | CPUID_EXT2_LM, + .features[FEAT_8000_0001_ECX] =3D + CPUID_EXT3_LAHF_LM | CPUID_EXT3_3DNOWPREFETCH, + .features[FEAT_7_0_EBX] =3D + CPUID_7_0_EBX_FSGSBASE | CPUID_7_0_EBX_SMEP | CPUID_7_0_EBX_ER= MS | + CPUID_7_0_EBX_MPX | CPUID_7_0_EBX_RDSEED | CPUID_7_0_EBX_SMAP | + CPUID_7_0_EBX_CLFLUSHOPT | CPUID_7_0_EBX_SHA_NI, + .features[FEAT_7_0_EDX] =3D + CPUID_7_0_EDX_SPEC_CTRL | CPUID_7_0_EDX_ARCH_CAPABILITIES | + CPUID_7_0_EDX_SPEC_CTRL_SSBD, + /* + * Missing: XSAVES (not supported by some Linux versions, + * including v4.1 to v4.12). + * KVM doesn't yet expose any XSAVES state save component, + * and the only one defined in Skylake (processor tracing) + * probably will block migration anyway. + */ + .features[FEAT_XSAVE] =3D + CPUID_XSAVE_XSAVEOPT | CPUID_XSAVE_XSAVEC | CPUID_XSAVE_XGETBV= 1, + .features[FEAT_6_EAX] =3D + CPUID_6_EAX_ARAT, + .features[FEAT_ARCH_CAPABILITIES] =3D + MSR_ARCH_CAP_RDCL_NO | MSR_ARCH_CAP_SKIP_L1DFL_VMENTRY, + .xlevel =3D 0x80000008, + .model_id =3D "Intel Atom Processor (Denverton)", + }, { .name =3D "Snowridge", .level =3D 27, --=20 2.21.0 From nobody Mon Apr 29 05:39:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1571885327; cv=none; d=zoho.com; s=zohoarc; b=NbqOW+smP5xJghgpSXF5qbVVDcCRYkiscNPmip6qjANHtrMuNIHAQY5jNPk57znJoazs8rkMZg4Uxrmt98/nBM8CmnYcs4ysRC8T7IqQl3PE1SDnxZAicbcsiR6kIRyHbGETU5/+xOZiBhrfxsHk5AYvBOqqvmwVZjbKqp2OpRo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571885327; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=FFN3G4vy9TZ4XjODrTT4WxsNQU09kGyHD2ISBmvwuXk=; b=f0zjOsPERvFAuefpj04Jufefb8TUhd4SsNhgvxy/c2tF/5k+X7flrTDXLKrqW2piS8iadTXAXPbw9ziIQtTe7adoW1Lw9+DjLC4dVISL8i6XUxj9fXaLFXJPYZ7gx+5/GmQZ1lNyYj5uCglF3OUhWPJqIygv4otDYPdaZmJj5BQ= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1571885327430341.00853800832374; Wed, 23 Oct 2019 19:48:47 -0700 (PDT) Received: from localhost ([::1]:56450 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNTB7-00066x-LI for importer@patchew.org; Wed, 23 Oct 2019 22:48:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41402) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNT94-0002wE-C8 for qemu-devel@nongnu.org; Wed, 23 Oct 2019 22:46:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNT93-0005g2-75 for qemu-devel@nongnu.org; Wed, 23 Oct 2019 22:46:38 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:28728 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iNT93-0005fh-3B for qemu-devel@nongnu.org; Wed, 23 Oct 2019 22:46:37 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-322-XScY6BQVM9yqtB8h_F1azQ-1; Wed, 23 Oct 2019 22:46:33 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0743E1005500; Thu, 24 Oct 2019 02:46:32 +0000 (UTC) Received: from localhost (ovpn-116-56.gru2.redhat.com [10.97.116.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 474501001B3F; Thu, 24 Oct 2019 02:46:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571885196; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FFN3G4vy9TZ4XjODrTT4WxsNQU09kGyHD2ISBmvwuXk=; b=LRtHYnQWLrU3w9EUbv/WF8hxHfDq3AJmT5qhvKT/1Rmhc2dJbp5eqZ0VDSZQwresupUpV2 RQAq7kC8EErgYs+cge3T8aS7UVao6Z1zKSH/rpZbVs0TEEr2OdzHHJg73lRoshScK/+iGK 05bxG9hFCMrFElSCe5Mkn/SO9HFScss= From: Eduardo Habkost To: Paolo Bonzini , Richard Henderson , Peter Maydell , Marcel Apfelbaum , qemu-devel@nongnu.org, Igor Mammedov Subject: [PULL 2/4] sparc64: use memory_region_allocate_system_memory() only for '-m' specified RAM Date: Wed, 23 Oct 2019 23:46:21 -0300 Message-Id: <20191024024623.18848-3-ehabkost@redhat.com> In-Reply-To: <20191024024623.18848-1-ehabkost@redhat.com> References: <20191024024623.18848-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: XScY6BQVM9yqtB8h_F1azQ-1 X-Mimecast-Spam-Score: 0 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: 205.139.110.61 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Igor Mammedov memory_region_allocate_system_memory() was designed to be called for allocating inital RAM. Using it mutiple times within one board is not supported and could fail if -mem-path with non hugepage path is used. Keep using memory_region_allocate_system_memory() only for initial RAM and use memory_region_init_ram() for the rest fixed size regions. Signed-off-by: Igor Mammedov Message-Id: <20191008113318.7012-2-imammedo@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Eduardo Habkost --- hw/sparc64/niagara.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/hw/sparc64/niagara.c b/hw/sparc64/niagara.c index 167143bffe..5987693659 100644 --- a/hw/sparc64/niagara.c +++ b/hw/sparc64/niagara.c @@ -36,6 +36,7 @@ #include "qemu/error-report.h" #include "sysemu/qtest.h" #include "sysemu/sysemu.h" +#include "qapi/error.h" =20 typedef struct NiagaraBoardState { MemoryRegion hv_ram; @@ -106,8 +107,8 @@ static void niagara_init(MachineState *machine) /* init CPUs */ sparc64_cpu_devinit(machine->cpu_type, NIAGARA_PROM_BASE); /* set up devices */ - memory_region_allocate_system_memory(&s->hv_ram, NULL, "sun4v-hv.ram", - NIAGARA_HV_RAM_SIZE); + memory_region_init_ram(&s->hv_ram, NULL, "sun4v-hv.ram", + NIAGARA_HV_RAM_SIZE, &error_fatal); memory_region_add_subregion(sysmem, NIAGARA_HV_RAM_BASE, &s->hv_ram); =20 memory_region_allocate_system_memory(&s->partition_ram, NULL, @@ -116,17 +117,17 @@ static void niagara_init(MachineState *machine) memory_region_add_subregion(sysmem, NIAGARA_PARTITION_RAM_BASE, &s->partition_ram); =20 - memory_region_allocate_system_memory(&s->nvram, NULL, - "sun4v.nvram", NIAGARA_NVRAM_SIZE= ); + memory_region_init_ram(&s->nvram, NULL, "sun4v.nvram", NIAGARA_NVRAM_S= IZE, + &error_fatal); memory_region_add_subregion(sysmem, NIAGARA_NVRAM_BASE, &s->nvram); - memory_region_allocate_system_memory(&s->md_rom, NULL, - "sun4v-md.rom", NIAGARA_MD_ROM_SI= ZE); + memory_region_init_ram(&s->md_rom, NULL, "sun4v-md.rom", + NIAGARA_MD_ROM_SIZE, &error_fatal); memory_region_add_subregion(sysmem, NIAGARA_MD_ROM_BASE, &s->md_rom); - memory_region_allocate_system_memory(&s->hv_rom, NULL, - "sun4v-hv.rom", NIAGARA_HV_ROM_SI= ZE); + memory_region_init_ram(&s->hv_rom, NULL, "sun4v-hv.rom", + NIAGARA_HV_ROM_SIZE, &error_fatal); memory_region_add_subregion(sysmem, NIAGARA_HV_ROM_BASE, &s->hv_rom); - memory_region_allocate_system_memory(&s->prom, NULL, - "sun4v.prom", PROM_SIZE_MAX); + memory_region_init_ram(&s->prom, NULL, "sun4v.prom", PROM_SIZE_MAX, + &error_fatal); memory_region_add_subregion(sysmem, NIAGARA_PROM_BASE, &s->prom); =20 add_rom_or_fail("nvram1", NIAGARA_NVRAM_BASE); @@ -143,8 +144,8 @@ static void niagara_init(MachineState *machine) BlockBackend *blk =3D blk_by_legacy_dinfo(dinfo); int size =3D blk_getlength(blk); if (size > 0) { - memory_region_allocate_system_memory(&s->vdisk_ram, NULL, - "sun4v_vdisk.ram", size); + memory_region_init_ram(&s->vdisk_ram, NULL, "sun4v_vdisk.ram",= size, + &error_fatal); memory_region_add_subregion(get_system_memory(), NIAGARA_VDISK_BASE, &s->vdisk_ram); dinfo->is_default =3D 1; --=20 2.21.0 From nobody Mon Apr 29 05:39:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1571885424; cv=none; d=zoho.com; s=zohoarc; b=AJAHmbBSlduYppx78I7jLzDCuvcO2j9TdBWNls7c9u0nBSHxkMqkU0p1wJZqTuLnjFUrrWyDILgJ9u7oHzOh7Q1awb05N7ZOE/3ksl0V3485xGk+ZlpV5jvGtUMVtRF8sUGcnpqaIqCA/0ji1nRd81D92ibeavCNXps913R7spk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571885424; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=PssP5r9I/AvGQJl5jbf7fQBnA+KBtK6Jd6fBhm1vPWo=; b=oDkSERzxHWR3tSc8Sd9b7Y325CBvfLt0PGRCtCLvEZutXvgXmFfLCYfq0nxPWrDnLI+5c9X6kHcKTh9g9wVA5oJu2Ab4gcuqfBJlpi7H15JWlSkVDtA1SIpJH5HdNaHYYlGlr68Jkiv6DtyVsGA4Ghq/aFwM4Bf+jTRKX9mLlc8= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1571885424590681.395016397966; Wed, 23 Oct 2019 19:50:24 -0700 (PDT) Received: from localhost ([::1]:56480 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNTCh-0002Kj-Fm for importer@patchew.org; Wed, 23 Oct 2019 22:50:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41470) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNT9A-00036J-1l for qemu-devel@nongnu.org; Wed, 23 Oct 2019 22:46:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNT98-0005nL-Jq for qemu-devel@nongnu.org; Wed, 23 Oct 2019 22:46:43 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:38505 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iNT98-0005mZ-F0 for qemu-devel@nongnu.org; Wed, 23 Oct 2019 22:46:42 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-16-LYBzm33DNhaTKQZXoveDBA-1; Wed, 23 Oct 2019 22:46:38 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AAA4080183E; Thu, 24 Oct 2019 02:46:36 +0000 (UTC) Received: from localhost (ovpn-116-56.gru2.redhat.com [10.97.116.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6BFA8194BB; Thu, 24 Oct 2019 02:46:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571885201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PssP5r9I/AvGQJl5jbf7fQBnA+KBtK6Jd6fBhm1vPWo=; b=hqpg/Apn1ccYzqKwlVk5PGsYws13mnKEJvA6Do6f6dyiTPK+/VA6mM8/Cxb5LoFbdARUAt g+XgeTSlK6o63pFOtvjpo45FtUumKpeaCJaNgs5GxooNuQuyLFQ96JC3JmRSKJAb0uUCm+ QnMkGQrRHzQoQIlHb/cgfL1l9ou9Es8= From: Eduardo Habkost To: Paolo Bonzini , Richard Henderson , Peter Maydell , Marcel Apfelbaum , qemu-devel@nongnu.org, Igor Mammedov Subject: [PULL 3/4] ppc: rs6000_mc: drop usage of memory_region_allocate_system_memory() Date: Wed, 23 Oct 2019 23:46:22 -0300 Message-Id: <20191024024623.18848-4-ehabkost@redhat.com> In-Reply-To: <20191024024623.18848-1-ehabkost@redhat.com> References: <20191024024623.18848-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: LYBzm33DNhaTKQZXoveDBA-1 X-Mimecast-Spam-Score: 0 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: 205.139.110.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Igor Mammedov rs6000mc_realize() violates memory_region_allocate_system_memory() contract by calling it multiple times which could break -mem-path. Replace it with plain memory_region_init_ram() instead. Signed-off-by: Igor Mammedov Message-Id: <20191008113318.7012-3-imammedo@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Acked-by: David Gibson Signed-off-by: Eduardo Habkost --- hw/ppc/rs6000_mc.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/hw/ppc/rs6000_mc.c b/hw/ppc/rs6000_mc.c index df7c0006fc..66b14db5fa 100644 --- a/hw/ppc/rs6000_mc.c +++ b/hw/ppc/rs6000_mc.c @@ -144,6 +144,7 @@ static void rs6000mc_realize(DeviceState *dev, Error **= errp) RS6000MCState *s =3D RS6000MC_DEVICE(dev); int socket =3D 0; unsigned int ram_size =3D s->ram_size / MiB; + Error *local_err =3D NULL; =20 while (socket < 6) { if (ram_size >=3D 64) { @@ -165,19 +166,21 @@ static void rs6000mc_realize(DeviceState *dev, Error = **errp) if (s->simm_size[socket]) { char name[] =3D "simm.?"; name[5] =3D socket + '0'; - memory_region_allocate_system_memory(&s->simm[socket], OBJECT(= dev), - name, - s->simm_size[socket] * Mi= B); + memory_region_init_ram(&s->simm[socket], OBJECT(dev), name, + s->simm_size[socket] * MiB, &local_err); + if (local_err) { + goto out; + } memory_region_add_subregion_overlap(get_system_memory(), 0, &s->simm[socket], socket); } } if (ram_size) { /* unable to push all requested RAM in SIMMs */ - error_setg(errp, "RAM size incompatible with this board. " + error_setg(&local_err, "RAM size incompatible with this board. " "Try again with something else, like %" PRId64 " MB", s->ram_size / MiB - ram_size); - return; + goto out; } =20 if (s->autoconfigure) { @@ -193,6 +196,8 @@ static void rs6000mc_realize(DeviceState *dev, Error **= errp) =20 isa_register_portio_list(ISA_DEVICE(dev), &s->portio, 0x0, rs6000mc_port_list, s, "rs6000mc"); +out: + error_propagate(errp, local_err); } =20 static const VMStateDescription vmstate_rs6000mc =3D { --=20 2.21.0 From nobody Mon Apr 29 05:39:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1571885500; cv=none; d=zoho.com; s=zohoarc; b=UfliktbC5Xk7vIsyFP88neUCONNjH9aok59e+zsBvunOny+e2U+L3oCxuMuCsIe+cs4hYw17OrWkGMjN2ZrnpemNyKZ3KEspPUdecCb5Dhq04x30OncPFaWunYPNteZDPVL27F87hUohOrgszV1s0aKUgtKYzImySXcGAY1h4gg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571885500; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YwsIntaK93+/QfigO4uKILcu/rtNTqqyJGji00Oz8JM=; b=eZ3g0d9G0dSL5j/zLOAXX03+joR4veIz5c5aDS+VDg287bz7VNfCYZEBA1tt2zpm6/3LCKiB0e66xAMxr7S6lv5Ly4tb/B/ntzMq1d3BUyUMoTFVHyZbOzqFTJ0GTZY05Rpnxe0wrycV21w2RbSdaT3d7+GduDpeqzJVQ09FXOU= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1571885500000137.85280221780204; Wed, 23 Oct 2019 19:51:40 -0700 (PDT) Received: from localhost ([::1]:56492 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNTDu-0005WX-St for importer@patchew.org; Wed, 23 Oct 2019 22:51:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41586) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNT9G-0003I6-IQ for qemu-devel@nongnu.org; Wed, 23 Oct 2019 22:46:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNT9F-0005xv-Ao for qemu-devel@nongnu.org; Wed, 23 Oct 2019 22:46:50 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:57352 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iNT9F-0005xa-5g for qemu-devel@nongnu.org; Wed, 23 Oct 2019 22:46:49 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-256-KM-bTz0gOzCyOzwkHY3R9A-1; Wed, 23 Oct 2019 22:46:44 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 89AE780183E; Thu, 24 Oct 2019 02:46:43 +0000 (UTC) Received: from localhost (ovpn-116-56.gru2.redhat.com [10.97.116.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2BB7960BF1; Thu, 24 Oct 2019 02:46:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571885208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YwsIntaK93+/QfigO4uKILcu/rtNTqqyJGji00Oz8JM=; b=B7PvY7WpzCx2Pn6tbYnIL5F0fxsRtswOSuuw7SWakNp3zVE6Ralb+BnJqluW9IHPvYKgIA XFEAAz/1n0gtfpWOpeY+cxRxvpOkeg3YUhOX94322My7iGJTVvNXPQsGOHSnKadvGQCx3k EnKMxCPMGBu9ScsYN2utnm2zaihD5bs= From: Eduardo Habkost To: Paolo Bonzini , Richard Henderson , Peter Maydell , Marcel Apfelbaum , qemu-devel@nongnu.org, Igor Mammedov Subject: [PULL 4/4] hppa: drop usage of memory_region_allocate_system_memory() for ROM Date: Wed, 23 Oct 2019 23:46:23 -0300 Message-Id: <20191024024623.18848-5-ehabkost@redhat.com> In-Reply-To: <20191024024623.18848-1-ehabkost@redhat.com> References: <20191024024623.18848-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: KM-bTz0gOzCyOzwkHY3R9A-1 X-Mimecast-Spam-Score: 0 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: 205.139.110.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Igor Mammedov machine_hppa_init() violates memory_region_allocate_system_memory() contract by calling it multiple times which could break with -mem-path. Replace the second usage (for 'rom') with memory_region_init_ram() instead. Signed-off-by: Igor Mammedov Message-Id: <20191008113318.7012-4-imammedo@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Eduardo Habkost --- hw/hppa/machine.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 7e23675429..953d454f48 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -161,9 +161,8 @@ static void machine_hppa_init(MachineState *machine) g_free(firmware_filename); =20 rom_region =3D g_new(MemoryRegion, 1); - memory_region_allocate_system_memory(rom_region, OBJECT(machine), - "firmware", - (FIRMWARE_END - FIRMWARE_START)); + memory_region_init_ram(rom_region, NULL, "firmware", + (FIRMWARE_END - FIRMWARE_START), &error_fatal); memory_region_add_subregion(addr_space, FIRMWARE_START, rom_region); =20 /* Load kernel */ --=20 2.21.0