From patchwork Wed Jan 30 07:55:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mammedov X-Patchwork-Id: 1033333 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43qGGM1QD1z9sBn for ; Wed, 30 Jan 2019 19:08:43 +1100 (AEDT) Received: from localhost ([127.0.0.1]:33870 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gokvJ-0002fD-1a for incoming@patchwork.ozlabs.org; Wed, 30 Jan 2019 03:08:41 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52359) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1goku8-0002Cd-63 for qemu-devel@nongnu.org; Wed, 30 Jan 2019 03:07:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gokty-0003qD-Qz for qemu-devel@nongnu.org; Wed, 30 Jan 2019 03:07:21 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44882) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gokty-0003pb-HT; Wed, 30 Jan 2019 03:07:18 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AEB007F416; Wed, 30 Jan 2019 08:07:17 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq.redhat.com (dell-r430-03.lab.eng.brq.redhat.com [10.37.153.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 796E95C21E; Wed, 30 Jan 2019 08:07:12 +0000 (UTC) From: Igor Mammedov To: qemu-devel@nongnu.org Date: Wed, 30 Jan 2019 08:55:06 +0100 Message-Id: <1548834906-133241-1-git-send-email-imammedo@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 30 Jan 2019 08:07:17 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v4] s390x: remove direct reference to mem_path global from s390x code X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: david@redhat.com, cohuck@redhat.com, pasic@linux.ibm.com, borntraeger@de.ibm.com, qemu-s390x@nongnu.org, rth@twiddle.net Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" I plan to deprecate -mem-path option and replace it with memory-backend, for that it's necessary to get rid of mem_path global variable. Do it for s390x case, replacing it with alternative way to enable 1Mb hugepages capability. Todo that replace qemu_mempath_getpagesize() with qemu_getrampagesize() which also checks for -mem-path provided RAM. Signed-off-by: Igor Mammedov Reviewed-by: David Hildenbrand --- v4: * fix typos in commit message * add include "exec/ram_addr.h" to make sure it compiles on ppc host v2: * s/qemu_mempath_getpagesize/qemu_getrampagesiz/ and drop the rest of changes David Hildenbrand --- target/s390x/kvm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index 2ebf26a..8613e19 100644 --- a/target/s390x/kvm.c +++ b/target/s390x/kvm.c @@ -42,6 +42,7 @@ #include "hw/hw.h" #include "sysemu/device_tree.h" #include "exec/gdbstub.h" +#include "exec/ram_addr.h" #include "trace.h" #include "hw/s390x/s390-pci-inst.h" #include "hw/s390x/s390-pci-bus.h" @@ -287,7 +288,7 @@ void kvm_s390_crypto_reset(void) static int kvm_s390_configure_mempath_backing(KVMState *s) { - size_t path_psize = qemu_mempath_getpagesize(mem_path); + size_t path_psize = qemu_getrampagesize(); if (path_psize == 4 * KiB) { return 0; @@ -319,7 +320,7 @@ int kvm_arch_init(MachineState *ms, KVMState *s) { MachineClass *mc = MACHINE_GET_CLASS(ms); - if (mem_path && kvm_s390_configure_mempath_backing(s)) { + if (kvm_s390_configure_mempath_backing(s)) { return -EINVAL; }