Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2128041rbb; Tue, 27 Feb 2024 11:25:59 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX5j1cOcfxQYHa5KjxchiNdmBF1tdOmMclB3XtkF1nDki5rhSiLfDo/s3wH8snIFHmQOVsbxT5VYDImuS7HtehRHViJuj2hROhCWmWelQ== X-Google-Smtp-Source: AGHT+IFlehMNL3125xq3T7Yp8ZuUtPeE4p+N/YNeJqKUCDNoXlI6W9iDMRzuXumfg3fSBrhBFhQQ X-Received: by 2002:a17:906:454e:b0:a42:fb31:7463 with SMTP id s14-20020a170906454e00b00a42fb317463mr5544424ejq.25.1709061959263; Tue, 27 Feb 2024 11:25:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709061959; cv=pass; d=google.com; s=arc-20160816; b=SKnsfE5sq5Jszfmdpv6eUGjuf0u5TFUVTgbQoycnaFFhT+T04DK2+rvZpOqY+TVRk+ FcqtFTsxgv2+v6P2IR+Su1vXBEm81sQzeZ+IkFBB0gQ6iVECYJvthnp/KdYH8BP7AOA1 Q0qYBzONiz0DyHq0YWUuDtw7YTVga9pZOyd2AW0Jn4rjL/hezD9xOYMf9gUmyRd1RVYx B/wJTfwVkNnvvMEktKEfw03g9VnvZLuAPJIAWTRpYJNZitk7hl+goOeW8KFsY2DQZ5Cf wx12hlRzOJxrwyndIO5oq0HaM2irRchVIW7QgAo1O/Nd5qWzWLiaiLnMwwWQiiadwyUK 1V+w== 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=eqDAfWfzOe3yEn60Ghh6DXq/NTfhJkyT/Z1pYjZx3eU=; fh=hqauCs8whtDlK9pTKGSzew2brWC0XfuQUs6slb6Ofbc=; b=IbL0wm9kRXKMcgnF2LKX8kJ7VyePzaZNZeT8P171lm4KksfLz8dVBFSiD7I/zBnudV M37IgnodDXRKfWE9lJRKic05z529dAkNDRXchjKs3cfrcxZGYvDLPC8aGQBHGJE1D8yP xfX7TJCgsghrSHhTg3OXWUerb8r3dUGHsXgtUB+KovqBtajXvCFrDd1P7sxsnMFTqGGQ oVxu6u9jb7nbztLnI0B//wXrcLi1BNk0JAFH2nYlVggiANMqXTxn777TQDFHDKjodh2o b8bmZ+exHgn2VUtvVlFXSaOWY0ZeP3ge1djivzwrhUwfIvmHTAJ0DAVlnRUmdQ+2ePXL GdNA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=gpXQSge9; 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-83922-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83922-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 k2-20020a1709063fc200b00a439bd105e5si934490ejj.371.2024.02.27.11.25.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 11:25:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83922-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=gpXQSge9; 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-83922-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83922-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 0631F1F21902 for ; Tue, 27 Feb 2024 19:25:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7280252F6D; Tue, 27 Feb 2024 19:24:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="gpXQSge9" Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.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 1E4CA11CBA for ; Tue, 27 Feb 2024 19:24:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709061896; cv=none; b=oG6KiLP8p4ba0L3vzNdwG1iQe0HVc5/pFBZUcmqSRrdn5y8Q5LxchDruI4LKL0Q0fG5UC5rGIL6/01h8H+rb6u4zrKYx5FM1CU9QX7D5JvRCQ3tl7UtjF+OeBalkRiblD6CnRoq1Hg65rwGL8AwrqlNQMPJM7v6IxZQ5lnxtMcA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709061896; c=relaxed/simple; bh=j8KX1tv3Hvz6e7f+fcz1K93KW8sT/QwCilsZwY114+I=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=GqS4TMOigG8ZKawC1aCn9ityO1B+GZptzxplupjBZL2tEIl/HEiI6gs/1gDndcoIwzWh2WWkXHdSAQMXmerbxIZqKlspDYTyoeu9fvs0bNHdeTqvy3ikC2i176qD+/Oi4XnlWjAwjzfOg+6k+mMxa/uRZQP3l1Lc2T/wVHBBt0c= 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=gpXQSge9; arc=none smtp.client-ip=209.85.219.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-yb1-f202.google.com with SMTP id 3f1490d57ef6-dbe9e13775aso6577365276.1 for ; Tue, 27 Feb 2024 11:24:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709061894; x=1709666694; 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=eqDAfWfzOe3yEn60Ghh6DXq/NTfhJkyT/Z1pYjZx3eU=; b=gpXQSge99fsqylvMrrOgCKN39Usfhqgp3O2VDySTac53BMm9ly8ZsJyFCXCO9GQo1M upF5Q6MMdzqHuex9lm6kDLv9QefIaRsXU0PrL/o8yCxprzDT4FJs+GTkh2Sub5raY2j4 2zHXeDyas6IWo1rO6TvBLEMqqk/cVBZVo/Wr1L9qYGO2kzOk1Tx7x4EWwTfMUq0N+w45 WIqCaKbv3xqxWbqYXRS69pThGkYYt5lcRIYrXYS5LwVp8znd7utut8cjkpwyJ0UwwVm3 56LmstAr/8X9HRfKw7pVdtcpN6EDVf5TPsj1FU6abDtXgTJtoTwLVnqODEGRmQ2grVWW DUxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709061894; x=1709666694; 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=eqDAfWfzOe3yEn60Ghh6DXq/NTfhJkyT/Z1pYjZx3eU=; b=Uugw0DtC6NINLpd5wf1BrrE8tlgD8M2U4tDbJzXLG6LL6SyQuDRsiil4Qa8lSkievf 3Ub1YzidumaEeOkkRZSzWZ0fAElg0DfMJHsbvfEypg5NIdlAbkMyw+gMspT+fMWBAqlG jQ2a2DfBKK2QaAWngq1Q7i2uoHgNGljb1AnxuKUhAFjtr8lOcLzk9Au2ZI2W5zwLSreQ xNTi7auhDvxhQLMGQ2XVuo9iHr/HGhrVT+kOIXIyaHfslWwBJNbsc9U5NjyeE4VXGxCa rOxDZnWkN8z43XvQmBBAfXR9ro9H87uNgAFc88Gaxr8mDtetEXe5fOwk5SWBT+oPbj/H S6Vw== X-Forwarded-Encrypted: i=1; AJvYcCXyYDDYS7yik9/TLfn3FMbJ+6RbOpEYVFR2AqTcPA1AvUFmNr7MVd1LYJ9mZysCBcti9g4TQE8B/626yLnBrA7jo6J1MmrsL/MGsI+t X-Gm-Message-State: AOJu0Ywcu3INktOSsxc4Vh/lA68pYo8t2EXp216AmAd79FMCbvJ1D49d Ga1VJuhecG5Kc5ZRPTUjfTy1ScABmUHKfJvXinOuD4W1DgrVBnc/dRYbX9mJAfdBN1gm/7e5evJ qnA== X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:6902:18d5:b0:dc2:4ab7:3d89 with SMTP id ck21-20020a05690218d500b00dc24ab73d89mr23699ybb.1.1709061894137; Tue, 27 Feb 2024 11:24:54 -0800 (PST) Reply-To: Sean Christopherson Date: Tue, 27 Feb 2024 11:24:51 -0800 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.44.0.278.ge034bb2e1d-goog Message-ID: <20240227192451.3792233-1-seanjc@google.com> Subject: [GIT PULL] KVM: x86: SVM changes for 6.9 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 single series that allows KVM to play nice with systems that have all ASIDs binned to SEV-ES+ guests, which makes SEV unusuable despite being enabled. This is the main source of conflicts between kvm/next and your "allow customizing VMSA features". guest_memfd_fixes also has a minor conflict in kvm_is_vm_type_supported(), but you should already have that pull request for 6.8[1]. There is one more trivial conflict in my "misc" branch, in kvm_vcpu_ioctl_x86_set_debugregs(), but I am going to hold off one sending a pull request for that branch until next week. The main reason is because I screwed up and forgot to push a pile of commits from my local tree to kvm-x86, and sending a pull request for ~3 commits, and then another for the remaining 16 or so commits seemed rather silly. The other reason is that I am hoping we can avoid that conflict entirely, by adding a common choke point in kvm_arch_vcpu_ioctl()[2]. [1] https://lore.kernel.org/all/20240223211547.3348606-1-seanjc@google.com [2] https://lore.kernel.org/all/ZdjL783FazB6V6Cy@google.com The following changes since commit 41bccc98fb7931d63d03f326a746ac4d429c1dd3: Linux 6.8-rc2 (2024-01-28 17:01:12 -0800) are available in the Git repository at: https://github.com/kvm-x86/linux.git tags/kvm-x86-svm-6.9 for you to fetch changes up to fdd58834d132046149699b88a27a0db26829f4fb: KVM: SVM: Return -EINVAL instead of -EBUSY on attempt to re-init SEV/SEV-ES (2024-02-06 11:10:12 -0800) ---------------------------------------------------------------- KVM SVM changes for 6.9: - Add support for systems that are configured with SEV and SEV-ES+ enabled, but have all ASIDs assigned to SEV-ES+ guests, which effectively makes SEV unusuable. Cleanup ASID handling to make supporting this scenario less brittle/ugly. - Return -EINVAL instead of -EBUSY if userspace attempts to invoke KVM_SEV{,ES}_INIT on an SEV+ guest. The operation is simply invalid, and not related to resource contention in any way. ---------------------------------------------------------------- Ashish Kalra (1): KVM: SVM: Add support for allowing zero SEV ASIDs Sean Christopherson (3): KVM: SVM: Set sev->asid in sev_asid_new() instead of overloading the return KVM: SVM: Use unsigned integers when dealing with ASIDs KVM: SVM: Return -EINVAL instead of -EBUSY on attempt to re-init SEV/SEV-ES arch/x86/kvm/svm/sev.c | 58 +++++++++++++++++++++++++++++--------------------- arch/x86/kvm/trace.h | 10 ++++----- 2 files changed, 39 insertions(+), 29 deletions(-)