Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2350541imm; Thu, 23 Aug 2018 20:07:26 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyUkM/8vF345X+jRs7joQ/DsnqlXJYkpGO6rk6OWM1VUjyLRF02dHvL5BhXBL/akloOfAcS X-Received: by 2002:a17:902:6f16:: with SMTP id w22-v6mr42250217plk.127.1535080046717; Thu, 23 Aug 2018 20:07:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535080046; cv=none; d=google.com; s=arc-20160816; b=VrJzyBz/iq497Ee0xcqGjKyOyARBSCcilUeMEG3Ze+yy5Wq2hs1g0dL8cP3wu8+rKq d/uQBC33lsCNX06b4bwOj47g3l3BW579lJpIBWX1qfuW9BZ841uDVMJTAj1HMnRGfh35 //rsdoLYXSdK7jTgErFSritnrDTYe7lyLgD2Q8g8tTOakMMm8QfXgW2hQyGSmAtuVjJL 6FmsEHnbz1r9J+3g+PqnjCXExPB8q5dz95mPK6fqSYArU6WhHMvoX2qi4QvuUEdNETEg n/NMbrF6/naZ0WrXHjazGJ7VkULKmFvrjuEzJhJ1UZcoTMUG5dbBCR2/MbozTMOwmWIa fRRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=MkFyMnRDF/AWWsd9rZeDVyyq5ZADujRwBsumUbdQw1c=; b=gEzfVIZOnSHWBzzAaMqeqF9AAMJOw8ZWg4x5d3ZgKswjrNgTZU9HHqirWSp1CHT9+G O0W7Z9bzu5fuiY4mj/rxvIrYZA2MP5ssfEUj+vfGlTfETlqrKCOhv40VyoWxlWdHg2Xu F5l052ddZzYX1zrMDnHoj6cfgjYNZMlD9j1bKM+Ee0PeODJSvEHhFr6GF1GLPSJQ94MW zLDuPpcqzU/sNOBA0XpAw0oMgxjrbo3K0R1xogPkQR+WC0RiWUfSixJLKlUqlOqZDDGH W+8TbZnLuWkdQPtqPt0zVv8CLuGIBfdOIOwYNXDhwzUXwu+9aem679kQYQnUcIf0P8MJ uepw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n19-v6si2881430pfi.360.2018.08.23.20.07.11; Thu, 23 Aug 2018 20:07:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727428AbeHXGij (ORCPT + 99 others); Fri, 24 Aug 2018 02:38:39 -0400 Received: from mxhk.zte.com.cn ([63.217.80.70]:13922 "EHLO mxhk.zte.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726140AbeHXGij (ORCPT ); Fri, 24 Aug 2018 02:38:39 -0400 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id CC556C23FE6141678060; Fri, 24 Aug 2018 11:06:00 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id w7O35qHu036684; Fri, 24 Aug 2018 11:05:52 +0800 (GMT-8) (envelope-from peng.hao2@zte.com.cn) Received: from localhost.localdomain.localdomain ([10.74.120.59]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2018082411060009-5963661 ; Fri, 24 Aug 2018 11:06:00 +0800 From: Peng Hao To: pbonzini@redhat.com, rkrcmar@redhat.com Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, zhong.weidong@zte.com.cn, wanpeng.li@hotmail.com, Peng Hao Subject: [PATCH V3 0/2] introduce coalesced pio support Date: Fri, 24 Aug 2018 19:20:30 +0800 Message-Id: <1535109632-59745-1-git-send-email-peng.hao2@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2018-08-24 11:06:00, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2018-08-24 11:05:37, Serialize complete at 2018-08-24 11:05:37 X-MAIL: mse01.zte.com.cn w7O35qHu036684 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Coalesced pio is base on coalesced mmio and can be used for some port like rtc port, pci-host config port, virtio-pci config port and so on. Specially in case of rtc as coalesced pio, some versions of windows guest access rtc frequently because of rtc as system tick. guest access rtc like this: write register index to 0x70, then write or read data from 0x71. writing 0x70 port is just as index and do nothing else. So we can use coalesced pio to handle this scene to reduce VM-EXIT time. When it starts and closes the virtual machine, it will access pci-host config port or virtio-pci config port frequently. So setting these port as coalesced pio can reduce startup and shutdown time. In qemu I just realize piixfx's pci-host, it is convenient for other pci-host type implementations. without my patch, get the vm-exit time of accessing rtc 0x70 and piix 0xcf8 using perf tools: (guest OS : windows 7 64bit) IO Port Access Samples Samples% Time% Min Time Max Time Avg time 0x70:POUT 86 30.99% 74.59% 9us 29us 10.75us (+- 3.41%) 0xcf8:POUT 1119 2.60% 2.12% 2.79us 56.83us 3.41us (+- 2.23%) with my patch IO Port Access Samples Samples% Time% Min Time Max Time Avg time 0x70:POUT 106 32.02% 29.47% 0us 10us 1.57us (+- 7.38%) 0xcf8:POUT 1065 1.67% 0.28% 0.41us 65.44us 0.66us (+- 10.55%) I think there is a need for further consideration in changing coalesecd_mmio's naming in kernel and qemu together.So maybe another patch does it. Peng Hao (2): kvm/x86 : add coalesced pio support kvm/x86 : add document for coalesced pio Documentation/virtual/kvm/00-INDEX | 4 ++++ Documentation/virtual/kvm/coalesced-pio.txt | 14 ++++++++++++++ include/uapi/linux/kvm.h | 5 +++-- virt/kvm/coalesced_mmio.c | 8 +++++--- virt/kvm/kvm_main.c | 2 ++ 5 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 Documentation/virtual/kvm/coalesced-pio.txt -- 1.8.3.1