From: Eric Auger <eric.auger@redhat.com>
To: eric.auger.pro@gmail.com, eric.auger@redhat.com,
qemu-devel@nongnu.org, qemu-arm@nongnu.org,
peter.maydell@linaro.org
Cc: drjones@redhat.com, wei@redhat.com, zhaoshenglong@huawei.com,
lersek@redhat.com, ard.biesheuvel@linaro.org
Subject: [Qemu-devel] [RFC 2/2] hw/arm/virt: Add virt-3.0 machine type
Date: Wed, 23 May 2018 18:03:38 +0200 [thread overview]
Message-ID: <1527091418-11874-3-git-send-email-eric.auger@redhat.com> (raw)
In-Reply-To: <1527091418-11874-1-git-send-email-eric.auger@redhat.com>
Add virt-3.0 machine type.
This machine type supports highmem 256MB ECAM by default.
This feature is disabled for earlier machine types and
if highmem is off.
Signed-off-by: Eric Auger <eric.auger@redhat.com>
---
hw/arm/virt.c | 27 ++++++++++++++++++++++++---
include/hw/arm/virt.h | 1 +
2 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index a35550b..c24c306 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -1520,6 +1520,7 @@ static void virt_set_highmem(Object *obj, bool value, Error **errp)
VirtMachineState *vms = VIRT_MACHINE(obj);
vms->highmem = value;
+ vms->highmem_ecam &= value;
}
static bool virt_get_its(Object *obj, Error **errp)
@@ -1697,7 +1698,7 @@ static void machvirt_machine_init(void)
}
type_init(machvirt_machine_init);
-static void virt_2_12_instance_init(Object *obj)
+static void virt_3_0_instance_init(Object *obj)
{
VirtMachineState *vms = VIRT_MACHINE(obj);
VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms);
@@ -1740,6 +1741,8 @@ static void virt_2_12_instance_init(Object *obj)
"Set GIC version. "
"Valid values are 2, 3 and host", NULL);
+ vms->highmem_ecam = vmc->no_highmem_ecam ? false : true;
+
if (vmc->no_its) {
vms->its = false;
} else {
@@ -1765,10 +1768,28 @@ static void virt_2_12_instance_init(Object *obj)
vms->irqmap = a15irqmap;
}
-static void virt_machine_2_12_options(MachineClass *mc)
+static void virt_machine_3_0_options(MachineClass *mc)
{
}
-DEFINE_VIRT_MACHINE_AS_LATEST(2, 12)
+DEFINE_VIRT_MACHINE_AS_LATEST(3, 0)
+
+#define VIRT_COMPAT_2_12 \
+ HW_COMPAT_2_12
+
+static void virt_2_12_instance_init(Object *obj)
+{
+ virt_3_0_instance_init(obj);
+}
+
+static void virt_machine_2_12_options(MachineClass *mc)
+{
+ VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc));
+
+ virt_machine_3_0_options(mc);
+ SET_MACHINE_COMPAT(mc, VIRT_COMPAT_2_12);
+ vmc->no_highmem_ecam = true;
+}
+DEFINE_VIRT_MACHINE(2, 12)
#define VIRT_COMPAT_2_11 \
HW_COMPAT_2_11
diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h
index e9423a7..10a5c71 100644
--- a/include/hw/arm/virt.h
+++ b/include/hw/arm/virt.h
@@ -95,6 +95,7 @@ typedef struct {
bool no_pmu;
bool claim_edge_triggered_timers;
bool smbios_old_sys_ver;
+ bool no_highmem_ecam;
} VirtMachineClass;
typedef struct {
--
2.5.5
WARNING: multiple messages have this Message-ID (diff)
From: Eric Auger <eric.auger@redhat.com>
To: eric.auger.pro@gmail.com, eric.auger@redhat.com,
qemu-devel@nongnu.org, qemu-arm@nongnu.org,
peter.maydell@linaro.org
Cc: drjones@redhat.com, ard.biesheuvel@linaro.org, lersek@redhat.com,
zhaoshenglong@huawei.com
Subject: [Qemu-arm] [RFC 2/2] hw/arm/virt: Add virt-3.0 machine type
Date: Wed, 23 May 2018 18:03:38 +0200 [thread overview]
Message-ID: <1527091418-11874-3-git-send-email-eric.auger@redhat.com> (raw)
In-Reply-To: <1527091418-11874-1-git-send-email-eric.auger@redhat.com>
Add virt-3.0 machine type.
This machine type supports highmem 256MB ECAM by default.
This feature is disabled for earlier machine types and
if highmem is off.
Signed-off-by: Eric Auger <eric.auger@redhat.com>
---
hw/arm/virt.c | 27 ++++++++++++++++++++++++---
include/hw/arm/virt.h | 1 +
2 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index a35550b..c24c306 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -1520,6 +1520,7 @@ static void virt_set_highmem(Object *obj, bool value, Error **errp)
VirtMachineState *vms = VIRT_MACHINE(obj);
vms->highmem = value;
+ vms->highmem_ecam &= value;
}
static bool virt_get_its(Object *obj, Error **errp)
@@ -1697,7 +1698,7 @@ static void machvirt_machine_init(void)
}
type_init(machvirt_machine_init);
-static void virt_2_12_instance_init(Object *obj)
+static void virt_3_0_instance_init(Object *obj)
{
VirtMachineState *vms = VIRT_MACHINE(obj);
VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms);
@@ -1740,6 +1741,8 @@ static void virt_2_12_instance_init(Object *obj)
"Set GIC version. "
"Valid values are 2, 3 and host", NULL);
+ vms->highmem_ecam = vmc->no_highmem_ecam ? false : true;
+
if (vmc->no_its) {
vms->its = false;
} else {
@@ -1765,10 +1768,28 @@ static void virt_2_12_instance_init(Object *obj)
vms->irqmap = a15irqmap;
}
-static void virt_machine_2_12_options(MachineClass *mc)
+static void virt_machine_3_0_options(MachineClass *mc)
{
}
-DEFINE_VIRT_MACHINE_AS_LATEST(2, 12)
+DEFINE_VIRT_MACHINE_AS_LATEST(3, 0)
+
+#define VIRT_COMPAT_2_12 \
+ HW_COMPAT_2_12
+
+static void virt_2_12_instance_init(Object *obj)
+{
+ virt_3_0_instance_init(obj);
+}
+
+static void virt_machine_2_12_options(MachineClass *mc)
+{
+ VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc));
+
+ virt_machine_3_0_options(mc);
+ SET_MACHINE_COMPAT(mc, VIRT_COMPAT_2_12);
+ vmc->no_highmem_ecam = true;
+}
+DEFINE_VIRT_MACHINE(2, 12)
#define VIRT_COMPAT_2_11 \
HW_COMPAT_2_11
diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h
index e9423a7..10a5c71 100644
--- a/include/hw/arm/virt.h
+++ b/include/hw/arm/virt.h
@@ -95,6 +95,7 @@ typedef struct {
bool no_pmu;
bool claim_edge_triggered_timers;
bool smbios_old_sys_ver;
+ bool no_highmem_ecam;
} VirtMachineClass;
typedef struct {
--
2.5.5
next prev parent reply other threads:[~2018-05-23 16:04 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-23 16:03 [Qemu-devel] [RFC 0/2] ARM virt: Support up to 256 PCIe buses Eric Auger
2018-05-23 16:03 ` [Qemu-arm] " Eric Auger
2018-05-23 16:03 ` [Qemu-devel] [RFC 1/2] hw/arm/virt: Add a new 256MB ECAM region Eric Auger
2018-05-23 16:03 ` [Qemu-arm] " Eric Auger
2018-05-23 16:03 ` Eric Auger [this message]
2018-05-23 16:03 ` [Qemu-arm] [RFC 2/2] hw/arm/virt: Add virt-3.0 machine type Eric Auger
2018-05-23 17:45 ` [Qemu-devel] [RFC 0/2] ARM virt: Support up to 256 PCIe buses Laszlo Ersek
2018-05-23 17:45 ` [Qemu-arm] " Laszlo Ersek
2018-05-23 20:40 ` [Qemu-devel] " Auger Eric
2018-05-23 20:40 ` [Qemu-arm] " Auger Eric
2018-05-23 20:52 ` Laszlo Ersek
2018-05-23 20:52 ` [Qemu-arm] " Laszlo Ersek
2018-05-23 20:55 ` Auger Eric
2018-05-23 20:55 ` [Qemu-arm] " Auger Eric
2018-05-24 9:11 ` Peter Maydell
2018-05-24 9:11 ` [Qemu-arm] " Peter Maydell
2018-05-24 12:59 ` Laszlo Ersek
2018-05-24 12:59 ` [Qemu-arm] " Laszlo Ersek
2018-05-24 13:07 ` Peter Maydell
2018-05-24 13:07 ` [Qemu-arm] " Peter Maydell
2018-05-24 13:10 ` Auger Eric
2018-05-24 13:10 ` [Qemu-arm] " Auger Eric
2018-05-24 13:59 ` Laszlo Ersek
2018-05-24 13:59 ` [Qemu-arm] " Laszlo Ersek
2018-05-24 14:09 ` Auger Eric
2018-05-24 14:09 ` [Qemu-arm] " Auger Eric
2018-05-24 16:58 ` Laszlo Ersek
2018-05-24 16:58 ` [Qemu-arm] " Laszlo Ersek
2018-05-24 14:14 ` Ard Biesheuvel
2018-05-24 14:14 ` [Qemu-arm] " Ard Biesheuvel
2018-05-24 17:20 ` Laszlo Ersek
2018-05-24 17:20 ` [Qemu-arm] " Laszlo Ersek
2018-05-24 19:26 ` Auger Eric
2018-05-24 19:26 ` [Qemu-arm] " Auger Eric
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=1527091418-11874-3-git-send-email-eric.auger@redhat.com \
--to=eric.auger@redhat.com \
--cc=ard.biesheuvel@linaro.org \
--cc=drjones@redhat.com \
--cc=eric.auger.pro@gmail.com \
--cc=lersek@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=wei@redhat.com \
--cc=zhaoshenglong@huawei.com \
/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.