Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp1127680lqs; Fri, 14 Jun 2024 16:46:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUVf7RQTk1pheKOYdIeiHEisFUNH9jKO8k7CMvc1TvGyqqdzjpvkx1nIdLlhKR5JnZ7gkgl+WYK5T1owjXupDOSrDFKAGE3POxdFmYRjw== X-Google-Smtp-Source: AGHT+IHunzCaz4KMfwnOWmtLOSkfuplIMB717/Ry6tANebB1RBb3Mn9RRPojpbtHJtX76UdE7Tux X-Received: by 2002:a17:906:2695:b0:a6e:f62d:bd02 with SMTP id a640c23a62f3a-a6f60ced49dmr230870166b.7.1718408791664; Fri, 14 Jun 2024 16:46:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718408791; cv=pass; d=google.com; s=arc-20160816; b=y+VU41ZNad7Bfl/OLax3muoyFMOHNyEkJHP/z1zODPo6mkIiOzTWc2B2Ta0kIbaDh4 AuUWsytJa3NhZTK83nGPecG8CNPDGZPL8tuBuwgzS39awNWdsQ2dOXeTCW6bJERutNL2 DwgcM1p8N26aIDoVh/ebMqXEYQs0UIK/Mz7oL2OyTsrSR3oENXfqutJMm/FIlPFslXjE MUcQe68K48wZRSFooDVtDRXk3BsVHnI/+Sbbb4RrIIf4GMEYFblrBLSAgZPKQhddAxA+ WYi1hqvDxkYFeiSd7tPPP2i54rfPatwWZvu69jZU9xDO51TePsmro7lXKuk7KQWqq2Lt DC0w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:reply-to:dkim-signature; bh=Ihyioj1vM0TB1JZPZzaB/gYRDOE282ffuWXqLcMdCjo=; fh=0TiD/q0dRs++Rqwe3p5GwY4DqFn8zuVNcvRf0Mx8tyA=; b=Ydrh0n/SKaVRKGUmzMSd7j8gEJrPPGqfi7VEmLjtL7meXHuulUlxqNkaF8emiqVjWe K8ZZ3q2ZD1RPbl0+4h7uFgTS551IKz5yjPXGP1yyJNnGAy89DCvkXHncVpkSMSnbnN3h oNYTlYZIWB/VXcLrS2v0Frmc6GMiwx71JdvF4KbR3CqcY+YShfvOnBuLf7Ib7YlzvGQx 2++tVxANs51L7k+/y095FSJ3WaWh57AgT2PdGzfzOe6xlO+S6vCeyMhHCgN1t6MAHS6X LUylGlRATvuDVOGH+5P+h9KIhU8834twQJEKI0qZaKXPsFOIdWLtL7wIVgrhogLgWYRP LJJw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=PQ6Z6dEi; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-215606-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215606-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f56df7877si219938166b.536.2024.06.14.16.46.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 16:46:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-215606-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=PQ6Z6dEi; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-215606-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215606-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 3CE931F222DE for ; Fri, 14 Jun 2024 23:46:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D78F6187578; Fri, 14 Jun 2024 23:46:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="PQ6Z6dEi" Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (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 5DF87757E5 for ; Fri, 14 Jun 2024 23:46:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718408780; cv=none; b=LNWmyvWzlDWnrnNMYUFU5VA6CqlN2pxJbHwGJOBc5Ss0uew3NFq1Jdd320yQDb+h94ViLtU5a1X2TKOekBCykExaWP9+2s6Ko0npS4apA/LwOYwu9feAVMQXA75vGXwG+0uyvxMn0XGLL9/+43o9MS0jwTSgbU2hXMRMpeuqBZA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718408780; c=relaxed/simple; bh=ljJzkXa7ANkHoKsMp4kvwIbmepQnokgR3jDEO1hn3hQ=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=HufhC3ehPeR/e5sBiWL18+rmtWoDiiWkSLSJsmKoh91Kv0QjVg4G8Ed58jBE9hr50csAwlkmx63urvb6qjQUdoEOGsjJ76x9R1npvL8iXqUrStimJy7g7ZKdeeY6SA/cYGkwwsrqRAW4brNyFVxWfWcVjRw9djVvbIY/jaOWVX8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=PQ6Z6dEi; arc=none smtp.client-ip=209.85.128.202 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=flex--seanjc.bounces.google.com Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-632e098ab42so15152377b3.3 for ; Fri, 14 Jun 2024 16:46:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1718408777; x=1719013577; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:reply-to:from:to:cc :subject:date:message-id:reply-to; bh=Ihyioj1vM0TB1JZPZzaB/gYRDOE282ffuWXqLcMdCjo=; b=PQ6Z6dEisAI1gHfIRMbVHL5P1bD2s6e2+xRU1XvxnRkxRZijFCH6UNcKiAeLg7gN5r k6I98ub0lOZO+TDY3q7ZiUOqEW4msB3aD/iyygAKWtIBkSl+gVODeVpOpaY0z6ktau/i k1xP761R8Uf4fQeRPDXgipWFz/0e88+ctejoDg1RyMMNqeHEXHY+ItrVl9Ew4t9aA6zn fGrWQpZJ+AHnNQJDs+CUb8eRGzZbDERzVYZqX5txkPq7sUFjDfWYozwWnBjpVvWoi81Y j5oMFiySDGy84pfecLGrhr/rjCNMEcC2P+PpCt5pXE5RIpgx0Ptq0HYRUCZ6tPOrK4ES EZ0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718408777; x=1719013577; h=cc:to:from:subject:message-id:mime-version:date:reply-to :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Ihyioj1vM0TB1JZPZzaB/gYRDOE282ffuWXqLcMdCjo=; b=Kurt5PTiYq/fQb4AzZQMu1gi5399LaxsYC7sUIf6Zx78fhnX6bSPO5Htu0oDEnU3qB fRE0DV66kI35Ser9owizPf26heZzsAWlKIey1Fl5zsiujIyxnI5fpfvG5kbgCfZHrqnq MXIJkDqBLhPU+J2th1NzmStLvur0LiCEKMIwuJTxxBXHmTinU6mFLmO6csTkDw2oU9Do ShfKzdoPCWsGiMwYBUZMVWfLJWKIN6ILEZlypue55MZv7wRudwSLGp5OpwsL+ss3ZybZ ZlC197zIwgMftvojfc2uBUFNkJKI8TxvgBCa4rnYyi/joZ5ZyY5QbMPeZdAucqP42B6t AUgg== X-Forwarded-Encrypted: i=1; AJvYcCXizt4JPBM7Skj6xi/T/HHWIi2c7sso379GiRJHjhKknPUt4QAAZUaW5zpyYhcnguqpFuyj3lN4gk+P+qtjibws4x68AMCitLMdiVSf X-Gm-Message-State: AOJu0YywCl5wtOMyjqjsCkPlRZZdijo+bGbU8B9WgDhOF6mjfWs7EGxr plFok73Q4L5i5xd+cEY5Cwq0EMxuZQ9y3I5X+93wQZme7OehIBJT74tLMwgJjyAFKp2/98MKCXx 8tg== X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:690c:f8e:b0:62c:c5ea:66ad with SMTP id 00721157ae682-6322255e683mr12725577b3.4.1718408777427; Fri, 14 Jun 2024 16:46:17 -0700 (PDT) Reply-To: Sean Christopherson Date: Fri, 14 Jun 2024 16:46:07 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.45.2.627.g7a2c4fd464-goog Message-ID: <20240614234607.1405974-1-seanjc@google.com> Subject: [kvm-unit-tests GIT PULL] x86: Fixes, cleanups, and new tests From: Sean Christopherson To: Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Sean Christopherson Content-Type: text/plain; charset="UTF-8" Please pull a smattering of x86 changes, most of which have been sitting around on-list for quite some time. There are still quite a few KUT x86 series that want attention, but they are all quite large and exceeded what little review time I have for KUT :-/ Note, the posted interrupt test fails due to KVM bugs, patches posted: https://lore.kernel.org/all/20240607172609.3205077-1-seanjc@google.com The following changes since commit a68956b3fb6f5f308822b20ce0ff8e02db1f7375: gitlab-ci: Always save artifacts (2024-06-05 12:49:58 +0200) are available in the Git repository at: https://github.com/kvm-x86/kvm-unit-tests.git tags/kvm-x86-2024.06.14 for you to fetch changes up to ee1d79c3f0f871bf78f20930cb1a2441f28ac027: nVMX: Verify KVM actually loads the value in HOST_PAT into the PAT MSR (2024-06-11 06:41:23 -0700) ---------------------------------------------------------------- x86 fixes, cleanups, and new testcases: - Add a testcase to verify that KVM doesn't inject a triple fault (or any other "error") if a nested VM is run with an EP4TA pointing MMIO. - Play nice with CR4.CET in test_vmxon_bad_cr() - Force emulation when testing MSR_IA32_FLUSH_CMD to workaround an issue where Skylake CPUs don't follow the architecturally defined behavior, and so that the test doesn't break if/when new bits are supported by future CPUs. - Rework the async #PF test to support IRQ-based page-ready notifications. - Fix a variety of issues related to adaptive PEBS. - Add several nested VMX tests for virtual interrupt delivery and posted interrupts. - Ensure PAT is loaded with the default value after the nVMX PAT tests (failure to do so was causing tests to fail due to all memory being UC). - Misc cleanups. ---------------------------------------------------------------- Alejandro Jimenez (1): x86: vmexit: Allow IPI test to be accelerated by SVM AVIC Dan Wu (1): x86/asyncpf: Update async page fault test for IRQ-based "page ready" Jack Wang (1): x86/msr: Fix typo in output SMR Jim Mattson (1): nVMX: Enable x2APIC mode for virtual-interrupt delivery tests Marc Orr (3): nVMX: test nested "virtual-interrupt delivery" nVMX: test nested EOI virtualization nVMX: add self-IPI tests to vmx_basic_vid_test Mingwei Zhang (3): x86: Add FEP support on read/write register instructions x86: msr: testing MSR_IA32_FLUSH_CMD reserved bits only in KVM emulation x86/pmu: Clear mask in PMI handler to allow delivering subsequent PMIs Oliver Upton (1): nVMX: add test for posted interrupts Sean Christopherson (9): nVMX: Use helpers to check for WB memtype and 4-level EPT support nVMX: Use setup_dummy_ept() to configure EPT for test_ept_eptp() test nVMX: Add a testcase for running L2 with EP4TA that points at MMIO x86/pmu: Enable PEBS on fixed counters iff baseline PEBS is support x86/pmu: Iterate over adaptive PEBS flag combinations x86/pmu: Test adaptive PEBS without any adaptive counters x86/pmu: Add a PEBS test to verify the host LBRs aren't leaked to the guest nVMX: Ensure host's PAT is loaded at the end of all VMX tests nVMX: Verify KVM actually loads the value in HOST_PAT into the PAT MSR Yang Weijiang (3): nVMX: Exclude CR4.CET from the test_vmxon_bad_cr() nVMX: Rename union vmx_basic and related global variable nVMX: Introduce new vmx_basic MSR feature bit for vmx tests lib/x86/apic.h | 5 + lib/x86/asm/bitops.h | 8 + lib/x86/desc.h | 30 +++- lib/x86/pmu.h | 6 +- lib/x86/processor.h | 24 ++- x86/asyncpf.c | 154 ++++++++++------ x86/msr.c | 23 ++- x86/pmu.c | 1 + x86/pmu_pebs.c | 110 +++++++----- x86/unittests.cfg | 19 +- x86/vmx.c | 50 +++--- x86/vmx.h | 7 +- x86/vmx_tests.c | 497 ++++++++++++++++++++++++++++++++++++++++++++++++--- 13 files changed, 755 insertions(+), 179 deletions(-)