This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Resource: Read {} | |
trait Factory { | |
type R: Resource; | |
fn get(&self, index: u8) -> Result<Self::R, ()>; | |
} | |
#[derive(Clone)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Xen leaves holes in it's p2m map which makes using dominfo.maxmemkb insufficient for accessing all of the guests physical memory. | |
xc_domain_maximum_gpfn() seems to return a usable value, but is also larger than necessary for guests with less than 4GB of ram. | |
Linux guest with 2GB of ram: | |
nr_pages: 80042 | |
nr_outstanding_pages: 0 | |
nr_shared_pages: 0 | |
nr_paged_pages: 0 | |
max_memkb: 200400 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ gcc -lvmi -Wall -pedantic page_size_size_test.c | |
$ ./a.out | |
sizeof(enum page_size): 4 | |
sizeof(page_size_t): 4 | |
sizeof(VMI_PS_4KB): 4 | |
$ gcc --version | |
gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2 | |
Copyright (C) 2013 Free Software Foundation, Inc. |