Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp536145lqr; Wed, 5 Jun 2024 13:12:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXYMnqUjCp6DGCMWiKyy2DLgRV6GtQYWPUyAlAFe2eazPQ1jsTIyn9rklhdziNeDOBDPSzQua1yNTaaNFda8s1tSJinniHPaDXAQp7pzQ== X-Google-Smtp-Source: AGHT+IEyVdsRPfEe9WBnLg8cV28ir+qjiBBHnMQr8OEx1W+Ei2OZB2lqNp1ev1T4sqXl38Waei1H X-Received: by 2002:a9d:6c52:0:b0:6f9:3ed9:cefb with SMTP id 46e09a7af769-6f94345a07emr3640672a34.20.1717618326558; Wed, 05 Jun 2024 13:12:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717618326; cv=pass; d=google.com; s=arc-20160816; b=E1z4IOwMIGKSVG1BeV68Wl3lAa2BHeQ64GffnFdHQn9TN6op9DihsodlaZ7Kt601Md d2dRg6ad6exVZQQ2Kixgi91sMpO/taak9bqs5SzItMJsOcxxjC+lJv12t7wMiYpZEfPY yv0QKXWKtpgUzUEdd9IoYfc31eY6ffV2Ast4Cjq525rQ+fZuodhiiA2f5vmS26D3NqHS M78akPWl6GfRgJxG5G812nvxB83oYlCndKUSUXb1C4PijDG/EbYKCPBkkVcIpPVL3g7g cugAgL6nKKk7RRZcVpJSJGGloeYWW7OAzu9KvFNLVWGm6rEIBWwYIn58dZjMNn44wUs2 7fzg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=oBwUpUZb8gh3eQHfueITt2ZJwiwMmdwZoHaq8+wmWqI=; fh=wR5yyb7xphBY3+ESzHaHWUfpLYYhY05QC3ors7WfH5Q=; b=xUxoSjrQngCbCCIH/vNx3oJRxFXjCqkBJHzHMLdg1fipgFsnOOnu5Tzkg3F/PMD8M8 0c1ywqwfaqT5xMP9hezNJN+44qU1jaG37SJhMaIK3wj/rvONbuzS8DLU7HgBTVIq0PfE z1XzNhq7rrIZ2RY6qecVc9S+zQT36n1eY33CVOt/M7HXWLnrqCoeD5hv+V4gV0ZG1cJf s8dpf+DPdbZqbXCeLqhcDDh4jXQj1SkCBBf81dTfjUmfbMlWbAx3qsmLJZyCAP5Q+D0y oZGLwEsL2XtT7oIPm3ZUVfC/ACM/YzMRCOQF5ZwwHbFFpMlpnUsvQ7slRnYJXKk1dCxn BGRw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=n1I1yfDU; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-203156-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203156-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-794f32a334csi1213276185a.546.2024.06.05.13.12.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 13:12:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203156-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=n1I1yfDU; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-203156-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203156-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 3A5FA1C22866 for ; Wed, 5 Jun 2024 20:12:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 252EB15ECCA; Wed, 5 Jun 2024 20:10:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="n1I1yfDU" Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E9B015DBA3 for ; Wed, 5 Jun 2024 20:10:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717618234; cv=none; b=R2gi0wEXIIS1pA7/CR3CRGsXCJhzL1ECuxhywH0CrQEwLPYqk6aD9NgW6sfGLbPXYd/54kpy7KpDqGlUV2FAYbFnjVXMNYZvat4/IpSmKtIIiTL2LZAOhv2BCEUuofoacdpYOhLn0DdWIVXdwqbn4hb2uBVdWSy/VGTK+JIAKOQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717618234; c=relaxed/simple; bh=P/ULyAJHmdP8+weQdNuK68L1c0m3M09m6gLP50TY3jI=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=trE0Br810JTHzztODRmTNv+QznHwNMlYTnbkVQ6bD8msegiCih6283SyuvbOXsTW/eeiLsw18metaToICOMn/K4Z7iJSBiGDqeDsidh7qpHsrEalGB60Y4NKKqvnjh8eRTezOaaYdVuAe0OUAOarZtKZ9itRhjckImUEPBHUM44= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=n1I1yfDU; arc=none smtp.client-ip=209.85.208.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-lj1-f172.google.com with SMTP id 38308e7fff4ca-2ea8fff1486so1504771fa.1 for ; Wed, 05 Jun 2024 13:10:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717618231; x=1718223031; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=oBwUpUZb8gh3eQHfueITt2ZJwiwMmdwZoHaq8+wmWqI=; b=n1I1yfDUH4Q83CT9Mz5mEaOayMk3+wiUBUyUVgBCcp0CTVUT9LLjJ8Pi8NlKbmCkwA /M2hQCt90b6D1an0J7TzzZLKkrw4FmdDqXsSDF0nHHu4t3pE8ZP4n/wI3bKsN+LrvJJn /HuxkNSoR1TRZuxXMTlSEu3+nz6NDrkEVYwbmBWOKNvEmxzzyILoP+RRuN36f8AqN9ie iox56ERRVaY+S1PQCmEdeoi7f020oQoQWTOSUyISaxNATuGXjF0IsWikZR6vTf6ATiz/ WJ+pax09TLhaSoimvkwpc+UtclXcy9/XS577cLSsxm/WQ3pNGTtUd2JvEw9PQnQYybOO dWdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717618231; x=1718223031; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oBwUpUZb8gh3eQHfueITt2ZJwiwMmdwZoHaq8+wmWqI=; b=nM/Ik2riOC7N8NPWXRt4mVcldcMjUmr3+GP6wGBoB5tyQAXPE353khlJt75iyLD8Fy r2PZnWN4NKonq0kgfGefTUItiaxNy0CFf+eJImOw2x5PJb0jlkyTWJ5wxYnjWSVPkIth ccLEvYGIS8YQfHm0n3RqxUehoPpmhp62wrg+csU99Bu1NDcHOwM2nLhiRl+o74majWuE g1ccKnUBYnyjd0OlLuQzbq6+oTcXDjchiDiOVhO3zzxfnRdr+VLcCICvNHPMk0bUEgwU Bd6iY8taX5ExKUOjsbQArEZiZ2dgwt1t+B/pT0uG4vwzR6H+S29hx5yHCYMoXw6qhkXR xWNg== X-Forwarded-Encrypted: i=1; AJvYcCXxDp/gfV4wNs94wsdWdqJ3Qdjm8xv+XvobnsrOEhJJEad02h1iX5o+IsbO3jxz7gbVxzNd+8HpgUnjrDhcUZc0ZoRSROUZeg/0Cx2L X-Gm-Message-State: AOJu0YyaqALvDccPKpW0Y5a8cJWND3Ihv1D5dI+FVXMfgwdIvP7FkBNY XtHXAVqX5mi6cUOFzxqm5kq7ZQNs4LRvoZmyATHD7NYwp5LvZMAZeCL72JxTFzHzdrveqjoItbp v24hpNFg1pXuIDE7TFyHjmXimlyGdPFksO6Ac X-Received: by 2002:a2e:908e:0:b0:2e2:59c7:a922 with SMTP id 38308e7fff4ca-2ead00b9e81mr1751531fa.15.1717618230256; Wed, 05 Jun 2024 13:10:30 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231212204647.2170650-1-sagis@google.com> In-Reply-To: From: Sagi Shahar Date: Wed, 5 Jun 2024 15:10:18 -0500 Message-ID: Subject: Re: [RFC PATCH v5 00/29] TDX KVM selftests To: "Verma, Vishal L" Cc: "ackerleytng@google.com" , "linux-kselftest@vger.kernel.org" , "Aktas, Erdem" , "Afranji, Ryan" , "Yamahata, Isaku" , "jmattson@google.com" , "pgonda@google.com" , "seanjc@google.com" , "runanwang@google.com" , "kvm@vger.kernel.org" , "Annapurve, Vishal" , "chao.p.peng@linux.intel.com" , "shuah@kernel.org" , "vipinsh@google.com" , "Xu, Haibo1" , "pbonzini@redhat.com" , "linux-kernel@vger.kernel.org" , "dmatlack@google.com" , "linux-mm@kvack.org" , "Edgecombe, Rick P" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Jun 5, 2024 at 1:38=E2=80=AFPM Verma, Vishal L wrote: > > On Tue, 2023-12-12 at 12:46 -0800, Sagi Shahar wrote: > > Hello, > > > > This is v4 of the patch series for TDX selftests. > > > > It has been updated for Intel=E2=80=99s v17 of the TDX host patches whi= ch was > > proposed here: > > https://lore.kernel.org/all/cover.1699368322.git.isaku.yamahata@intel.c= om/ > > > > The tree can be found at: > > https://github.com/googleprodkernel/linux-cc/tree/tdx-selftests-rfc-v5 > > Hello, > > I wanted to check if there were any plans from Google to refresh this > series for the current TDX patches and the kvm-coco-queue baseline? > I'm going to work on it soon and was planning on using Isaku's V19 of the TDX host patches > I'm setting up a CI system that the team is using to test updates to > the different TDX patch series, and it currently runs the KVM Unit > tests, and kvm selftests, and we'd like to be able to add these three > new TDX tests to that as well. > > I tried to take a quick shot at rebasing it, but ran into several > conflicts since kvm-coco-queue has in the meantime made changes e.g. in > tools/testing/selftests/kvm/lib/x86_64/processor.c vcpu_setup(). > > If you can help rebase this, Rick's MMU prep series might be a good > baseline to use: > https://lore.kernel.org/all/20240530210714.364118-1-rick.p.edgecombe@inte= l.com/ This patch series only includes the basic TDX MMU changes and is missing a lot of the TDX support. Not sure how this can be used as a baseline without the rest of the TDX patches. Are there other patch series that were posted based on this series which provides the rest of the TDX support? > > This is also available in a tree at: > https://github.com/intel/tdx/tree/tdx_kvm_dev-2024-05-30 > > Thank you, > Vishal > > > > > Changes from RFC v4: > > > > Added patch to propagate KVM_EXIT_MEMORY_FAULT to userspace. > > > > Minor tweaks to align the tests to the new TDX 1.5 spec such as changes > > in the expected values in TDG.VP.INFO. > > > > In RFCv5, TDX selftest code is organized into: > > > > + headers in tools/testing/selftests/kvm/include/x86_64/tdx/ > > + common code in tools/testing/selftests/kvm/lib/x86_64/tdx/ > > + selftests in tools/testing/selftests/kvm/x86_64/tdx_* > > > > Dependencies > > > > + Peter=E2=80=99s patches, which provide functions for the host to allo= cate > > and track protected memory in the guest. > > https://lore.kernel.org/all/20230110175057.715453-1-pgonda@google.com= / > > > > Further work for this patch series/TODOs > > > > + Sean=E2=80=99s comments for the non-confidential UPM selftests patch = series > > at https://lore.kernel.org/lkml/Y8dC8WDwEmYixJqt@google.com/T/#u appl= y > > here as well > > + Add ucall support for TDX selftests > > > > I would also like to acknowledge the following people, who helped > > review or test patches in previous versions: > > > > + Sean Christopherson > > + Zhenzhong Duan > > + Peter Gonda > > + Andrew Jones > > + Maxim Levitsky > > + Xiaoyao Li > > + David Matlack > > + Marc Orr > > + Isaku Yamahata > > + Maciej S. Szmigiero > > > > Links to earlier patch series > > > > + RFC v1: https://lore.kernel.org/lkml/20210726183816.1343022-1-erdemak= tas@google.com/T/#u > > + RFC v2: https://lore.kernel.org/lkml/20220830222000.709028-1-sagis@go= ogle.com/T/#u > > + RFC v3: https://lore.kernel.org/lkml/20230121001542.2472357-1-ackerle= ytng@google.com/T/#u > > + RFC v4: https://lore.kernel.org/lkml/20230725220132.2310657-1-afranji= @google.com/ > > > > *** BLURB HERE *** > > > > Ackerley Tng (12): > > KVM: selftests: Add function to allow one-to-one GVA to GPA mappings > > KVM: selftests: Expose function that sets up sregs based on VM's mode > > KVM: selftests: Store initial stack address in struct kvm_vcpu > > KVM: selftests: Refactor steps in vCPU descriptor table initializatio= n > > KVM: selftests: TDX: Use KVM_TDX_CAPABILITIES to validate TDs' > > attribute configuration > > KVM: selftests: TDX: Update load_td_memory_region for VM memory backe= d > > by guest memfd > > KVM: selftests: Add functions to allow mapping as shared > > KVM: selftests: Expose _vm_vaddr_alloc > > KVM: selftests: TDX: Add support for TDG.MEM.PAGE.ACCEPT > > KVM: selftests: TDX: Add support for TDG.VP.VEINFO.GET > > KVM: selftests: TDX: Add TDX UPM selftest > > KVM: selftests: TDX: Add TDX UPM selftests for implicit conversion > > > > Erdem Aktas (3): > > KVM: selftests: Add helper functions to create TDX VMs > > KVM: selftests: TDX: Add TDX lifecycle test > > KVM: selftests: TDX: Adding test case for TDX port IO > > > > Roger Wang (1): > > KVM: selftests: TDX: Add TDG.VP.INFO test > > > > Ryan Afranji (2): > > KVM: selftests: TDX: Verify the behavior when host consumes a TD > > private memory > > KVM: selftests: TDX: Add shared memory test > > > > Sagi Shahar (11): > > KVM: selftests: TDX: Add report_fatal_error test > > KVM: selftests: TDX: Add basic TDX CPUID test > > KVM: selftests: TDX: Add basic get_td_vmcall_info test > > KVM: selftests: TDX: Add TDX IO writes test > > KVM: selftests: TDX: Add TDX IO reads test > > KVM: selftests: TDX: Add TDX MSR read/write tests > > KVM: selftests: TDX: Add TDX HLT exit test > > KVM: selftests: TDX: Add TDX MMIO reads test > > KVM: selftests: TDX: Add TDX MMIO writes test > > KVM: selftests: TDX: Add TDX CPUID TDVMCALL test > > KVM: selftests: Propagate KVM_EXIT_MEMORY_FAULT to userspace > > > > tools/testing/selftests/kvm/Makefile | 8 + > > .../selftests/kvm/include/kvm_util_base.h | 30 + > > .../selftests/kvm/include/x86_64/processor.h | 4 + > > .../kvm/include/x86_64/tdx/td_boot.h | 82 + > > .../kvm/include/x86_64/tdx/td_boot_asm.h | 16 + > > .../selftests/kvm/include/x86_64/tdx/tdcall.h | 59 + > > .../selftests/kvm/include/x86_64/tdx/tdx.h | 65 + > > .../kvm/include/x86_64/tdx/tdx_util.h | 19 + > > .../kvm/include/x86_64/tdx/test_util.h | 164 ++ > > tools/testing/selftests/kvm/lib/kvm_util.c | 101 +- > > .../selftests/kvm/lib/x86_64/processor.c | 77 +- > > .../selftests/kvm/lib/x86_64/tdx/td_boot.S | 101 ++ > > .../selftests/kvm/lib/x86_64/tdx/tdcall.S | 158 ++ > > .../selftests/kvm/lib/x86_64/tdx/tdx.c | 262 ++++ > > .../selftests/kvm/lib/x86_64/tdx/tdx_util.c | 558 +++++++ > > .../selftests/kvm/lib/x86_64/tdx/test_util.c | 101 ++ > > .../kvm/x86_64/tdx_shared_mem_test.c | 135 ++ > > .../selftests/kvm/x86_64/tdx_upm_test.c | 469 ++++++ > > .../selftests/kvm/x86_64/tdx_vm_tests.c | 1319 +++++++++++++++++ > > 19 files changed, 3693 insertions(+), 35 deletions(-) > > create mode 100644 tools/testing/selftests/kvm/include/x86_64/tdx/td_b= oot.h > > create mode 100644 tools/testing/selftests/kvm/include/x86_64/tdx/td_b= oot_asm.h > > create mode 100644 tools/testing/selftests/kvm/include/x86_64/tdx/tdca= ll.h > > create mode 100644 tools/testing/selftests/kvm/include/x86_64/tdx/tdx.= h > > create mode 100644 tools/testing/selftests/kvm/include/x86_64/tdx/tdx_= util.h > > create mode 100644 tools/testing/selftests/kvm/include/x86_64/tdx/test= _util.h > > create mode 100644 tools/testing/selftests/kvm/lib/x86_64/tdx/td_boot.= S > > create mode 100644 tools/testing/selftests/kvm/lib/x86_64/tdx/tdcall.S > > create mode 100644 tools/testing/selftests/kvm/lib/x86_64/tdx/tdx.c > > create mode 100644 tools/testing/selftests/kvm/lib/x86_64/tdx/tdx_util= .c > > create mode 100644 tools/testing/selftests/kvm/lib/x86_64/tdx/test_uti= l.c > > create mode 100644 tools/testing/selftests/kvm/x86_64/tdx_shared_mem_t= est.c > > create mode 100644 tools/testing/selftests/kvm/x86_64/tdx_upm_test.c > > create mode 100644 tools/testing/selftests/kvm/x86_64/tdx_vm_tests.c > > >