From patchwork Thu Jan 10 14:20:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Thierry X-Patchwork-Id: 10755919 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 21C8417D2 for ; Thu, 10 Jan 2019 14:21:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 13B0C2994B for ; Thu, 10 Jan 2019 14:21:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 121F529969; Thu, 10 Jan 2019 14:21:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9C4D529952 for ; Thu, 10 Jan 2019 14:21:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728747AbfAJOVC (ORCPT ); Thu, 10 Jan 2019 09:21:02 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:36846 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728725AbfAJOVC (ORCPT ); Thu, 10 Jan 2019 09:21:02 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9D9DB15BE; Thu, 10 Jan 2019 06:21:01 -0800 (PST) Received: from e112298-lin.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 3CF253F5AF; Thu, 10 Jan 2019 06:21:00 -0800 (PST) From: Julien Thierry To: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu Cc: will.deacon@arm.com, Sami.Mujawar@arm.com, Mark.Rutland@arm.com, andre.przywara@arm.com, Julien Thierry Subject: [PATCH kvmtool v2 5/6] kvm: Add arch specific reset Date: Thu, 10 Jan 2019 14:20:45 +0000 Message-Id: <1547130046-14729-6-git-send-email-julien.thierry@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1547130046-14729-1-git-send-email-julien.thierry@arm.com> References: <1547130046-14729-1-git-send-email-julien.thierry@arm.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a callback that allows to set arch specific default values when creating fresh VM. Signed-off-by: Julien Thierry --- arm/kvm.c | 4 ++++ include/kvm/kvm.h | 1 + kvm.c | 2 ++ mips/kvm.c | 4 ++++ powerpc/kvm.c | 4 ++++ x86/kvm.c | 4 ++++ 6 files changed, 19 insertions(+) diff --git a/arm/kvm.c b/arm/kvm.c index d3f8f5d..50faab5 100644 --- a/arm/kvm.c +++ b/arm/kvm.c @@ -57,6 +57,10 @@ void kvm__arch_set_cmdline(char *cmdline, bool video) { } +void kvm__arch_reset(struct kvm *kvm) +{ +} + void kvm__arch_init(struct kvm *kvm, const char *hugetlbfs_path, u64 ram_size) { /* diff --git a/include/kvm/kvm.h b/include/kvm/kvm.h index 1edacfd..eeeb10c 100644 --- a/include/kvm/kvm.h +++ b/include/kvm/kvm.h @@ -136,6 +136,7 @@ int kvm__enumerate_instances(int (*callback)(const char *name, int pid)); void kvm__remove_socket(const char *name); void kvm__arch_set_cmdline(char *cmdline, bool video); +void kvm__arch_reset(struct kvm *kvm); void kvm__arch_init(struct kvm *kvm, const char *hugetlbfs_path, u64 ram_size); void kvm__arch_delete_ram(struct kvm *kvm); int kvm__arch_setup_firmware(struct kvm *kvm); diff --git a/kvm.c b/kvm.c index d5249a0..052c6e8 100644 --- a/kvm.c +++ b/kvm.c @@ -160,6 +160,8 @@ struct kvm *kvm__new(void) kvm->sys_fd = -1; kvm->vm_fd = -1; + kvm__arch_reset(kvm); + return kvm; } diff --git a/mips/kvm.c b/mips/kvm.c index 211770d..3f6fd20 100644 --- a/mips/kvm.c +++ b/mips/kvm.c @@ -56,6 +56,10 @@ void kvm__arch_set_cmdline(char *cmdline, bool video) } +void kvm__arch_reset(struct kvm *kvm) +{ +} + /* Architecture-specific KVM init */ void kvm__arch_init(struct kvm *kvm, const char *hugetlbfs_path, u64 ram_size) { diff --git a/powerpc/kvm.c b/powerpc/kvm.c index 702d67d..5bb721b 100644 --- a/powerpc/kvm.c +++ b/powerpc/kvm.c @@ -87,6 +87,10 @@ void kvm__arch_set_cmdline(char *cmdline, bool video) /* We don't need anything unusual in here. */ } +void kvm__arch_reset(struct kvm *kvm) +{ +} + /* Architecture-specific KVM init */ void kvm__arch_init(struct kvm *kvm, const char *hugetlbfs_path, u64 ram_size) { diff --git a/x86/kvm.c b/x86/kvm.c index 3e0f0b7..e017d36 100644 --- a/x86/kvm.c +++ b/x86/kvm.c @@ -129,6 +129,10 @@ void kvm__arch_set_cmdline(char *cmdline, bool video) strcat(cmdline, " earlyprintk=serial i8042.noaux=1"); } +void kvm__arch_reset(struct kvm *kvm) +{ +} + /* Architecture-specific KVM init */ void kvm__arch_init(struct kvm *kvm, const char *hugetlbfs_path, u64 ram_size) {