diff mbox

[26/26] target/s390x: update maximum TCG model to z800

Message ID 20170525210508.4910-27-aurelien@aurel32.net (mailing list archive)
State New, archived
Headers show

Commit Message

Aurelien Jarno May 25, 2017, 9:05 p.m. UTC
Now that the extended-translation facility 2 has been fully implemented,
it's possible to emulated a most a z800 CPU with TCG.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 target/s390x/cpu_models.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Thomas Huth May 29, 2017, 11:31 a.m. UTC | #1
On 25.05.2017 23:05, Aurelien Jarno wrote:
> Now that the extended-translation facility 2 has been fully implemented,
> it's possible to emulated a most a z800 CPU with TCG.
> 
> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
> ---
>  target/s390x/cpu_models.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
> index 8d27363b07..9c4227d2dd 100644
> --- a/target/s390x/cpu_models.c
> +++ b/target/s390x/cpu_models.c
> @@ -670,8 +670,8 @@ static S390CPUModel *get_max_cpu_model(Error **errp)
>      if (kvm_enabled()) {
>          kvm_s390_get_host_cpu_model(&max_model, errp);
>      } else {
> -        /* TCG emulates a z900 */
> -        max_model.def = &s390_cpu_defs[0];
> +        /* TCG emulates at most a z800 */
> +        max_model.def = &s390_cpu_defs[3];

These hard-coded offsets into s390_cpu_defs are kind of ugly ...
Maybe you could use

    max_model.def = s390_find_cpu_def(0x2066, 7, 3, NULL);

instead?

 Thomas
diff mbox

Patch

diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
index 8d27363b07..9c4227d2dd 100644
--- a/target/s390x/cpu_models.c
+++ b/target/s390x/cpu_models.c
@@ -670,8 +670,8 @@  static S390CPUModel *get_max_cpu_model(Error **errp)
     if (kvm_enabled()) {
         kvm_s390_get_host_cpu_model(&max_model, errp);
     } else {
-        /* TCG emulates a z900 */
-        max_model.def = &s390_cpu_defs[0];
+        /* TCG emulates at most a z800 */
+        max_model.def = &s390_cpu_defs[3];
         bitmap_copy(max_model.features, max_model.def->default_feat,
                     S390_FEAT_MAX);
     }