[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [QEMU 6/7] kvm: Add two new arch specific functions
From: |
Li, Liang Z |
Subject: |
Re: [Qemu-devel] [QEMU 6/7] kvm: Add two new arch specific functions |
Date: |
Mon, 20 Jun 2016 03:16:04 +0000 |
> > --- a/target-arm/kvm.c
> > +++ b/target-arm/kvm.c
> > @@ -627,3 +627,17 @@ int kvm_arch_msi_data_to_gsi(uint32_t data) {
> > return (data - 32) & 0xffff;
> > }
> > +
> > +unsigned long get_guest_max_pfn(void) {
> > + /* To be done */
> > +
> > + return 0;
> > +}
> > +
> > +unsigned long *tighten_guest_free_page_bmap(unsigned long *bmap) {
> > + /* To be done */
> > +
> > + return bmap;
> > +}
> > diff --git a/target-i386/kvm.c b/target-i386/kvm.c index
> > abf50e6..0b394cb 100644
> > --- a/target-i386/kvm.c
> > +++ b/target-i386/kvm.c
> > @@ -3327,3 +3327,38 @@ int kvm_arch_msi_data_to_gsi(uint32_t data) {
> > abort();
> > }
> > +
> > +unsigned long get_guest_max_pfn(void) {
> > + PCMachineState *pcms = PC_MACHINE(current_machine);
> > + ram_addr_t above_4g_mem = pcms->above_4g_mem_size;
> > + unsigned long max_pfn;
> > +
> > + if (above_4g_mem) {
> > + max_pfn = ((1ULL << 32) + above_4g_mem) >> TARGET_PAGE_BITS;
> > + } else {
> > + max_pfn = pcms->below_4g_mem_size >> TARGET_PAGE_BITS;
> > + }
> > +
> > + return max_pfn;
> > +}
>
> Why is this in kvm?
I can't find a better place. Do you have any suggestion?
> > + pos = (above_4g_mem + below_4g_mem) >> TARGET_PAGE_BITS;
> > + len = ((1ULL << 32) - below_4g_mem) >> TARGET_PAGE_BITS;
> > + bitmap_clear(bmap, pos, len);
> > + }
> > +
> > + return bmap;
> > +}
>
> what does this do? External APIs should have documentation.
I will add the documentation. Thanks!
Liang
- Re: [Qemu-devel] [QEMU 3/7] Add the hmp and qmp interface for dropping cache, (continued)
- Re: [Qemu-devel] [QEMU 3/7] Add the hmp and qmp interface for dropping cache, Li, Liang Z, 2016/06/13
- Re: [Qemu-devel] [QEMU 3/7] Add the hmp and qmp interface for dropping cache, Dr. David Alan Gilbert, 2016/06/13
- Re: [Qemu-devel] [QEMU 3/7] Add the hmp and qmp interface for dropping cache, Li, Liang Z, 2016/06/13
- Re: [Qemu-devel] [QEMU 3/7] Add the hmp and qmp interface for dropping cache, Li, Liang Z, 2016/06/16
[Qemu-devel] [QEMU 5/7] bitmap: Add a new bitmap_move function, Liang Li, 2016/06/13
[Qemu-devel] [QEMU 6/7] kvm: Add two new arch specific functions, Liang Li, 2016/06/13
[Qemu-devel] [QEMU 7/7] migration: skip free pages during live migration, Liang Li, 2016/06/13