From patchwork Fri Aug 7 09:49:42 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 39840 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n779tth9031466 for ; Fri, 7 Aug 2009 09:55:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757263AbZHGJup (ORCPT ); Fri, 7 Aug 2009 05:50:45 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757201AbZHGJun (ORCPT ); Fri, 7 Aug 2009 05:50:43 -0400 Received: from sg2ehsobe004.messaging.microsoft.com ([207.46.51.78]:6227 "EHLO SG2EHSOBE004.bigfish.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755933AbZHGJuL (ORCPT ); Fri, 7 Aug 2009 05:50:11 -0400 Received: from mail4-sin-R.bigfish.com (10.210.100.246) by SG2EHSOBE004.bigfish.com (10.210.112.24) with Microsoft SMTP Server id 8.1.340.0; Fri, 7 Aug 2009 09:50:08 +0000 Received: from mail4-sin (localhost.localdomain [127.0.0.1]) by mail4-sin-R.bigfish.com (Postfix) with ESMTP id BE3D01A200C6; Fri, 7 Aug 2009 09:50:09 +0000 (UTC) X-SpamScore: 3 X-BigFish: VPS3(zzzz1202hzzz32i203h43j64h) X-Spam-TCS-SCL: 3:0 Received: by mail4-sin (MessageSwitch) id 1249638607310210_29277; Fri, 7 Aug 2009 09:50:07 +0000 (UCT) Received: from svlb1extmailp02.amd.com (unknown [139.95.251.11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail4-sin.bigfish.com (Postfix) with ESMTP id AB6B5DB0052; Fri, 7 Aug 2009 09:50:06 +0000 (UTC) Received: from svlb1twp02.amd.com ([139.95.250.35]) by svlb1extmailp02.amd.com (Switch-3.2.7/Switch-3.2.7) with ESMTP id n779nvVQ012628; Fri, 7 Aug 2009 02:50:00 -0700 X-WSS-ID: 0KO03B8-04-L8A-01 Received: from SSVLEXBH1.amd.com (ssvlexbh1.amd.com [139.95.53.182]) by svlb1twp02.amd.com (Tumbleweed MailGate 3.5.1) with ESMTP id 2D99D1103C2; Fri, 7 Aug 2009 02:49:55 -0700 (PDT) Received: from SSVLEXMB1.amd.com ([139.95.53.181]) by SSVLEXBH1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 7 Aug 2009 02:49:58 -0700 Received: from SF36EXMB1.amd.com ([172.19.4.24]) by SSVLEXMB1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 7 Aug 2009 02:49:57 -0700 Received: from seurexmb1.amd.com ([165.204.9.130]) by SF36EXMB1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 7 Aug 2009 11:49:52 +0200 Received: from lemmy.amd.com ([165.204.15.93]) by seurexmb1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 7 Aug 2009 11:49:51 +0200 Received: by lemmy.amd.com (Postfix, from userid 41430) id D4629C9FF3; Fri, 7 Aug 2009 11:49:50 +0200 (CEST) From: Joerg Roedel To: Avi Kivity CC: Alexander Graf , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Joerg Roedel Subject: [PATCH 15/21] kvm/svm: remove nested_svm_do and helper functions Date: Fri, 7 Aug 2009 11:49:42 +0200 Message-ID: <1249638588-10982-16-git-send-email-joerg.roedel@amd.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1249638588-10982-1-git-send-email-joerg.roedel@amd.com> References: <1249638588-10982-1-git-send-email-joerg.roedel@amd.com> X-OriginalArrivalTime: 07 Aug 2009 09:49:51.0124 (UTC) FILETIME=[6875B540:01CA1744] MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org This function is not longer required. So remove it. Signed-off-by: Joerg Roedel --- arch/x86/kvm/svm.c | 60 ---------------------------------------------------- 1 files changed, 0 insertions(+), 60 deletions(-) diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index c1e3f46..63d2f63 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -1424,66 +1424,6 @@ static void nested_svm_unmap(void *addr, enum km_type idx) kvm_release_page_dirty(page); } -static struct page *nested_svm_get_page(struct vcpu_svm *svm, u64 gpa) -{ - struct page *page; - - down_read(¤t->mm->mmap_sem); - page = gfn_to_page(svm->vcpu.kvm, gpa >> PAGE_SHIFT); - up_read(¤t->mm->mmap_sem); - - if (is_error_page(page)) { - printk(KERN_INFO "%s: could not find page at 0x%llx\n", - __func__, gpa); - kvm_release_page_clean(page); - kvm_inject_gp(&svm->vcpu, 0); - return NULL; - } - return page; -} - -static int nested_svm_do(struct vcpu_svm *svm, - u64 arg1_gpa, u64 arg2_gpa, void *opaque, - int (*handler)(struct vcpu_svm *svm, - void *arg1, - void *arg2, - void *opaque)) -{ - struct page *arg1_page; - struct page *arg2_page = NULL; - void *arg1; - void *arg2 = NULL; - int retval; - - arg1_page = nested_svm_get_page(svm, arg1_gpa); - if(arg1_page == NULL) - return 1; - - if (arg2_gpa) { - arg2_page = nested_svm_get_page(svm, arg2_gpa); - if(arg2_page == NULL) { - kvm_release_page_clean(arg1_page); - return 1; - } - } - - arg1 = kmap_atomic(arg1_page, KM_USER0); - if (arg2_gpa) - arg2 = kmap_atomic(arg2_page, KM_USER1); - - retval = handler(svm, arg1, arg2, opaque); - - kunmap_atomic(arg1, KM_USER0); - if (arg2_gpa) - kunmap_atomic(arg2, KM_USER1); - - kvm_release_page_dirty(arg1_page); - if (arg2_gpa) - kvm_release_page_dirty(arg2_page); - - return retval; -} - static bool nested_svm_exit_handled_msr(struct vcpu_svm *svm) { u32 param = svm->vmcb->control.exit_info_1 & 1;