[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v1 06/26] E820: extend the table access interface
From: |
Adalbert Lazăr |
Subject: |
[RFC PATCH v1 06/26] E820: extend the table access interface |
Date: |
Wed, 15 Apr 2020 03:59:18 +0300 |
This new function is necessary for the VM introspection object.
By sending all e820 entries, not just the RAM ones,
the introspection tool can differentiate between
an invalid address and a reserved one.
CC: Paolo Bonzini <address@hidden>
CC: Richard Henderson <address@hidden>
CC: Eduardo Habkost <address@hidden>
CC: "Michael S. Tsirkin" <address@hidden>
CC: Marcel Apfelbaum <address@hidden>
Signed-off-by: Adalbert Lazăr <address@hidden>
---
hw/i386/e820_memory_layout.c | 12 ++++++++++++
hw/i386/e820_memory_layout.h | 2 ++
2 files changed, 14 insertions(+)
diff --git a/hw/i386/e820_memory_layout.c b/hw/i386/e820_memory_layout.c
index bcf9eaf837..a875e9e326 100644
--- a/hw/i386/e820_memory_layout.c
+++ b/hw/i386/e820_memory_layout.c
@@ -57,3 +57,15 @@ bool e820_get_entry(int idx, uint32_t type, uint64_t
*address, uint64_t *length)
}
return false;
}
+
+bool e820_get_entry2(int idx, uint32_t *type, uint64_t *address,
+ uint64_t *length)
+{
+ if (idx < e820_entries) {
+ *type = le32_to_cpu(e820_table[idx].type);
+ *address = le64_to_cpu(e820_table[idx].address);
+ *length = le64_to_cpu(e820_table[idx].length);
+ return true;
+ }
+ return false;
+}
diff --git a/hw/i386/e820_memory_layout.h b/hw/i386/e820_memory_layout.h
index 2a0ceb8b9c..a4555c21fb 100644
--- a/hw/i386/e820_memory_layout.h
+++ b/hw/i386/e820_memory_layout.h
@@ -36,6 +36,8 @@ int e820_add_entry(uint64_t address, uint64_t length,
uint32_t type);
int e820_get_num_entries(void);
bool e820_get_entry(int index, uint32_t type,
uint64_t *address, uint64_t *length);
+bool e820_get_entry2(int index, uint32_t *type,
+ uint64_t *address, uint64_t *length);
- [RFC PATCH v1 03/26] char-socket: fix the client mode when created through QMP, (continued)
[RFC PATCH v1 08/26] kvm: add VM introspection usage documentation, Adalbert Lazăr, 2020/04/14
[RFC PATCH v1 04/26] char-socket: add 'reconnecting' property, Adalbert Lazăr, 2020/04/14
[RFC PATCH v1 06/26] E820: extend the table access interface,
Adalbert Lazăr <=
[RFC PATCH v1 07/26] linux-headers: update with VM introspection interface, Adalbert Lazăr, 2020/04/14
[RFC PATCH v1 05/26] char-socket: add 'fd' property, Adalbert Lazăr, 2020/04/14
[RFC PATCH v1 13/26] kvm: vmi: block the object destruction if the chardev is connected, Adalbert Lazăr, 2020/04/14
[RFC PATCH v1 09/26] kvm: introduce the VM introspection object, Adalbert Lazăr, 2020/04/14
[RFC PATCH v1 02/26] char-socket: allow vsock parameters (cid, port), Adalbert Lazăr, 2020/04/14
[RFC PATCH v1 01/26] chardev: tcp: allow to change the reconnect timer, Adalbert Lazăr, 2020/04/14