From patchwork Wed Dec 12 01:04:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krish Sadhukhan X-Patchwork-Id: 10725431 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 2F1001751 for ; Wed, 12 Dec 2018 01:29:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2081D2AFBA for ; Wed, 12 Dec 2018 01:29:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 153F32AFDD; Wed, 12 Dec 2018 01:29:13 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY 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 B5D6D2AFBA for ; Wed, 12 Dec 2018 01:29:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726253AbeLLB3J (ORCPT ); Tue, 11 Dec 2018 20:29:09 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:42026 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726201AbeLLB3I (ORCPT ); Tue, 11 Dec 2018 20:29:08 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wBC1J1NN136205; Wed, 12 Dec 2018 01:29:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=7O7qc55yKA/c9GZx1GhUxxGXN9vIG0d3D9C4GwP83LI=; b=z2JQCVQwdwQLgu+yO8Ys9edU6Tyuvm9M5hQD808RGSArHKYYVL8TOoFIyJEtWPcVOxHv J1GSirCnVZ67LZJ0CjiNNPfrRFVNFkzOljKKdvYe23BB7nJIkDS5T0OBfn0mTUp3ydhA XFQujPFX1/Z61HoIhd3ZRuLZD+VG2vr8hrtak5t5KVyavdwsmhsB9I1sGBrwhZbZm93e 1lr0XMO6PwJMqGouDxSvVJGekltuF9mGE2EuTc+mGUm94rnfVKDgRQj7FWJ79IdDXnCl vmaaRECul1MuB10uwtwzqwJNObvtk2r0HWrtYgCwWKwXCh1cvDPW9Dy4udY33/e4KeqN +A== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2p86kqy38n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 Dec 2018 01:29:01 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id wBC1T0lk030317 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 Dec 2018 01:29:01 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id wBC1T0pR001445; Wed, 12 Dec 2018 01:29:00 GMT Received: from ban25x6uut29.us.oracle.com (/10.153.73.29) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 11 Dec 2018 17:29:00 -0800 From: Krish Sadhukhan To: kvm@vger.kernel.org Cc: pbonzini@redhat.com, rkrcmar@redhat.com, jmattson@google.com Subject: [kvm-unit-test v2 3/4] KVM nVMX: test_vmcs_page_values() needs to accept a bit range Date: Tue, 11 Dec 2018 20:04:36 -0500 Message-Id: <20181212010437.11129-4-krish.sadhukhan@oracle.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20181212010437.11129-1-krish.sadhukhan@oracle.com> References: <20181212010437.11129-1-krish.sadhukhan@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9104 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1812120009 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP ... because various addresses need to be tested for various bit ranges. Signed-off-by: Krish Sadhukhan Reviewed-by: Mihai Carabas --- x86/vmx_tests.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c index 3e6babe..b56f870 100644 --- a/x86/vmx_tests.c +++ b/x86/vmx_tests.c @@ -3487,12 +3487,12 @@ static void test_vmcs_addr_values(const char *name, enum Encoding encoding, bool ignored, bool xfail_beyond_mapped_ram, - u64 align) + u64 align, u32 addr_start, u32 addr_end) { unsigned i; u64 orig_val = vmcs_read(encoding); - for (i = 0; i < 64; i++) + for (i = addr_start; i < addr_end; i++) test_vmcs_addr(name, encoding, ignored, xfail_beyond_mapped_ram, 1ul << i, align); @@ -3541,8 +3541,9 @@ static void test_vmcs_addr_reference(u32 control_bit, enum Encoding field, vmcs_write(CPU_EXEC_CTRL0, primary | CPU_SECONDARY); vmcs_write(CPU_EXEC_CTRL1, secondary | control_bit); } + test_vmcs_addr_values(field_name, field, false, - xfail_beyond_mapped_ram, align); + xfail_beyond_mapped_ram, align, 0, 64); report_prefix_pop(); report_prefix_pushf("%s disabled", control_name); @@ -3552,7 +3553,9 @@ static void test_vmcs_addr_reference(u32 control_bit, enum Encoding field, vmcs_write(CPU_EXEC_CTRL0, primary & ~CPU_SECONDARY); vmcs_write(CPU_EXEC_CTRL1, secondary & ~control_bit); } - test_vmcs_addr_values(field_name, field, true, false, align); + + test_vmcs_addr_values(field_name, field, true, false, align, + 0, 64); report_prefix_pop(); vmcs_write(field, page_addr); @@ -3907,7 +3910,7 @@ static void test_posted_intr(void) test_pi_desc_addr(0xc000, true); test_vmcs_addr_values("process-posted interrupts", - POSTED_INTR_DESC_ADDR, false, false); + POSTED_INTR_DESC_ADDR, false, false, PAGE_SIZE, 0, 64); vmcs_write(CPU_EXEC_CTRL0, saved_primary); vmcs_write(CPU_EXEC_CTRL1, saved_secondary);