From nobody Wed Oct 29 06:43:59 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; 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; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1524650121671762.536167399792; Wed, 25 Apr 2018 02:55:21 -0700 (PDT) Received: from localhost ([::1]:35488 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBH8y-0006WS-VL for importer@patchew.org; Wed, 25 Apr 2018 05:55:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBH6L-000557-AN for qemu-devel@nongnu.org; Wed, 25 Apr 2018 05:52:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fBH6I-0002SS-MF for qemu-devel@nongnu.org; Wed, 25 Apr 2018 05:52:37 -0400 Received: from mail-ot0-x241.google.com ([2607:f8b0:4003:c0f::241]:45566) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fBH6I-0002SD-G0 for qemu-devel@nongnu.org; Wed, 25 Apr 2018 05:52:34 -0400 Received: by mail-ot0-x241.google.com with SMTP id w4-v6so24615909ote.12 for ; Wed, 25 Apr 2018 02:52:34 -0700 (PDT) Received: from fma-X550VB.ipads-lab.se.sjtu.edu.cn ([172.111.136.123]) by smtp.gmail.com with ESMTPSA id r14-v6sm11256610otd.47.2018.04.25.02.52.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Apr 2018 02:52:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=SyE2jV31XUCD9wpc49pu1+eErhvXvGpYhBJCWOSIKkQ=; b=p5/ytAIRK+/kh5A8kVxmy+x1YbJOAKMdGOYKc3APDbdVjKHIPn+9uQ5mGOM8PUkr52 fVJj4+OvjyK+t7gfVQBvAbmf517KEftcYG6G5EO9M/lVbuX5ZdxinbXQQObX1VDzN/Hs ahgCMG15UO/JOC/KsdJPBccoRUBya3kQhv834wyJdkrhs5uj/YmWZSzrjcBKUeL2aIm9 tH4RQeSj2UxAjyGVc7tcbZ6uCj6fYWk+lUrofwUbPyswm4scCIfRza7V1RrIPc+O5EiJ WoUEo+9/P0llW9MlSO3oXZUWml6UDJBu+hTIumsdr1bK73ORc4Clq2+dkyLqcU8OBw8a nSEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=SyE2jV31XUCD9wpc49pu1+eErhvXvGpYhBJCWOSIKkQ=; b=sTBMlXG3koClLlsMsHS5dKoBls2h98FiyldAqWfCMiyIkTSbg3wq5yw/7Dowd6lhJ+ QTROdLbmV/O3kh05hHBLrH4ZFVwipH2XolblkPaDaiknfgid55evq+t0KpmWA1ocI/XD 8qGMvFuJQzZR0Uk7G0rMGG/1BuowCvFD0Ff6yt5bKVmeEpFWjhmbQPIVGk/C7hW6kXAh QLn6ERIajvhnBCsds5ybFF3+J+l0BLs7XneWj8xiTBpoUlWOPxuCKzWoB0QuXwc+6+4U xkQUq2cawqVuAsd6Xl9FIvST0SQJtvyMVW6Nkc8ptL4bN3DuIhJLuFPxy8iQHM7EVGlD mAdw== X-Gm-Message-State: ALQs6tD8YvwAwvm2e+yXS/SLdK17aTcxY6Tbn2Rl1ayB/zror/lMGWKB bif9VaEBhg0hXduOZLvhbGzpjg== X-Google-Smtp-Source: AIpwx4/o6EOzsX4sUyweklhB5PphDHY+N4Fk2KCiDVA00IFOnIdB1TIZa5YxUSCuBhIH8vWQwgPcKg== X-Received: by 2002:a9d:ef:: with SMTP id 44-v6mr18164243otk.164.1524649953483; Wed, 25 Apr 2018 02:52:33 -0700 (PDT) From: Zihan Yang To: qemu-devel@nongnu.org Date: Wed, 25 Apr 2018 17:52:23 +0800 Message-Id: <1524649943-6922-1-git-send-email-whois.zihan.yang@gmail.com> X-Mailer: git-send-email 2.7.4 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c0f::241 Subject: [Qemu-devel] [PATCH v2] hw/pci-host/q35: Replace hardcoded value with macro 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: Marcel Apfelbaum , Zihan Yang , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" During smram region initialization some addresses are hardcoded, replace them with macro to be more clear to readers. Previous patch forgets about one value and exceeds the line limit of 90 characters. The v2 breaks a few long lines Signed-off-by: Zihan Yang --- hw/pci-host/q35.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c index a36a119..02f9576 100644 --- a/hw/pci-host/q35.c +++ b/hw/pci-host/q35.c @@ -535,13 +535,15 @@ static void mch_realize(PCIDevice *d, Error **errp) =20 /* if *disabled* show SMRAM to all CPUs */ memory_region_init_alias(&mch->smram_region, OBJECT(mch), "smram-regio= n", - mch->pci_address_space, 0xa0000, 0x20000); - memory_region_add_subregion_overlap(mch->system_memory, 0xa0000, + mch->pci_address_space, MCH_HOST_BRIDGE_SMRAM= _C_BASE, + MCH_HOST_BRIDGE_SMRAM_C_SIZE); + memory_region_add_subregion_overlap(mch->system_memory, MCH_HOST_BRIDG= E_SMRAM_C_BASE, &mch->smram_region, 1); memory_region_set_enabled(&mch->smram_region, true); =20 memory_region_init_alias(&mch->open_high_smram, OBJECT(mch), "smram-op= en-high", - mch->ram_memory, 0xa0000, 0x20000); + mch->ram_memory, MCH_HOST_BRIDGE_SMRAM_C_BASE, + MCH_HOST_BRIDGE_SMRAM_C_SIZE); memory_region_add_subregion_overlap(mch->system_memory, 0xfeda0000, &mch->open_high_smram, 1); memory_region_set_enabled(&mch->open_high_smram, false); @@ -550,11 +552,14 @@ static void mch_realize(PCIDevice *d, Error **errp) memory_region_init(&mch->smram, OBJECT(mch), "smram", 1ull << 32); memory_region_set_enabled(&mch->smram, true); memory_region_init_alias(&mch->low_smram, OBJECT(mch), "smram-low", - mch->ram_memory, 0xa0000, 0x20000); + mch->ram_memory, MCH_HOST_BRIDGE_SMRAM_C_BASE, + MCH_HOST_BRIDGE_SMRAM_C_SIZE); memory_region_set_enabled(&mch->low_smram, true); - memory_region_add_subregion(&mch->smram, 0xa0000, &mch->low_smram); + memory_region_add_subregion(&mch->smram, MCH_HOST_BRIDGE_SMRAM_C_BASE, + &mch->low_smram); memory_region_init_alias(&mch->high_smram, OBJECT(mch), "smram-high", - mch->ram_memory, 0xa0000, 0x20000); + mch->ram_memory, MCH_HOST_BRIDGE_SMRAM_C_BASE, + MCH_HOST_BRIDGE_SMRAM_C_SIZE); memory_region_set_enabled(&mch->high_smram, true); memory_region_add_subregion(&mch->smram, 0xfeda0000, &mch->high_smram); =20 --=20 2.7.4