Received: by 2002:a19:6d5:0:0:0:0:0 with SMTP id 204csp692850lfg; Wed, 17 Mar 2021 12:10:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3x32CF66c8KRH8SQu4Wzw7tTLJZWXYxGu4PUP4tv2zcUE6d2xzt4Y7iX7YyyaoOrGSoKP X-Received: by 2002:a02:230d:: with SMTP id u13mr4063875jau.53.1616008234376; Wed, 17 Mar 2021 12:10:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616008234; cv=none; d=google.com; s=arc-20160816; b=O0eTaERfyLLoNthyuri51TPfOiBEDoCsQl9fouR6Pkt0egYXu6Ed2HWeLfEHKlM88Y XAZ72BMfnkvf2uM0SoWabhci3T5S3ZyUdUV8abCtmUpn59+MuWefSOfuJYh9Dh7zdBsg Go/xjrZHmf8VtkrwkDRW1jBW5L4Ic0zt31ilVBtXHnyu0qfbq7K6Almj7ivqO+TAJcej UFEP4I/qYklwgdGuof0VjYplKDCAJZgwJWO33Z2lukkWeKdCZoDElWqNd3HJnSjINUvD AybcogVBGiiKs1uCR/fXYhF932pOg2twGvD/xX0CVwfHZbV7dtvqZf480DLYqyPMtxBT pE+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject; bh=/HDLH5GVTOCk0Wbq25hprqMNQcjsEX+t1ekRK97E5/s=; b=JEFhRWca06Rhh/tS/NbaUHzcRK0DH22oFdiCmni2bYSKwKbIk0TDZQl7kBGiCOXwKE Hv0J4NBA6oY4yB4Ivr5rvPK61zYJPbLK7G5ecbB5pc2butdhUfwEXNVKY0+p26C0nqbP YApfYmzLzdA55T04Ch6jG5jp3GoPc3AlyaF497td/FvyLBXSvk/yWJptjouWWjppQI6i GpftyZI3H5FQaDgCj6WW0/kdOfOLL1NL0R03/wb/NvGGz6qt7QJUvieVUejX9f36ydCE ZH/W5IgRW03e0PTZO2PbXdRuKLoQyawd2A2zdL7aUqOONu5JI4sBQowO85np7u2tQre5 dVPw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q13si16117956ile.1.2021.03.17.12.10.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Mar 2021 12:10:34 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org" Received: from localhost ([::1]:43056 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMbYv-0004sm-J3 for alex.bennee@linaro.org; Wed, 17 Mar 2021 15:10:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43122) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMbCC-0003Lm-Mx; Wed, 17 Mar 2021 14:47:04 -0400 Received: from smtpout1.mo529.mail-out.ovh.net ([178.32.125.2]:36039) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMbC6-0006RI-VI; Wed, 17 Mar 2021 14:47:04 -0400 Received: from mxplan5.mail.ovh.net (unknown [10.108.20.195]) by mo529.mail-out.ovh.net (Postfix) with ESMTPS id CC427915D364; Wed, 17 Mar 2021 19:46:19 +0100 (CET) Received: from kaod.org (37.59.142.104) by DAG4EX1.mxp5.local (172.16.2.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Wed, 17 Mar 2021 19:46:18 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-104R00567ebd040-bc2e-4e28-b982-3ede969a9a4f, 10040688A1AB5364447EAD88D88247B833C1D39B) smtp.auth=clg@kaod.org X-OVh-ClientIp: 82.64.250.170 Subject: Re: [PATCH 2/5] hw/arm/aspeed: Do not sysbus-map mmio flash region directly, use alias To: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , References: <20210312182851.1922972-1-f4bug@amsat.org> <20210312182851.1922972-3-f4bug@amsat.org> <4a812dc9-b448-0b8f-6a66-95cb96acdc17@amsat.org> From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= Message-ID: Date: Wed, 17 Mar 2021 19:46:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <4a812dc9-b448-0b8f-6a66-95cb96acdc17@amsat.org> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [37.59.142.104] X-ClientProxiedBy: DAG1EX1.mxp5.local (172.16.2.1) To DAG4EX1.mxp5.local (172.16.2.31) X-Ovh-Tracer-GUID: 443d7359-2681-4cee-bb9b-c21af257b3a1 X-Ovh-Tracer-Id: 5654832283019807675 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduledrudefgedguddvtdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefuvfhfhffkffgfgggjtgfgihesthekredttdefjeenucfhrhhomhepveorughrihgtpgfnvggpifhorghtvghruceotghlgheskhgrohgurdhorhhgqeenucggtffrrghtthgvrhhnpeejkeduueduveelgeduueegkeelffevledujeetffeivdelvdfgkeeufeduheehfeenucfkpheptddrtddrtddrtddpfeejrdehledrudegvddruddtgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphdqohhuthdphhgvlhhopehmgihplhgrnhehrdhmrghilhdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomheptghlgheskhgrohgurdhorhhgpdhrtghpthhtohepghhrohhugheskhgrohgurdhorhhg Received-SPF: pass client-ip=178.32.125.2; envelope-from=clg@kaod.org; helo=smtpout1.mo529.mail-out.ovh.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Andrew Jeffery , Alistair Francis , Greg Kurz , Peter Xu , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Joel Stanley , Paolo Bonzini , =?UTF-8?Q?Herv=c3=a9_Poussineau?= , David Gibson Errors-To: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: "Qemu-arm" X-TUID: 26hnBY8TJhVr On 3/13/21 1:05 PM, Philippe Mathieu-Daudé wrote: > Incorrect subject prefix, should be "hw/ssi/aspeed_smc" Is this just good practice or something that was agreed upon ? We should update checkpatch if so. Thanks, C. > > On 3/12/21 7:28 PM, Philippe Mathieu-Daudé wrote: >> The flash mmio region is exposed as an AddressSpace. >> AddressSpaces must not be sysbus-mapped, therefore map >> the region using an alias. >> >> Signed-off-by: Philippe Mathieu-Daudé >> --- >> include/hw/ssi/aspeed_smc.h | 1 + >> hw/ssi/aspeed_smc.c | 4 +++- >> 2 files changed, 4 insertions(+), 1 deletion(-) >> >> diff --git a/include/hw/ssi/aspeed_smc.h b/include/hw/ssi/aspeed_smc.h >> index 16c03fe64f3..e3c96cecbd8 100644 >> --- a/include/hw/ssi/aspeed_smc.h >> +++ b/include/hw/ssi/aspeed_smc.h >> @@ -84,6 +84,7 @@ struct AspeedSMCState { >> >> MemoryRegion mmio; >> MemoryRegion mmio_flash; >> + MemoryRegion mmio_flash_alias; >> >> qemu_irq irq; >> int irqline; >> diff --git a/hw/ssi/aspeed_smc.c b/hw/ssi/aspeed_smc.c >> index 16addee4dc8..aa26578bdac 100644 >> --- a/hw/ssi/aspeed_smc.c >> +++ b/hw/ssi/aspeed_smc.c >> @@ -1386,7 +1386,9 @@ static void aspeed_smc_realize(DeviceState *dev, Error **errp) >> memory_region_init_io(&s->mmio_flash, OBJECT(s), >> &aspeed_smc_flash_default_ops, s, name, >> s->ctrl->flash_window_size); >> - sysbus_init_mmio(sbd, &s->mmio_flash); >> + memory_region_init_alias(&s->mmio_flash_alias, OBJECT(s), name, >> + &s->mmio_flash, 0, s->ctrl->flash_window_size); >> + sysbus_init_mmio(sbd, &s->mmio_flash_alias); >> >> s->flashes = g_new0(AspeedSMCFlash, s->ctrl->max_peripherals);