All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jes Sorensen <Jes.Sorensen@redhat.com>
To: qemu-devel@nongnu.org
Cc: kvm@vger.kernel.org, "Kevin O'Connor" <kevin@koconnor.net>,
	Avi Kivity <avi@redhat.com>,
	Anthony Liguori <aliguori@us.ibm.com>
Subject: [PATCH] QEMU - provide e820 reserve through qemu_cfg
Date: Mon, 25 Jan 2010 17:52:35 +0100	[thread overview]
Message-ID: <4B5DCC53.508@redhat.com> (raw)
In-Reply-To: <4B5DCB93.7050007@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 98 bytes --]

Hi,

This is the QEMU patch for providing the e820-reserve space through
qemu-cfg.

Cheers,
Jes



[-- Attachment #2: 0011-qemu-e820-reserve.patch --]
[-- Type: text/plain, Size: 2597 bytes --]

Use qemu-cfg to notify the BIOS of the location of the TSS range to
reserve in the e820 table, to avoid relying on hard coded values.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>

---
 hw/pc.c           |    5 +++++
 kvm.h             |    7 +++++++
 target-i386/kvm.c |    5 +++++
 3 files changed, 17 insertions(+)

Index: qemu/hw/pc.c
===================================================================
--- qemu.orig/hw/pc.c
+++ qemu/hw/pc.c
@@ -45,6 +45,7 @@
 #include "loader.h"
 #include "elf.h"
 #include "multiboot.h"
+#include "kvm.h"
 
 /* output Bochs bios info messages */
 //#define DEBUG_BIOS
@@ -59,6 +60,7 @@
 #define FW_CFG_ACPI_TABLES (FW_CFG_ARCH_LOCAL + 0)
 #define FW_CFG_SMBIOS_ENTRIES (FW_CFG_ARCH_LOCAL + 1)
 #define FW_CFG_IRQ0_OVERRIDE (FW_CFG_ARCH_LOCAL + 2)
+#define FW_CFG_E820_RESERVE (FW_CFG_ARCH_LOCAL + 3)
 
 #define MAX_IDE_BUS 2
 
@@ -66,6 +68,7 @@ static fdctrl_t *floppy_controller;
 static RTCState *rtc_state;
 static PITState *pit;
 static PCII440FXState *i440fx_state;
+struct fw_cfg_e820_reserve e820_reserve;
 
 typedef struct isa_irq_state {
     qemu_irq *i8259;
@@ -466,6 +469,8 @@ static void *bochs_bios_init(void)
     if (smbios_table)
         fw_cfg_add_bytes(fw_cfg, FW_CFG_SMBIOS_ENTRIES,
                          smbios_table, smbios_len);
+    fw_cfg_add_bytes(fw_cfg, FW_CFG_E820_RESERVE, (uint8_t *)&e820_reserve,
+                     sizeof(struct fw_cfg_e820_reserve));
 
     /* allocate memory for the NUMA channel: one (64bit) word for the number
      * of nodes, one word for each VCPU->node and one word for each node to
Index: qemu/kvm.h
===================================================================
--- qemu.orig/kvm.h
+++ qemu/kvm.h
@@ -96,6 +96,13 @@ void kvm_arch_reset_vcpu(CPUState *env);
 struct kvm_guest_debug;
 struct kvm_debug_exit_arch;
 
+struct fw_cfg_e820_reserve {
+    uint32_t addr;
+    uint32_t length;
+};
+
+extern struct fw_cfg_e820_reserve e820_reserve;
+
 struct kvm_sw_breakpoint {
     target_ulong pc;
     target_ulong saved_insn;
Index: qemu/target-i386/kvm.c
===================================================================
--- qemu.orig/target-i386/kvm.c
+++ qemu/target-i386/kvm.c
@@ -356,6 +356,11 @@ int kvm_arch_init(KVMState *s, int smp_c
      * as unavaible memory.  FIXME, need to ensure the e820 map deals with
      * this?
      */
+    /*
+     * Tell fw_cfg to notify the BIOS to reserve the range.
+     */
+    e820_reserve.addr = 0xfffbc000;
+    e820_reserve.length = 0x4000;
     return kvm_vm_ioctl(s, KVM_SET_TSS_ADDR, 0xfffbd000);
 }
                     

WARNING: multiple messages have this Message-ID (diff)
From: Jes Sorensen <Jes.Sorensen@redhat.com>
To: qemu-devel@nongnu.org
Cc: Anthony Liguori <aliguori@us.ibm.com>,
	Kevin O'Connor <kevin@koconnor.net>, Avi Kivity <avi@redhat.com>,
	kvm@vger.kernel.org
Subject: [Qemu-devel] [PATCH] QEMU - provide e820 reserve through qemu_cfg
Date: Mon, 25 Jan 2010 17:52:35 +0100	[thread overview]
Message-ID: <4B5DCC53.508@redhat.com> (raw)
In-Reply-To: <4B5DCB93.7050007@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 98 bytes --]

