From mboxrd@z Thu Jan 1 00:00:00 1970 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 47E254F8A0 for ; Thu, 19 Dec 2024 02:40:58 +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=1734576059; cv=none; b=lri9HKN4pEhWN8Gtghea/4x9VVVZYbt/7M9F/IEIjiXWoY5EcRhJY0xJgi7J19vSBgS0VG97l86NRPGuJ2OcVRfBecMaJnaY+8wfhxjcYoyeVAqAq4BrC82xm2p6kYVUhs5pbzNvdSxgh50l7ZaUNYF/vtOuw5fuHPPuHql3g/I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734576059; c=relaxed/simple; bh=+DcBHZpNNqOm285hoPxcCIysOOvvqtDjFWcnC9l7Hxk=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=VzY3/IstiWQmWZzbvxq5dsWhlrX95zb+x2+Dr9y0quqn4NZS8eizd5lsiQ08ZPdiEfPE5Y8AeRkIowEdEVRpheV/mnWHczeoNevIKRKegybgWpPY0+t02Zdnfu7iOsmQyTTG4mcAamPRzY7qKzRR1rRxjsvjuXBGngeLMID2yWU= 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=PkM2umIm; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="PkM2umIm" Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-2166a1a5cc4so3161975ad.3 for ; Wed, 18 Dec 2024 18:40:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1734576057; x=1735180857; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=3YyWPXzt5cEQ8LbwdPBgR5Uv3TNAW7IqFu7SoMnw0Mo=; b=PkM2umImkPYrGmwVjNA2vNfAEApjJbkZU1P6iZ2+gEu8bLlqIHk7BLoa6UgEWPzyQa 6yELRzgDDTvHM2dz9QhTBAqmnOcj7vtnnA5eyaCOpD1jiMkCE2V7hVV/mEYQkJnWBSRt TU1g1ItgyCr8FhhUaFlzQ4+xnwygCfKo5rjwJzPzwjh7hTa8qnbXE5+8EYjJPHEDchQF gMI2YCRnwCIR+jAJD2pqL/VYbBzkE2EURyXQRSCyHfmTYqEKlF5ojXlHwdujD0i+4m8F ioAgLMFxmbk5qg0yQjMi88EGHwWoBH5LkfdcffZuWvvioswSEN67PMBLF7Swx6guYb+B JmMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734576057; x=1735180857; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3YyWPXzt5cEQ8LbwdPBgR5Uv3TNAW7IqFu7SoMnw0Mo=; b=sIhP3YTsgi7wx+ubDeFsOKQ/ggxb8Oc/wnicA20ilMS0pfS60TvlHpAPdfMWv+K+T9 VCI3y1TTDefwr522lqBRG4ZY0WxCyv9LM8YoNwO8E8sHoT2R4fBA7h5rtkrlu9zTSopT cmK9j0t1RFhbyocBf1dTnetfkd5uhdouIWA4bKx+b/h78Tp5zQiEE48g94zuYH3S2C6Z 9coXH/09xt0C7BkOkzc0avyIIeyvQxmByO39qDsAY/mWXY4xV/84fAFJrGufEHo/NhnU 56ZNysOso5S3aPNKPzD+tN2W2bWDPBkiKu3RSAPSv3WU5BpV2ouNm995Q0A6xqm5ZYFk NElw== X-Forwarded-Encrypted: i=1; AJvYcCX0gXWGyOg3beUJMT+ly9HTEVar15j5x0+NDFuEMwTdndsaCECn8Pp3GndzF30bGFN4j6dwlKoGuPuyrtk=@vger.kernel.org X-Gm-Message-State: AOJu0YwHmr/7U48jdUmRX2LuMj0ZV7ufz4AIEDPLv9yi3ly/o7PGKhZv d0F5Eq34UUf7bQg8KIUpPPo5g7gCAAaxE36EzH7hn/D1y5gXtRPqvmSSfmYmlZYonV1o7VCIKD3 HZQ== X-Google-Smtp-Source: AGHT+IFSqRB/jorPK12xjKa7nxtmU419TCJiC2zX6LV9UiMIGXIuBRRufnwUW0vpp/BvWMaUpKtuGFF6y+8= X-Received: from plqw11.prod.google.com ([2002:a17:902:a70b:b0:216:1ebc:1f93]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:f712:b0:216:59ed:1aa3 with SMTP id d9443c01a7336-218d71030ddmr65136645ad.27.1734576057630; Wed, 18 Dec 2024 18:40:57 -0800 (PST) Date: Wed, 18 Dec 2024 18:40:38 -0800 In-Reply-To: <20241211172952.1477605-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: <20241211172952.1477605-1-seanjc@google.com> X-Mailer: git-send-email 2.47.1.613.gc27f4b7a9f-goog Message-ID: <173457547595.3295170.16244454188182708227.b4-ty@google.com> Subject: Re: [PATCH] KVM: SVM: Allow guest writes to set MSR_AMD64_DE_CFG bits From: Sean Christopherson To: Sean Christopherson , Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Simon Pilkington , Tom Lendacky Content-Type: text/plain; charset="utf-8" On Wed, 11 Dec 2024 09:29:52 -0800, Sean Christopherson wrote: > Drop KVM's arbitrary behavior of making DE_CFG.LFENCE_SERIALIZE read-only > for the guest, as rejecting writes can lead to guest crashes, e.g. Windows > in particular doesn't gracefully handle unexpected #GPs on the WRMSR, and > nothing in the AMD manuals suggests that LFENCE_SERIALIZE is read-only _if > it exists_. > > KVM only allows LFENCE_SERIALIZE to be set, by the guest or host, if the > underlying CPU has X86_FEATURE_LFENCE_RDTSC, i.e. if LFENCE is guaranteed > to be serializing. So if the guest sets LFENCE_SERIALIZE, KVM will provide > the desired/correct behavior without any additional action (the guest's > value is never stuffed into hardware). And having LFENCE be serializing > even when it's not _required_ to be is a-ok from a functional perspective. > > [...] Applied to kvm-x86 fixes, thanks! [1/1] KVM: SVM: Allow guest writes to set MSR_AMD64_DE_CFG bits https://github.com/kvm-x86/linux/commit/2778c9a4687d -- https://github.com/kvm-x86/linux/tree/next