From nobody Tue Nov 26 08:40:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1709023316; cv=none; d=zohomail.com; s=zohoarc; b=TPPX30nxjDesyAsUyB/3APSVYiCWo1vZH3K85Wm8lGVGZ71HUh6kaj34Yw4jyLiQmWtwZJ17lB9f8LvCGp05KQNzlIoro9FIK3rqphP9bkKDdVcBrYHedgAa2Ux94J00VPMV5ehFfEs8i3SAyf7M69pn9V/GJe9p0BI8SBiBBD8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709023316; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=XWmgk+68LApkOPWy7YUYgSrrjaqZXObndrHRfRf+NyU=; b=AOkHRGENWRjBBPRgTBy+hd9UnwOCnl/FP6/XX8nFVULfS2VwpVJ3dL3swa/BAdY3yJtuy30WqlIC6PwAPRqBfH2rOMbTPJNGzQ2i8SDGU3jmEINTiwR7fzhJgRSnng2jLXnJDNLY0CkCu8Ot54h3nZlq2fTNsxn2T5bdcs7GTl8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.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) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1709023316600677.3275550025808; Tue, 27 Feb 2024 00:41:56 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ret0j-00066p-4o; Tue, 27 Feb 2024 03:40:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ret0i-00066F-4V for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:40:24 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ret0g-0007i6-E8 for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:40:23 -0500 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-33ddd1624beso893705f8f.1 for ; Tue, 27 Feb 2024 00:40:21 -0800 (PST) Received: from m1x-phil.lan (mic92-h03-176-184-33-214.dsl.sta.abo.bbox.fr. [176.184.33.214]) by smtp.gmail.com with ESMTPSA id bj29-20020a0560001e1d00b0033d81d9c44esm10779692wrb.70.2024.02.27.00.40.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Feb 2024 00:40:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709023221; x=1709628021; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XWmgk+68LApkOPWy7YUYgSrrjaqZXObndrHRfRf+NyU=; b=V7dI4Ho9LDLuMHQi8UHl5tXKKI397zCeRb9GHzzXNOEam4+/VNpWpgfnYHzVLct2ig DnD8aAqV9UH7QV54v/dl/yxsQwdYXa7oNVpZsPCJg2lVW9KM+mMEs52UrHSLkghwvtnj x7m6UlhN+KnfkDuffXG8KPRJbdGJSwOTZuTmdLxaCH+hpt7cuorr9RLJhS4XVtXkyzCf JzC12yO15gAFqiKHNDOG0TlYsyPRAoJPUPznTpVIp/evLuViPoWcxHzlk0jKNnZ1LO+a i9n5sfLh7tvs9x7K85iKGZZLsdJ4nKEGxTiq+tpm4crQyYrMLDSnDFVN2FoT7WHTj8+k Ur4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709023221; x=1709628021; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XWmgk+68LApkOPWy7YUYgSrrjaqZXObndrHRfRf+NyU=; b=Z7uaKPshVfxKF3vGzyLbAaWY3vwdbZAYefl/L8xfZmTMCKXOQNphWRM8kUYfDa8MWU n81EG4xGX92ZmGw6tcvX+WWF2ypn4myuYnNbAyF/XzgcCgw1EJ5eIY4tAiBD3RU7bJl+ yuoqkGEyN0bdixCpaN/cQqX9/yRVpK63dEOrjZNSqfEv68u6BSZxAEJnx64FcIVLcxdd s/yJjm70EKKlC4jyJWXQp0p7oSNMEt2lopvI7dqMJd17XWI2GPMacDYq2RZUjjsq2AfT oudoyJ9DdhGbTqMj+aMBaGw5HW8yjakx42JC/R3BLg66LDcFmGfto3fMj5O+k21ASd4u R3RQ== X-Gm-Message-State: AOJu0YwLIh9GrpclfmWXIPX64QGnjXneUqRKlrwPRWCyl7St+GJ2yUZt M/hbCnJFvwnmQl71BJHTY8KebgswCw1A3jRA1IIWY3iZ8lbr7Tezc9H4kWgVqMbGXkLTJhqdZup / X-Google-Smtp-Source: AGHT+IHlowSWUgonUicezcAUv37tfeY2t4fNQ8ilz1Ff3gwsIZgFc3bnnF3Er3iJzfWjvl1FPo7WKg== X-Received: by 2002:a5d:4106:0:b0:33d:90c2:c7f4 with SMTP id l6-20020a5d4106000000b0033d90c2c7f4mr8225142wrp.14.1709023220812; Tue, 27 Feb 2024 00:40:20 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Eduardo Habkost , kvm@vger.kernel.org Subject: [PULL 05/30] hw/i386/kvmvapic: Inline sysbus_address_space() Date: Tue, 27 Feb 2024 09:39:21 +0100 Message-ID: <20240227083948.5427-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240227083948.5427-1-philmd@linaro.org> References: <20240227083948.5427-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=philmd@linaro.org; helo=mail-wr1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1709023317985100001 sysbus_address_space(...) is a simple wrapper to get_system_memory(). Use it in place, since KVM VAPIC doesn't distinct address spaces. Rename the 'as' variable as 'mr' since it is a MemoryRegion type, not an AddressSpace one. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20240216153517.49422-6-philmd@linaro.org> --- hw/i386/kvmvapic.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c index 20b0300357..61a65ef2ab 100644 --- a/hw/i386/kvmvapic.c +++ b/hw/i386/kvmvapic.c @@ -58,6 +58,7 @@ typedef struct GuestROMState { =20 struct VAPICROMState { SysBusDevice busdev; + MemoryRegion io; MemoryRegion rom; uint32_t state; @@ -581,19 +582,17 @@ static int vapic_map_rom_writable(VAPICROMState *s) { hwaddr rom_paddr =3D s->rom_state_paddr & ROM_BLOCK_MASK; MemoryRegionSection section; - MemoryRegion *as; + MemoryRegion *mr =3D get_system_memory(); size_t rom_size; uint8_t *ram; =20 - as =3D sysbus_address_space(&s->busdev); - if (s->rom_mapped_writable) { - memory_region_del_subregion(as, &s->rom); + memory_region_del_subregion(mr, &s->rom); object_unparent(OBJECT(&s->rom)); } =20 /* grab RAM memory region (region @rom_paddr may still be pc.rom) */ - section =3D memory_region_find(as, 0, 1); + section =3D memory_region_find(mr, 0, 1); =20 /* read ROM size from RAM region */ if (rom_paddr + 2 >=3D memory_region_size(section.mr)) { @@ -614,7 +613,7 @@ static int vapic_map_rom_writable(VAPICROMState *s) =20 memory_region_init_alias(&s->rom, OBJECT(s), "kvmvapic-rom", section.m= r, rom_paddr, rom_size); - memory_region_add_subregion_overlap(as, rom_paddr, &s->rom, 1000); + memory_region_add_subregion_overlap(mr, rom_paddr, &s->rom, 1000); s->rom_mapped_writable =3D true; memory_region_unref(section.mr); =20 --=20 2.41.0