lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1578408399-20092-1-git-send-email-weiqi4@huawei.com>
Date:   Tue, 7 Jan 2020 22:46:37 +0800
From:   weiqi <weiqi4@...wei.com>
To:     <alexander.h.duyck@...ux.intel.com>, <alex.williamson@...hat.com>
CC:     <kvm@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <pbonzini@...hat.com>, <x86@...nel.org>, wei qi <weiqi4@...wei.com>
Subject: [PATCH 0/2] page hinting add passthrough support

From: wei qi <weiqi4@...wei.com>


I just implemented dynamically updating the iommu table to support pass-through,
It seen to work fine.

Test:
start a 4G vm with 2M hugetlb and ixgbevf passthrough, 
    GuestOS: linux-5.2.6 + 	(mm / virtio: Provide support for free page reporting)
    HostOS: 5.5-rc4
    Host: Intel(R) Xeon(R) Gold 6161 CPU @ 2.20GHz 

after enable page hinting, free pages at GuestOS can be free at host. 


before,
 # cat /sys/devices/system/node/node*/hugepages/hugepages-2048kB/free_hugepages 
 5620
 5620
after start VM,
 # numastat -c qemu

 Per-node process memory usage (in MBs)
 PID              Node 0 Node 1 Total
 ---------------  ------ ------ -----
 24463 (qemu_hotr      6      6    12
 24479 (qemu_tls_      0      8     8
 70718 (qemu-syst     58    539   597
 ---------------  ------ ------ -----
 Total                64    553   616
 # cat /sys/devices/system/node/node*/hugepages/hugepages-2048kB/free_hugepages 
 5595
 5366

the modify at qemu,
 +int kvm_discard_range(struct kvm_discard_msg discard_msg)  
 +{
 +    return kvm_vm_ioctl(kvm_state, KVM_DISCARD_RANGE, &discard_msg);
 +}

 static void virtio_balloon_handle_report(VirtIODevice *vdev, VirtQueue *vq)
 {
            ..................
 +           discard_msg.in_addr = elem->in_addr[i];
 +           discard_msg.iov_len = elem->in_sg[i].iov_len;

            ram_block_discard_range(rb, ram_offset, size);
 +           kvm_discard_range(discard_msg);

then, further test network bandwidth, performance seem ok.
 
Is there any hidden problem in this implementation?
And, is there plan to support pass-throughyour?

wei qi (2):
  vfio: add mmap/munmap API for page hinting
  KVM: add support for page hinting

 arch/x86/kvm/mmu/mmu.c          |  79 ++++++++++++++++++++
 arch/x86/kvm/x86.c              |  96 ++++++++++++++++++++++++
 drivers/vfio/vfio.c             | 109 ++++++++++++++++++++++++++++
 drivers/vfio/vfio_iommu_type1.c | 157 +++++++++++++++++++++++++++++++++++++++-
 include/linux/kvm_host.h        |  41 +++++++++++
 include/linux/vfio.h            |  17 ++++-
 include/uapi/linux/kvm.h        |   7 ++
 virt/kvm/vfio.c                 |  11 ---
 8 files changed, 503 insertions(+), 14 deletions(-)

-- 
1.8.3.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