Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5060594ybl; Tue, 4 Feb 2020 07:02:23 -0800 (PST) X-Google-Smtp-Source: APXvYqySJWl+BKSbtPrZO344AWjuyf8CMd9al4TiYtQTBcGzm2yDiAYwRCXpN0JN+1GMW74M6tis X-Received: by 2002:a54:4707:: with SMTP id k7mr3505975oik.153.1580828543209; Tue, 04 Feb 2020 07:02:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580828543; cv=none; d=google.com; s=arc-20160816; b=DndnDIjfU8E52ge3nxBjZ8ov4DTviPwNMBGqzW7zx3+diparceW0g7oqE5YFy4dpJs eX0t3JnOt3AXm/WvUd8rGRLt1KPlq06MdzbTEr+qh2b/j4viUmfteTHDym6LevJWgUEt qZvOoAV1cRpzg1v8eu/NMJIuHPhESTIGJIl231/D5coly/WXsfHKV5VwR5iv56hzh5+D M4lucDPpK2imLKlYa1HIj49JEn6RC6zFBIpYreEhdbmXaYJluoSeneQpQ5VGX0asXX/C Ff8f1qT07TBBnLvpssYvP1+l+dreabwOIKk+L4xpUzbLsCgu9Sx5iQLdpoBPUnIWC603 KuGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=+Ut4XoP/Hrpe2MidinxPjS+a6EQ5ccTH+FceX9o7das=; b=lzokROfuhaEk3gyu+/js5aRK0or2HhLWcUJhbXr9GRXetQAZ9ORyrHPHkcXn1X8yAU ZDLZdkIaofG60bNUAYJ90yQd7gX5RP2Gc0bkCry+2OdCtKcPRY6SEtSbM6uFTw+HfTxW stBBriQT9V5G4g5iwDYzPhvBOZg3ngsokllWLw4XY7Xk2L0vQ73hibD4FBwbI9rfuDtq oFDoji9r3QILLSq2BGaEnYLhotwtpoTFpMWCH49Hb5nn8eONMxLjdEUo1rJS5S73gjUA 6pV0dI9GmgRlt/Cvw/i2ayGyVqIgw2Wo6iwBK7SKeYlzzx3bR+DGqmypsTlbdyDtSKin cX2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Xozb6KLM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g25si12119588otp.20.2020.02.04.07.02.09; Tue, 04 Feb 2020 07:02:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Xozb6KLM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727347AbgBDPA5 (ORCPT + 99 others); Tue, 4 Feb 2020 10:00:57 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:31549 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727258AbgBDPA5 (ORCPT ); Tue, 4 Feb 2020 10:00:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580828456; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=+Ut4XoP/Hrpe2MidinxPjS+a6EQ5ccTH+FceX9o7das=; b=Xozb6KLMbVX7SWCN3L5maI0ek3U8Ek3fpHTUgBynbg/mJg7gUzxOnhC6pwZRhpFGR4nt+L IB+M7oFJeHCYEda2zHt8dQieZc14imTbPDaoozPQAwPAgBSdgRpTQ8S8zl9etFsrq2PlSI v04/EsV6t84IyPbH1MYxuKLEsz4/Cw4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-393-89EjOiL0NGml79LQGV0gQg-1; Tue, 04 Feb 2020 10:00:52 -0500 X-MC-Unique: 89EjOiL0NGml79LQGV0gQg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 658E518FE866; Tue, 4 Feb 2020 15:00:51 +0000 (UTC) Received: from laptop.redhat.com (ovpn-116-37.ams2.redhat.com [10.36.116.37]) by smtp.corp.redhat.com (Postfix) with ESMTP id D8F2584D90; Tue, 4 Feb 2020 15:00:44 +0000 (UTC) From: Eric Auger To: eric.auger.pro@gmail.com, eric.auger@redhat.com, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, pbonzini@redhat.com, vkuznets@redhat.com Cc: thuth@redhat.com, drjones@redhat.com, wei.huang2@amd.com Subject: [PATCH v3 0/3] selftests: KVM: AMD Nested SVM test infrastructure Date: Tue, 4 Feb 2020 16:00:37 +0100 Message-Id: <20200204150040.2465-1-eric.auger@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add the basic infrastructure needed to test AMD nested SVM. Also add a first basic vmcall test. Best regards Eric This series can be found at: https://github.com/eauger/linux/tree/v5.5-amd-svm-v3 History: v2 -> v3: - Took into account Vitaly's comment: - added "selftests: KVM: Replace get_gdt/idt_base() by get_gdt/idt()" - svm.h now is a copy of arch/x86/include/asm/svm.h - avoid duplicates v1 -> v2: - split into 2 patches - remove the infrastructure to run low-level sub-tests and only keep vmmcall's one. - move struct regs into processor.h - force vmcb_gpa into rax in run_guest() Eric Auger (3): selftests: KVM: Replace get_gdt/idt_base() by get_gdt/idt() selftests: KVM: AMD Nested test infrastructure selftests: KVM: SVM: Add vmcall test tools/testing/selftests/kvm/Makefile | 3 +- .../selftests/kvm/include/x86_64/processor.h | 28 +- .../selftests/kvm/include/x86_64/svm.h | 297 ++++++++++++++++++ .../selftests/kvm/include/x86_64/svm_util.h | 36 +++ tools/testing/selftests/kvm/lib/x86_64/svm.c | 159 ++++++++++ tools/testing/selftests/kvm/lib/x86_64/vmx.c | 6 +- .../selftests/kvm/x86_64/svm_vmcall_test.c | 85 +++++ 7 files changed, 606 insertions(+), 8 deletions(-) create mode 100644 tools/testing/selftests/kvm/include/x86_64/svm.h create mode 100644 tools/testing/selftests/kvm/include/x86_64/svm_util.h create mode 100644 tools/testing/selftests/kvm/lib/x86_64/svm.c create mode 100644 tools/testing/selftests/kvm/x86_64/svm_vmcall_test.c --=20 2.20.1