From patchwork Fri Apr 21 00:49:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Matlack X-Patchwork-Id: 9691521 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 846246038D for ; Fri, 21 Apr 2017 00:50:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 76D772847B for ; Fri, 21 Apr 2017 00:50:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6BF562847C; Fri, 21 Apr 2017 00:50:38 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 2A1D028490 for ; Fri, 21 Apr 2017 00:50:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1034037AbdDUAuc (ORCPT ); Thu, 20 Apr 2017 20:50:32 -0400 Received: from mail-io0-f180.google.com ([209.85.223.180]:33235 "EHLO mail-io0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1033580AbdDUAu0 (ORCPT ); Thu, 20 Apr 2017 20:50:26 -0400 Received: by mail-io0-f180.google.com with SMTP id k87so95047729ioi.0 for ; Thu, 20 Apr 2017 17:50:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lEtPacCQ6CmF85a+vg4D9xMTTHeKOMv0hU5glLvegqY=; b=HS1dh51aoz6qZEQ0knXf6MrN3Ik2eK1cZqj/LlA8/DcyiAYkVeT7nk4Sv/SL6lLA/r jXchUEQ15niGFD3EGdeGdJh0XlcbjgttBpdL2X+OctLCwBb5w6rUJHqzs3X7MmTXLcUZ HcSlFYS+QKBV0xzcovpFuZ9sObKYQ8c8nIRTfUeLcGU7qanU373K6+r/aZKaGUNXy4jz l9TF9Prz5FIawYPaY3cf1xD2If4CZdk4E3/oo9glUpaUyM6prHGu7i8RcjVgcHuHEtTG PNwfFqIj2iBckVzBjt0uWNPGfeLAG22VJCUcUih/SO2ztkJIVP4/dxnwSpcwgYFDqDao y9Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=lEtPacCQ6CmF85a+vg4D9xMTTHeKOMv0hU5glLvegqY=; b=myEorFuzBC/3T7rrFHJrHCy7WXdzhBbQrnQB3LaWZ4kQ9V0GUYTrbwK1zushHhwHnL 5ZxIeQMdHcmSuA+R9Ph1NwD7IsuIESx3kZNB5x6r2lIrAqBGuv/hu1o4d/lySH1MRwFx CdUhHyYxxpYWkNXwa3ymh2C0qOAMt++EVLdo2UkIWAAFqGrzzILcwL6KakF7fX52RQFF PKTnPzZVJfuR7sPE9mI926Pn4xxZH8ktRQhBSISzTMqaZVybuQ+uLeW3enXibN9QB6YO Ja0pUTOg8tixnZUTwjIUdJkFwhfz5ZoKL/IhDZvtFsRHTVCYRc6NZ8a7cQI/ZqG1/AMz LrXA== X-Gm-Message-State: AN3rC/7qRT7ydrfLsrctbYaZ6YYV48K6bs1zdfg/JUoeiHYcijYrB+pr PzW4po3GEQ3eDQIH X-Received: by 10.99.6.14 with SMTP id 14mr9641898pgg.83.1492735819660; Thu, 20 Apr 2017 17:50:19 -0700 (PDT) Received: from dmatlack.sea.corp.google.com ([100.100.206.82]) by smtp.gmail.com with ESMTPSA id e13sm12466486pfb.30.2017.04.20.17.50.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Apr 2017 17:50:18 -0700 (PDT) From: David Matlack To: kvm@vger.kernel.org Cc: David Matlack Subject: [kvm-unit-tests PATCH 12/32] x86: test VMPTRLD does not drop VMWRITEs Date: Thu, 20 Apr 2017 17:49:44 -0700 Message-Id: <20170421005004.137260-13-dmatlack@google.com> X-Mailer: git-send-email 2.12.2.816.g2cccc81164-goog In-Reply-To: <20170421005004.137260-1-dmatlack@google.com> References: <20170421005004.137260-1-dmatlack@google.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: David Matlack --- x86/vmx.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/x86/vmx.c b/x86/vmx.c index fd1aa3bc6c2e..9ca37f63b636 100644 --- a/x86/vmx.c +++ b/x86/vmx.c @@ -257,7 +257,7 @@ static bool check_vmcs_field(struct vmcs_field *f, u8 cookie) if (expected == actual) return true; - printf("FAIL: VMWRITE/VMREAD %lx (expected: %lx, actual: %lx)", + printf("FAIL: VMWRITE/VMREAD %lx (expected: %lx, actual: %lx)\n", f->encoding, (unsigned long) expected, (unsigned long) actual); return false; @@ -349,6 +349,11 @@ void test_vmcs_lifecycle(void) VMCLEAR(0); report("current:VMCS1 active:[VCMS1]", check_all_vmcs_fields(1)); + /* VMPTRLD should not erase VMWRITEs to the current VMCS */ + set_all_vmcs_fields(2); + VMPTRLD(1); + report("current:VMCS1 active:[VCMS1]", check_all_vmcs_fields(2)); + for (i = 0; i < ARRAY_SIZE(vmcs); i++) { VMCLEAR(i); free_page(vmcs[i]);