Re: [Qemu-devel] [PATCH uq/master 1/2] Add qemu_ram_remap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 13, 2011 at 8:34 AM, Huang Ying <ying.huang@xxxxxxxxx> wrote:
> qemu_ram_remap() unmaps the specified RAM pages, then re-maps these
> pages again. ÂThis is used by KVM HWPoison support to clear HWPoisoned
> page tables across guest rebooting, so that a new page may be
> allocated later to recover the memory error.
>
> Signed-off-by: Huang Ying <ying.huang@xxxxxxxxx>
> ---
> Âcpu-all.h  Â|  Â4 +++
> Âcpu-common.h | Â Â1
> Âexec.c    |  61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
> Â3 files changed, 65 insertions(+), 1 deletion(-)
>
> --- a/cpu-all.h
> +++ b/cpu-all.h
> @@ -863,10 +863,14 @@ target_phys_addr_t cpu_get_phys_page_deb
> Âextern int phys_ram_fd;
> Âextern ram_addr_t ram_size;
>
> +/* RAM is pre-allocated and passed into qemu_ram_alloc_from_ptr */
> +#define RAM_PREALLOC_MASK Â Â Â(1 << 0)
> +
> Âtypedef struct RAMBlock {
> Â Â uint8_t *host;
> Â Â ram_addr_t offset;
> Â Â ram_addr_t length;
> + Â Âuint32_t flags;
> Â Â char idstr[256];
> Â Â QLIST_ENTRY(RAMBlock) next;
> Â#if defined(__linux__) && !defined(TARGET_S390X)
> --- a/exec.c
> +++ b/exec.c
> @@ -2830,6 +2830,7 @@ ram_addr_t qemu_ram_alloc_from_ptr(Devic
>
> Â Â if (host) {
> Â Â Â Â new_block->host = host;
> + Â Â Â Ânew_block->flags |= RAM_PREALLOC_MASK;
> Â Â } else {
> Â Â Â Â if (mem_path) {
> Â#if defined (__linux__) && !defined(TARGET_S390X)
> @@ -2883,7 +2884,9 @@ void qemu_ram_free(ram_addr_t addr)
> Â Â QLIST_FOREACH(block, &ram_list.blocks, next) {
> Â Â Â Â if (addr == block->offset) {
> Â Â Â Â Â Â QLIST_REMOVE(block, next);
> - Â Â Â Â Â Âif (mem_path) {
> + Â Â Â Â Â Âif (block->flags & RAM_PREALLOC_MASK)

Missing braces.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux