Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp818658lqo; Fri, 10 May 2024 16:51:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUvqxGssvShxmk0MeC3qCwSLiooCZBLegizhDsEX7tB4E5PZySgQPjgmM2b09MzXnjlvroK38SDpSKPX2Ltv9JbEPGA/r2g/B3baMs3RA== X-Google-Smtp-Source: AGHT+IGTwydsGY53M9gqU+9Hbb44yA/CmW8HUDPzKtQKYar8VZx2JI3AzSoF3/X3wiAz8LWmuV2v X-Received: by 2002:a05:6808:290d:b0:3c9:67a5:3aef with SMTP id 5614622812f47-3c9970cdb0dmr3938685b6e.49.1715385108467; Fri, 10 May 2024 16:51:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715385108; cv=pass; d=google.com; s=arc-20160816; b=hdwiSIs1PieEErneVZaHGIqY1pOm3xw1cURVpFh3hU9ng7yGj0Gb9bybP+xEcA53YZ EWEJR3QUXqsSqsd4Buz3qPBzY4L2AmaBxyhTt5U9JROb7FIZzxaP4y3a15LBc8b17zY7 57+zXIIhOzZ+fBDd6f8ptmVgd7srbeCxRQvdoqRhdL4GZmdoqeWEpOBNgBPY0RnD7NvZ 5/BN4lCDjcM/gZd88rohI183WBOVx0r8FQ9i/BaXvRVLZtNuVYQQnkgyfZ2ckH4df0vw ydohfDC4OhVFzP59WygS5bfXbYQ5cnKy1EL1xs2q2kKTVE8LMmPcNi/YQs8YkYw6vm27 5Ogg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :reply-to:dkim-signature; bh=M+ZTJuFw4tl+MydOHkluBHm1QKEbKgKxZP6rG7WV+iA=; fh=0UrzJ4QZ5GmHnPi8hTzjkQYB7/F6DfFFXe4DrzPeWRA=; b=wlazNIdiq/mVx2Mr3GXi4dHZhn/ygnSaLxhkb8uiv/VoFr4sr1ePLVGkbevU69pPWb l1BHyy7bkAhxS/d/XQGBqfOpGhLh4MzzDXgaiyT6bcvdlnx59NZJEgWo4AnUhqHwA50A OHZmNYQkrlIwQagf1HLyuyYTOGIiwWdCG5K3utcWF77DySPrY4dRRVYHCD+QGw4+GAlh 7rwaMLCxu6Jat3y27nSbLc8mUFrMv/zBP5PSn77t/MqFIKT5f+4nVsLqYtbTfIum3TJ1 Na3fW2ns7rjXYC8xconUmhSOTvg9FwofEjh5Xqy/fO/0ZPEHDwXWMuTvUy612MXM4VBz 6H+Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=nWbJbw9D; 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-176307-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176307-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-792bf30b5efsi464906385a.350.2024.05.10.16.51.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 16:51:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-176307-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=nWbJbw9D; 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-176307-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176307-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 300931C2162E for ; Fri, 10 May 2024 23:51:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 66E6017967E; Fri, 10 May 2024 23:51:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="nWbJbw9D" Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.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 1F0191779BC for ; Fri, 10 May 2024 23:51:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715385064; cv=none; b=W0e6NvYpPtIP+PfSfaZElrsTpOKD39OZjnq8DJbGBoWzHMHBSfktMSfyEiAzp/+iur5AHhq+QQmlYYk5AGrfHAVGg0679lpLbhw3H8yjOk2q+02uVedXirNecby8RsE0QaGeZaO3oBM7Idu1clIrCAOD2ns8Q4DR9xHRPmHU6AA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715385064; c=relaxed/simple; bh=KixVq6DNjnhnxPnJvmKFfyn34jSfKLnUHW1nAJscsSU=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=AFH2rQ29OJUCuH8V9muiVLL9X8eQyS4gxLjb2UiOoBI55vGjApWWDv7furWh8+tRNteHrum/yEH8ju4pQNsJ2kF2OKibPBVMEupp6gilfQobufkiDZqnETUyL4T6OPL8yd1C/Y+GpOF6tYuo5VcSOFMN/PTo1dEmvynb6QAUCq8= 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=nWbJbw9D; arc=none smtp.client-ip=209.85.214.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-pl1-f202.google.com with SMTP id d9443c01a7336-1ed90e91d3cso25099575ad.3 for ; Fri, 10 May 2024 16:51:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1715385062; x=1715989862; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=M+ZTJuFw4tl+MydOHkluBHm1QKEbKgKxZP6rG7WV+iA=; b=nWbJbw9DeB9on/3rJpRuLC4aDRyG/QzF4VckpkHI0BLFQOyVY3BFTrDl+R43EIJN3H S7W35uqpDiJQVxdegc5hd+/JzXW2mS4YG88k81lyX8vBWvyyQIEJmNfgcUj/Efq54gaw upTqnEQcMcl/y+loG3RCukHbVMShIR+t3p1SCEmEFJynBQ46GHnhPtRXtKLbnqM2gk9O 6It/Dr8JL8gTTokKgMn11Jim2TrbA3qssJgsHlaY/lfLadwrNySWWDcSPrNrPr/zMLqd y+A90Hfq9IWgC0ibndH7yQtDkjfIuftUQRNHmOH/2BhB8lVfzsv+25x6LRTgD3Wru7sm zddQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715385062; x=1715989862; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=M+ZTJuFw4tl+MydOHkluBHm1QKEbKgKxZP6rG7WV+iA=; b=BX5moRc1Xg1Mwfge7upZX5rY5HVfdsy6wEPqMdOnHMlZ0FeXB4pohEVodsE80+Cy7Q bHXpy5RslfpZHqc21EbroMgg6T0rrcfx52V7i25WdKjTAaynYzj8zuvbAgBRVtF8t+4w FyG1Izk1Mshi0ssQ04hmudiQ45zmbkKdy4eyGibQcsEzOWgIAAAdZOIgtCiYdaDvh3In 0jktGSyHlaCLMb3hwsSN8fwBYHYXmPR/KcpXN8KOWa08qLw7AL6CVt7snF1Wt2JNDjFa luZ+ApQQkbY2HpE4aZYB2kxTtgv8sKV9sX5HUaOapZ66EN2yBjphT9L6/1ARrrPGJeSK QGRQ== X-Forwarded-Encrypted: i=1; AJvYcCU8yaUiVsIDgEyBj/Md3R94T7pkFbvKVo8ZMdkWsNgyaR8U8AIsBZSRzXHTqteTUxAHwmMcQjP4sz/v0qG/lVBtpC5Z4nFRYhBAoTyD X-Gm-Message-State: AOJu0Yzir0O6KFjpVJX/DHLZIgK2zRGUU1r1rWcEkX6ihpEC2DISAcbQ 2zOy4S6CY15RWgosGkWN8PCmUs8dllpWXgB2tSBpF+nxVRSSAEtt8iqpT20SGgyAT6E7CTY7rHD m4Q== X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:902:ea0d:b0:1db:8ef5:24c1 with SMTP id d9443c01a7336-1ef43d0fcc5mr3404785ad.5.1715385062492; Fri, 10 May 2024 16:51:02 -0700 (PDT) Reply-To: Sean Christopherson Date: Fri, 10 May 2024 16:50:47 -0700 In-Reply-To: <20240510235055.2811352-1-seanjc@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240510235055.2811352-1-seanjc@google.com> X-Mailer: git-send-email 2.45.0.118.g7fe29c98d7-goog Message-ID: <20240510235055.2811352-3-seanjc@google.com> Subject: [GIT PULL] KVM: x86: Misc changes for 6.10 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" The max mappable GPA changes are the most notable, though unless we really botched the KVM implementation, they should be old news for you. The other mildly interesting change is a fix for KVM's handling of userspace writes to immutable feature MSRs. The seemingly good idea of simply ignoring the writes, e.g. to avoid a problematic/useless PMU refresh, neglected to consider the fact that access to the MSR might be disallowed. E.g. the VMX MSRs are off limits if nested support is disabled. The following changes since commit fec50db7033ea478773b159e0e2efb135270e3b7: Linux 6.9-rc3 (2024-04-07 13:22:46 -0700) are available in the Git repository at: https://github.com/kvm-x86/linux.git tags/kvm-x86-misc-6.10 for you to fetch changes up to 51937f2aae186e335175dde78279aaf0cb5e72ae: KVM: x86: Remove VT-d mention in posted interrupt tracepoint (2024-05-02 07:54:14 -0700) ---------------------------------------------------------------- KVM x86 misc changes for 6.10: - Advertise the max mappable GPA in the "guest MAXPHYADDR" CPUID field, which is unused by hardware, so that KVM can communicate its inability to map GPAs that set bits 51:48 due to lack of 5-level paging. Guest firmware is expected to use the information to safely remap BARs in the uppermost GPA space, i.e to avoid placing a BAR at a legal, but unmappable, GPA. - Use vfree() instead of kvfree() for allocations that always use vcalloc() or __vcalloc(). - Don't completely ignore same-value writes to immutable feature MSRs, as doing so results in KVM failing to reject accesses to MSR that aren't supposed to exist given the vCPU model and/or KVM configuration. - Don't mark APICv as being inhibited due to ABSENT if APICv is disabled KVM-wide to avoid confusing debuggers (KVM will never bother clearing the ABSENT inhibit, even if userspace enables in-kernel local APIC). ---------------------------------------------------------------- Alejandro Jimenez (2): KVM: x86: Only set APICV_INHIBIT_REASON_ABSENT if APICv is enabled KVM: x86: Remove VT-d mention in posted interrupt tracepoint Gerd Hoffmann (2): KVM: x86: Don't advertise guest.MAXPHYADDR as host.MAXPHYADDR in CPUID KVM: x86: Advertise max mappable GPA in CPUID.0x80000008.GuestPhysBits Li RongQing (1): KVM: Use vfree for memory allocated by vcalloc()/__vcalloc() Sean Christopherson (1): KVM: x86: Allow, don't ignore, same-value writes to immutable MSRs arch/x86/kvm/cpuid.c | 41 +++++++++++++++++++++++++++++++---------- arch/x86/kvm/mmu.h | 2 ++ arch/x86/kvm/mmu/mmu.c | 5 +++++ arch/x86/kvm/mmu/page_track.c | 2 +- arch/x86/kvm/trace.h | 4 ++-- arch/x86/kvm/x86.c | 28 +++++++++++----------------- virt/kvm/kvm_main.c | 2 +- 7 files changed, 53 insertions(+), 31 deletions(-)