From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4B03C6FA81 for ; Mon, 29 Aug 2022 17:10:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231288AbiH2RKy (ORCPT ); Mon, 29 Aug 2022 13:10:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230350AbiH2RKw (ORCPT ); Mon, 29 Aug 2022 13:10:52 -0400 Received: from mail-pg1-x549.google.com (mail-pg1-x549.google.com [IPv6:2607:f8b0:4864:20::549]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 051125466E for ; Mon, 29 Aug 2022 10:10:51 -0700 (PDT) Received: by mail-pg1-x549.google.com with SMTP id c34-20020a631c22000000b0042b6da605d2so4343719pgc.20 for ; Mon, 29 Aug 2022 10:10:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:mime-version:message-id:date:from:to:cc; bh=2fgeUau+fesji7+UbXHLLRDfif1bUVoiY8cL8+NvcF0=; b=m6sZUE2FI2f8PC5MXscjA57qZcILIlnX5dM8oTNtAcyr2CoRmtNGMfmI7X+WMe8xrV IZDsIJ6kuocRikzOL9QC5Kx+ObeOJZE8BxywPDzZ0kl98CUrAFIOkOl9r1r3MKgICRd6 SQ7Zt4oUVrP8ln2bgpWAGe5d/rkVM+pxE7tOdtTFRK5j35NNdX6DVM1ihkYZyOeQhOPR MwLn3Rsk+Hjd1sDm6VHHN6ZNiRITTfvUGh2ucxiw4rqJK4JSVShK/TdzepizJyBfnCxu +yj3vXGfcJJ03qwV4Gm3LgQzhXyizRaMmcJWai96DJtFwTjmX6pn0dN0Vn97uMner9X9 3EGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:mime-version:message-id:date:x-gm-message-state :from:to:cc; bh=2fgeUau+fesji7+UbXHLLRDfif1bUVoiY8cL8+NvcF0=; b=t7K1w1TU6iN7EmFvh0pqeCPxlj4LRz/upWnPcYHoLpiNbYTieRMbCl58DoDaBDGLEl DhW010xhx64NQWdkecLWdhxL7W1JE9dYCmUjGFHxVRkg2UO/eF7KYcBJrXOsZluoZ5Kc cSEMW8pPFjh5XQ/W8wlPsKcSpVnJux6oxFNDSJiNA/ercBbFJpuP3+ziGF/yxpfFC5sM 5gH30JiV9zw9RwAMKbW8It+Unk6dPhHdsh7qgczMLl2IBRDmyRStR/G6KzBNRq+0e5O6 VWAidrBczloXUxfkHMYa31+G2nnKkqe/Ll5omlxHTsk1IweyLunIaSQL6Ob5dCzh4Yd3 WxaA== X-Gm-Message-State: ACgBeo32uhaLKj0bGx1KNwTMjYhKK1XIfIoG2mir2ATHhy1JmsvKADBK BdEHh3OynkS0XEqOHCiz/PkvF2Fshxs= X-Google-Smtp-Source: AA6agR6SCuM1d6i6LVN7Nb7qMG6UiYIsQWlP/qXOAwfNi2xwy8t0Ruc+3Ed9ygkvLJth3FmuUbpkx7EBXJI= X-Received: from pgonda1.kir.corp.google.com ([2620:15c:29:203:cddb:77a7:c55e:a7a2]) (user=pgonda job=sendgmr) by 2002:a63:3c7:0:b0:42b:9220:a3c8 with SMTP id 190-20020a6303c7000000b0042b9220a3c8mr10924499pgd.366.1661793050510; Mon, 29 Aug 2022 10:10:50 -0700 (PDT) Date: Mon, 29 Aug 2022 10:10:13 -0700 Message-Id: <20220829171021.701198-1-pgonda@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.37.2.672.g94769d06f0-goog Subject: [V4 0/8] KVM: selftests: Add simple SEV test From: Peter Gonda To: kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, marcorr@google.com, seanjc@google.com, michael.roth@amd.com, thomas.lendacky@amd.com, joro@8bytes.org, mizhang@google.com, pbonzini@redhat.com, andrew.jones@linux.dev, Peter Gonda Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch series continues the work Michael Roth has done in supporting SEV guests in selftests. It continues on top of the work Sean Christopherson has sent to support ucalls from SEV guests. Along with a very simple version of the SEV selftests Michael originally proposed. V4 * Rebase ontop of seanjc@'s latest Ucall Pool series: https://lore.kernel.org/linux-arm-kernel/20220825232522.3997340-8-seanjc@google.com/ * Fix up review comments from seanjc * Switch authorship on 2 patches because of significant changes, added * Michael as suggested-by or originally-by. V3 * Addressed more of andrew.jones@ in ucall patches. * Fix build in non-x86 archs. V2 * Dropped RFC tag * Correctly separated Sean's ucall patches into 2 as originally intended. * Addressed andrew.jones@ in ucall patches. * Fixed ucall pool usage to work for other archs V1 * https://lore.kernel.org/all/20220715192956.1873315-1-pgonda@google.com/ Michael Roth (5): KVM: selftests: move vm_phy_pages_alloc() earlier in file KVM: selftests: sparsebit: add const where appropriate KVM: selftests: add hooks for managing encrypted guest memory KVM: selftests: handle encryption bits in page tables KVM: selftests: add support for encrypted vm_vaddr_* allocations Peter Gonda (3): KVM: selftests: add library for creating/interacting with SEV guests KVM: selftests: Update ucall pool to allocate from shared memory KVM: selftests: Add simple sev vm testing tools/testing/selftests/kvm/.gitignore | 1 + tools/testing/selftests/kvm/Makefile | 2 + .../selftests/kvm/include/kvm_util_base.h | 23 ++ .../testing/selftests/kvm/include/sparsebit.h | 36 +-- .../selftests/kvm/include/x86_64/sev.h | 47 +++ tools/testing/selftests/kvm/lib/kvm_util.c | 267 +++++++++++++----- tools/testing/selftests/kvm/lib/sparsebit.c | 48 ++-- .../testing/selftests/kvm/lib/ucall_common.c | 2 +- .../selftests/kvm/lib/x86_64/processor.c | 15 +- tools/testing/selftests/kvm/lib/x86_64/sev.c | 232 +++++++++++++++ .../selftests/kvm/x86_64/sev_all_boot_test.c | 127 +++++++++ 11 files changed, 674 insertions(+), 126 deletions(-) create mode 100644 tools/testing/selftests/kvm/include/x86_64/sev.h create mode 100644 tools/testing/selftests/kvm/lib/x86_64/sev.c create mode 100644 tools/testing/selftests/kvm/x86_64/sev_all_boot_test.c -- 2.37.2.672.g94769d06f0-goog