Hi,

This is the QEMU patch for providing the e820-reserve space through
qemu-cfg.

Cheers,
Jes



[-- Attachment #2: 0011-qemu-e820-reserve.patch --]
[-- Type: text/plain, Size: 2597 bytes --]

Use qemu-cfg to notify the BIOS of the location of the TSS range to
reserve in the e820 table, to avoid relying on hard coded values.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>

---
 hw/pc.c           |    5 +++++
 kvm.h             |    7 +++++++
 target-i386/kvm.c |    5 +++++
 3 files changed, 17 insertions(+)

Index: qemu/hw/pc.c
===================================================================
--- qemu.orig/hw/pc.c
+++ qemu/hw/pc.c
@@ -45,6 +45,7 @@
 #include "loader.h"
 #include "elf.h"
 #include "multiboot.h"
+#include "kvm.h"
 
 /* output Bochs bios info messages */
 //#define DEBUG_BIOS
@@ -59,6 +60,7 @@
 #define FW_CFG_ACPI_TABLES (FW_CFG_ARCH_LOCAL + 0)
 #define FW_CFG_SMBIOS_ENTRIES (FW_CFG_ARCH_LOCAL + 1)
 #define FW_CFG_IRQ0_OVERRIDE (FW_CFG_ARCH_LOCAL + 2)
+#define FW_CFG_E820_RESERVE (FW_CFG_ARCH_LOCAL + 3)
 
 #define MAX_IDE_BUS 2
 
@@ -66,6 +68,7 @@ static fdctrl_t *floppy_controller;
 static RTCState *rtc_state;
 static PITState *pit;
 static PCII440FXState *i440fx_state;
+struct fw_cfg_e820_reserve e820_reserve;
 
 typedef struct isa_irq_state {
     qemu_irq *i8259;
@@ -466,6 +469,8 @@ static void *bochs_bios_init(void)
     if (smbios_table)
         fw_cfg_add_bytes(fw_cfg, FW_CFG_SMBIOS_ENTRIES,
                          smbios_table, smbios_len);
+    fw_cfg_add_bytes(fw_cfg, FW_CFG_E820_RESERVE, (uint8_t *)&e820_reserve,
+                     sizeof(struct fw_cfg_e820_reserve));
 
     /* allocate memory for the NUMA channel: one (64bit) word for the number
      * of nodes, one word for each VCPU->node and one word for each node to
Index: qemu/kvm.h
===================================================================
--- qemu.orig/kvm.h
+++ qemu/kvm.h
@@ -96,6 +96,13 @@ void kvm_arch_reset_vcpu(CPUState *env);
 struct kvm_guest_debug;
 struct kvm_debug_exit_arch;
 
+struct fw_cfg_e820_reserve {
+    uint32_t addr;
+    uint32_t length;
+};
+
+extern struct fw_cfg_e820_reserve e820_reserve;
+
 struct kvm_sw_breakpoint {
     target_ulong pc;
     target_ulong saved_insn;
Index: qemu/target-i386/kvm.c
===================================================================
--- qemu.orig/target-i386/kvm.c
+++ qemu/target-i386/kvm.c
@@ -356,6 +356,11 @@ int kvm_arch_init(KVMState *s, int smp_c
      * as unavaible memory.  FIXME, need to ensure the e820 map deals with
      * this?
      */
+    /*
+     * Tell fw_cfg to notify the BIOS to reserve the range.
+     */
+    e820_reserve.addr = 0xfffbc000;
+    e820_reserve.length = 0x4000;
     return kvm_vm_ioctl(s, KVM_SET_TSS_ADDR, 0xfffbd000);
 }
                     

  reply	other threads:[~2010-01-25 16:52 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-25 16:46 [PATCH] Seabios - read e820 reserve from qemu_cfg Jes Sorensen
2010-01-25 16:46 ` [Qemu-devel] " Jes Sorensen
2010-01-25 16:49 ` [PATCH] QEMU-KVM - provide e820 reserve through qemu_cfg Jes Sorensen
2010-01-25 16:49   ` [Qemu-devel] " Jes Sorensen
2010-01-25 16:52   ` Jes Sorensen [this message]
2010-01-25 16:52     ` [Qemu-devel] [PATCH] QEMU " Jes Sorensen
2010-01-25 16:58     ` Alexander Graf
2010-01-25 16:58       ` [Qemu-devel] " Alexander Graf
2010-01-25 17:13       ` Jes Sorensen
2010-01-25 17:13         ` [Qemu-devel] " Jes Sorensen
2010-01-25 17:28         ` Alexander Graf
2010-01-25 17:28           ` [Qemu-devel] " Alexander Graf
2010-01-25 17:46           ` Jes Sorensen
2010-01-25 17:46             ` [Qemu-devel] " Jes Sorensen
2010-01-25 20:04             ` Alexander Graf
2010-01-25 20:04               ` [Qemu-devel] " Alexander Graf
2010-01-25 20:14               ` Anthony Liguori
2010-01-25 20:14                 ` [Qemu-devel] " Anthony Liguori
2010-01-25 21:05                 ` Jes Sorensen
2010-01-25 21:05                   ` [Qemu-devel] " Jes Sorensen
2010-01-25 21:08                   ` Alexander Graf
2010-01-25 21:08                     ` [Qemu-devel] " Alexander Graf
2010-01-25 21:24                     ` Jes Sorensen
2010-01-25 21:24                       ` [Qemu-devel] " Jes Sorensen
2010-01-26  6:46         ` Gleb Natapov
2010-01-26  6:46           ` [Qemu-devel] " Gleb Natapov
2010-01-26  8:36           ` Jes Sorensen
2010-01-26  8:36             ` [Qemu-devel] " Jes Sorensen
2010-01-26  0:24 ` [PATCH] Seabios - read e820 reserve from qemu_cfg Kevin O'Connor
2010-01-26  0:24   ` [Qemu-devel] " Kevin O'Connor
2010-01-26 21:52   ` [PATCH] Seabios - read e820 table " Jes Sorensen
2010-01-26 21:52     ` [Qemu-devel] " Jes Sorensen
2010-01-26 21:53     ` [PATCH] QEMU-KVM - provide e820 table via fw_cfg Jes Sorensen
2010-01-26 21:53       ` [Qemu-devel] " Jes Sorensen
2010-01-26 21:55       ` Alexander Graf
2010-01-26 21:55         ` [Qemu-devel] " Alexander Graf
2010-01-28  4:39     ` [PATCH] Seabios - read e820 table from qemu_cfg Kevin O'Connor
2010-01-28  4:39       ` [Qemu-devel] " Kevin O'Connor
2010-01-29  9:03       ` Jes Sorensen
2010-01-29  9:03         ` [Qemu-devel] " Jes Sorensen
2010-01-29 16:08         ` Gleb Natapov
2010-01-29 16:08           ` [Qemu-devel] " Gleb Natapov
2010-01-30  3:35         ` Kevin O'Connor
2010-01-30  3:35           ` [Qemu-devel] " Kevin O'Connor
2010-02-08 10:31       ` Jes Sorensen
2010-02-08 10:31         ` [Qemu-devel] " Jes Sorensen
2010-02-14  3:16         ` Kevin O'Connor
2010-02-14  3:16           ` [Qemu-devel] " Kevin O'Connor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B5DCC53.508@redhat.com \
    --to=jes.sorensen@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=avi@redhat.com \
    --cc=kevin@koconnor.net \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.