From patchwork Sat Apr 20 15:59:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Qiang X-Patchwork-Id: 10910371 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A6B6B1515 for ; Sat, 20 Apr 2019 16:02:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 985ED28C94 for ; Sat, 20 Apr 2019 16:02:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C69728C96; Sat, 20 Apr 2019 16:02:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 45D1C28C94 for ; Sat, 20 Apr 2019 16:02:03 +0000 (UTC) Received: from localhost ([127.0.0.1]:42822 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHsRG-0007PT-GI for patchwork-qemu-devel@patchwork.kernel.org; Sat, 20 Apr 2019 12:02:02 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54846) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHsPK-0005w9-73 for qemu-devel@nongnu.org; Sat, 20 Apr 2019 12:00:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hHsPJ-0008Fy-A8 for qemu-devel@nongnu.org; Sat, 20 Apr 2019 12:00:02 -0400 Received: from m12-11.163.com ([220.181.12.11]:33864) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHsPI-0008F3-4s for qemu-devel@nongnu.org; Sat, 20 Apr 2019 12:00:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=w4ygKr81NYHHj0JHeC mMA9n1b8fxsPI3UkzRPp2GlvU=; b=jp9HjPVsY8Snt97LB1FHL2YEcDpWnOfEFi ta8Uwku8yYxE1EAZNef/iiRRskYYcJco6dA1TALpAoDk7l37blOHbjwnJprzqvjp FF59xmbFgP+dwJ5liT0NIUtgOhK4gG6tIsGsHqPgqjJGZNKdirlGBPV0tflaa3cQ yDOGtVuyo= Received: from localhost.localdomain (unknown [183.159.69.175]) by smtp7 (Coremail) with SMTP id C8CowACX_I34QbtcELxpBQ--.29437S3; Sat, 20 Apr 2019 23:59:55 +0800 (CST) From: Li Qiang To: jslaby@suse.cz, pbonzini@redhat.com Date: Sat, 20 Apr 2019 08:59:47 -0700 Message-Id: <20190420155949.130968-2-liq3ea@163.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190420155949.130968-1-liq3ea@163.com> References: <20190420155949.130968-1-liq3ea@163.com> X-CM-TRANSID: C8CowACX_I34QbtcELxpBQ--.29437S3 X-Coremail-Antispam: 1Uf129KBjvJXoWrZF48CF17GFyxAFW3Ar1xuFg_yoW8JF13pF 1Uu3WYkrZ5JFZFqr13Gr1qqr1ftr97Cw18JrZxXFWjyw48Xr1DKa10ka4Fgrn8JF48Xanx Z3ZYqF43KF1DXaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UQNVkUUUUU= X-Originating-IP: [183.159.69.175] X-CM-SenderInfo: 5oltjvrd6rljoofrz/1tbiKRmcbVXlqvAo4QABsj X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 220.181.12.11 Subject: [Qemu-devel] [PATCH v2 1/3] tests: fw_cfg: add splash time test case 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: Li Qiang , liq3ea@gmail.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Li Qiang --- tests/fw_cfg-test.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/fw_cfg-test.c b/tests/fw_cfg-test.c index 9f75dbb5f4..de8e81ea9d 100644 --- a/tests/fw_cfg-test.c +++ b/tests/fw_cfg-test.c @@ -192,6 +192,24 @@ static void test_fw_cfg_reboot_timeout(void) qtest_quit(s); } +static void test_fw_cfg_splash_time(void) +{ + QFWCFG *fw_cfg; + QTestState *s; + uint16_t splash_time = 0; + size_t filesize; + + s = qtest_init("-boot splash-time=12"); + fw_cfg = pc_fw_cfg_init(s); + + filesize = qfw_cfg_get_file(fw_cfg, "etc/boot-menu-wait", + &splash_time, sizeof(splash_time)); + g_assert_cmpint(filesize, ==, sizeof(splash_time)); + g_assert_cmpint(splash_time, ==, 12); + pc_fw_cfg_uninit(fw_cfg); + qtest_quit(s); +} + int main(int argc, char **argv) { int ret; @@ -214,6 +232,7 @@ int main(int argc, char **argv) qtest_add_func("fw_cfg/numa", test_fw_cfg_numa); qtest_add_func("fw_cfg/boot_menu", test_fw_cfg_boot_menu); qtest_add_func("fw_cfg/reboot_timeout", test_fw_cfg_reboot_timeout); + qtest_add_func("fw_cfg/splash_time", test_fw_cfg_splash_time); ret = g_test_run(); From patchwork Sat Apr 20 15:59:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Qiang X-Patchwork-Id: 10910375 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9A845922 for ; Sat, 20 Apr 2019 16:05:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 89004212D5 for ; Sat, 20 Apr 2019 16:05:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 78BD42861D; Sat, 20 Apr 2019 16:05:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 34533212D5 for ; Sat, 20 Apr 2019 16:05:06 +0000 (UTC) Received: from localhost ([127.0.0.1]:42910 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHsUD-0001JP-EF for patchwork-qemu-devel@patchwork.kernel.org; Sat, 20 Apr 2019 12:05:05 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54876) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHsPL-0005wh-Ce for qemu-devel@nongnu.org; Sat, 20 Apr 2019 12:00:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hHsPK-0008Hy-Eb for qemu-devel@nongnu.org; Sat, 20 Apr 2019 12:00:03 -0400 Received: from m12-11.163.com ([220.181.12.11]:33987) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHsPI-0008Ef-5R for qemu-devel@nongnu.org; Sat, 20 Apr 2019 12:00:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=iRFD+zpf5l7TX1uoBr 2sBdhb6Xv5dDZq2CEa09rVSBg=; b=pmQVPwGu0D3ehnmkzB+0Z/Fouoj5iGXIjH oxpm+9nXmz8lgLhU+WeVh4+dtKI80ps5vaFjVAoSJvolkewfWFdLCUXz3BMhN0A2 q2hk1SxNQccnPXHUjVjDak4OOdFqdpP/NlLxo/0OAMnvNa5jbes3wJv1v3EEj8Rk X+dEItyKw= Received: from localhost.localdomain (unknown [183.159.69.175]) by smtp7 (Coremail) with SMTP id C8CowACX_I34QbtcELxpBQ--.29437S4; Sat, 20 Apr 2019 23:59:57 +0800 (CST) From: Li Qiang To: jslaby@suse.cz, pbonzini@redhat.com Date: Sat, 20 Apr 2019 08:59:48 -0700 Message-Id: <20190420155949.130968-3-liq3ea@163.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190420155949.130968-1-liq3ea@163.com> References: <20190420155949.130968-1-liq3ea@163.com> X-CM-TRANSID: C8CowACX_I34QbtcELxpBQ--.29437S4 X-Coremail-Antispam: 1Uf129KBjvdXoWruFyfZF15Wr4kKr43AF18Zrb_yoW3tFX_Xw 1xKFZ7GrW5XFyayF90q3W5uryxW3yrAF1rCrs3Gr43Ja4fGr98Z3s2qrnxXr47Gw47Kwn5 AaykZFy5trnFgjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUbCzutUUUUU== X-Originating-IP: [183.159.69.175] X-CM-SenderInfo: 5oltjvrd6rljoofrz/xtbBax2cbVetu+co+QAAsw X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 220.181.12.11 Subject: [Qemu-devel] [PATCH v2 2/3] edu: mmio: set 'max_access_size' to 8 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: Li Qiang , liq3ea@gmail.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The edu spec said, the MMIO area can be accessed by 8 bytes. However currently the 'max_access_size' is not so the MMIO access dispatch can only access 4 bytes one time. This patch fixes this to respect the spec. Notice: here the 'min_access_size' is not a must, I set this for completement. Signed-off-by: Li Qiang --- hw/misc/edu.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hw/misc/edu.c b/hw/misc/edu.c index 91af452c9e..65fc32b928 100644 --- a/hw/misc/edu.c +++ b/hw/misc/edu.c @@ -289,6 +289,15 @@ static const MemoryRegionOps edu_mmio_ops = { .read = edu_mmio_read, .write = edu_mmio_write, .endianness = DEVICE_NATIVE_ENDIAN, + .valid = { + .min_access_size = 4, + .max_access_size = 8, + }, + .impl = { + .min_access_size = 4, + .max_access_size = 8, + }, + }; /* From patchwork Sat Apr 20 15:59:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Qiang X-Patchwork-Id: 10910369 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2CCC01515 for ; Sat, 20 Apr 2019 16:01:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1521128C94 for ; Sat, 20 Apr 2019 16:01:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 08BE128C96; Sat, 20 Apr 2019 16:01:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CEA1728C94 for ; Sat, 20 Apr 2019 16:01:57 +0000 (UTC) Received: from localhost ([127.0.0.1]:42820 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHsRA-0007L3-En for patchwork-qemu-devel@patchwork.kernel.org; Sat, 20 Apr 2019 12:01:56 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54851) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHsPK-0005wA-Es for qemu-devel@nongnu.org; Sat, 20 Apr 2019 12:00:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hHsPJ-0008Gc-Kd for qemu-devel@nongnu.org; Sat, 20 Apr 2019 12:00:02 -0400 Received: from m12-11.163.com ([220.181.12.11]:34116) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHsPI-0008FW-FH for qemu-devel@nongnu.org; Sat, 20 Apr 2019 12:00:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=RHRyZI7fVUtHDgRAfm W2Km7K6555bdcRIgzudZy0lNE=; b=mfvl2eP/dBNtQo9wGCcHAWyZfa+GdjP+0E raUPK8r/rH2I7NDbCZdAnKb7A3kAsP9lBKe9q6dgTsUnLvO39F1gbkkye72R48wa 7H5KQdHiqlP29bsKUOLZxwWASRaTyxcEcQ4KlP6x7MynxBET9OVDKtNRaerqTilF 3oDNi1+DU= Received: from localhost.localdomain (unknown [183.159.69.175]) by smtp7 (Coremail) with SMTP id C8CowACX_I34QbtcELxpBQ--.29437S5; Sat, 20 Apr 2019 23:59:58 +0800 (CST) From: Li Qiang To: jslaby@suse.cz, pbonzini@redhat.com Date: Sat, 20 Apr 2019 08:59:49 -0700 Message-Id: <20190420155949.130968-4-liq3ea@163.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190420155949.130968-1-liq3ea@163.com> References: <20190420155949.130968-1-liq3ea@163.com> X-CM-TRANSID: C8CowACX_I34QbtcELxpBQ--.29437S5 X-Coremail-Antispam: 1Uf129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73 VFW2AGmfu7bjvjm3AaLaJ3UbIYCTnIWIevJa73UjIFyTuYvjxUczVbDUUUU X-Originating-IP: [183.159.69.175] X-CM-SenderInfo: 5oltjvrd6rljoofrz/1tbiFB6cbVaD0UJN+AAAsI X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 220.181.12.11 Subject: [Qemu-devel] [PATCH v2 3/3] edu: mmio: allow mmio read dispatch accept 8 bytes 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: Li Qiang , liq3ea@gmail.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The edu spec said when address >= 0x80, the MMIO area can be accessed by 8 bytes. Signed-off-by: Li Qiang --- Change since v1: Fix format compile error on Windows hw/misc/edu.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/misc/edu.c b/hw/misc/edu.c index 65fc32b928..4018dddcb8 100644 --- a/hw/misc/edu.c +++ b/hw/misc/edu.c @@ -189,6 +189,10 @@ static uint64_t edu_mmio_read(void *opaque, hwaddr addr, unsigned size) return val; } + if (addr >= 0x80 && size != 4 && size != 8) { + return val; + } + switch (addr) { case 0x00: val = 0x010000edu;