From patchwork Mon Dec 16 09:57:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 3352741 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A7E5D9F314 for ; Mon, 16 Dec 2013 09:57:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 844EC20303 for ; Mon, 16 Dec 2013 09:57:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C220020375 for ; Mon, 16 Dec 2013 09:57:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753232Ab3LPJ5q (ORCPT ); Mon, 16 Dec 2013 04:57:46 -0500 Received: from thoth.sbs.de ([192.35.17.2]:34307 "EHLO thoth.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753216Ab3LPJ5o (ORCPT ); Mon, 16 Dec 2013 04:57:44 -0500 Received: from mail1.siemens.de (localhost [127.0.0.1]) by thoth.sbs.de (8.13.6/8.13.6) with ESMTP id rBG9vZ3x002194; Mon, 16 Dec 2013 10:57:35 +0100 Received: from mchn199C.mchp.siemens.de.com ([146.254.78.38]) by mail1.siemens.de (8.14.3/8.14.3) with SMTP id rBG9vTCC007502; Mon, 16 Dec 2013 10:57:34 +0100 From: Jan Kiszka To: Gleb Natapov , Paolo Bonzini Cc: kvm , Arthur Chunqi Li Subject: [PATCH 10/15] VMX: Remove unused return code from setup_ept_range Date: Mon, 16 Dec 2013 10:57:23 +0100 Message-Id: X-Mailer: git-send-email 1.8.1.1.298.ge7eed54 In-Reply-To: References: In-Reply-To: References: Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Jan Kiszka --- x86/vmx.c | 5 ++--- x86/vmx.h | 4 ++-- x86/vmx_tests.c | 16 ++++++---------- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/x86/vmx.c b/x86/vmx.c index 2928e70..f220e13 100644 --- a/x86/vmx.c +++ b/x86/vmx.c @@ -248,8 +248,8 @@ void install_2m_ept(unsigned long *pml4, @map_2m : whether 2M page map is used @perm : permission for every page */ -int setup_ept_range(unsigned long *pml4, unsigned long start, - unsigned long len, int map_1g, int map_2m, u64 perm) +void setup_ept_range(unsigned long *pml4, unsigned long start, + unsigned long len, int map_1g, int map_2m, u64 perm) { u64 phys = start; u64 max = (u64)len + (u64)start; @@ -270,7 +270,6 @@ int setup_ept_range(unsigned long *pml4, unsigned long start, install_ept(pml4, phys, phys, perm); phys += PAGE_SIZE; } - return 0; } /* get_ept_pte : Get the PTE of a given level in EPT, diff --git a/x86/vmx.h b/x86/vmx.h index 9d3b942..bc8c86f 100644 --- a/x86/vmx.h +++ b/x86/vmx.h @@ -558,8 +558,8 @@ void install_2m_ept(unsigned long *pml4, unsigned long phys, unsigned long guest_addr, u64 perm); void install_ept(unsigned long *pml4, unsigned long phys, unsigned long guest_addr, u64 perm); -int setup_ept_range(unsigned long *pml4, unsigned long start, - unsigned long len, int map_1g, int map_2m, u64 perm); +void setup_ept_range(unsigned long *pml4, unsigned long start, + unsigned long len, int map_1g, int map_2m, u64 perm); unsigned long get_ept_pte(unsigned long *pml4, unsigned long guest_addr, int level); int set_ept_pte(unsigned long *pml4, unsigned long guest_addr, diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c index ae6087c..04238ac 100644 --- a/x86/vmx_tests.c +++ b/x86/vmx_tests.c @@ -919,11 +919,8 @@ static int setup_ept() end_of_memory = fwcfg_get_u64(FW_CFG_RAM_SIZE); if (end_of_memory < (1ul << 32)) end_of_memory = (1ul << 32); - if (setup_ept_range(pml4, 0, end_of_memory, - 0, support_2m, EPT_WA | EPT_RA | EPT_EA)) { - printf("\tSet ept tables failed.\n"); - return 1; - } + setup_ept_range(pml4, 0, end_of_memory, 0, support_2m, + EPT_WA | EPT_RA | EPT_EA); return 0; } @@ -956,11 +953,10 @@ static int ept_init() *((u32 *)data_page2) = MAGIC_VAL_2; base_addr1 = (unsigned long)data_page1 & PAGE_MASK_2M; base_addr2 = (unsigned long)data_page2 & PAGE_MASK_2M; - if (setup_ept_range(pml4, base_addr1, base_addr1 + PAGE_SIZE_2M, 0, 0, - EPT_WA | EPT_RA | EPT_EA) || - setup_ept_range(pml4, base_addr2, base_addr2 + PAGE_SIZE_2M, 0, 0, - EPT_WA | EPT_RA | EPT_EA)) - return VMX_TEST_EXIT; + setup_ept_range(pml4, base_addr1, base_addr1 + PAGE_SIZE_2M, 0, 0, + EPT_WA | EPT_RA | EPT_EA); + setup_ept_range(pml4, base_addr2, base_addr2 + PAGE_SIZE_2M, 0, 0, + EPT_WA | EPT_RA | EPT_EA); install_ept(pml4, (unsigned long)data_page1, (unsigned long)data_page2, EPT_RA | EPT_WA | EPT_EA); return VMX_TEST_START;