From patchwork Thu Jan 4 19:33:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Christopherson X-Patchwork-Id: 185133 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp5824510dyb; Thu, 4 Jan 2024 11:36:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IHA1x3iUu6cIy23tQNrWfgH9fUFmXdiX1N5cAPaaj6geyFqtzIBjPg3fOvJJI+d0GB+r/O5 X-Received: by 2002:a05:622a:1b06:b0:429:7363:e50a with SMTP id bb6-20020a05622a1b0600b004297363e50amr688321qtb.4.1704396972964; Thu, 04 Jan 2024 11:36:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704396972; cv=none; d=google.com; s=arc-20160816; b=MMSZv9uaF8DWeUEkgbhBh97WqoIVvzMDDRgTLU9YQvrevWRMi/bjGvLTZKE0dwCipq hRET6yEtkEDICVGp92SX6eyyzQJgDTiEVs5Dgd7Dt1o0NlcX7x7uuIEC/prqpe1lD03m dZec4HZHDphdwVbgY5OPRG6zbpysxQYVmRRRKbpoUZtznpB7bhlJ9WdWeSpiaN7vt9rU oviHcXQITljAaCCyhTPQ7V7pNiKm2qoUJ6wDqb6YL+Nk6Roi8Ca2oMyLBvbnPOiknfa3 9uLOYw0s6sncXyLfi/PhkmuvVhDjOyTFqumuqF+c3w+/eCWW1VfGCge96+VKLd4uer1P Sm/A== ARC-Message-Signature: i=1; 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=CN9HeZvjoKV2Wbxa5HUcERhzb0PDW7VNeTNnQhNqYY4=; fh=dogxdQWc7Q2U5Ekp9F18wEHwMgE3kRwQ/60KgTj3654=; b=hKBIYBJbIcjMVB77Z48FtrayIyTbh8EeozFUsaFa/yCuPrIjuTsD7xxLJIRh5Ldu4q fDazc58tIk8uhxVguRkBdgztKLupPPuG4LMs5dtMX0i1D92+REI7442K2Ffr2sYd98M6 OfK3TJxe2dD2iS9u93h5RA8qHaQqf1afwlTCnFjpI500qJLDP+rH11DiaFhIKewVjide QE35Kcs92P9ajTEZcwlBfeUor7xh0Bv1NLiKZErqCyN2VGSt9azEOGvKBYS1NUaWZVCp gua/Hmc7B5ffGDC+B0kS4fVCsOTW8AZP0tRDyhYAbEOCLf2jYEQRYKa775ofF9h8UzT3 atNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=ptYFktOZ; spf=pass (google.com: domain of linux-kernel+bounces-17169-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17169-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id n21-20020a05622a11d500b0042832639b90si167661qtk.401.2024.01.04.11.36.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 11:36:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17169-ouuuleilei=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=ptYFktOZ; spf=pass (google.com: domain of linux-kernel+bounces-17169-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17169-ouuuleilei=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 BEED11C22171 for ; Thu, 4 Jan 2024 19:36:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 476D52E826; Thu, 4 Jan 2024 19:33:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ptYFktOZ" X-Original-To: linux-kernel@vger.kernel.org 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 72E732E40B for ; Thu, 4 Jan 2024 19:33:23 +0000 (UTC) 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-5e20c9c4080so14923497b3.3 for ; Thu, 04 Jan 2024 11:33:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1704396802; x=1705001602; 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=CN9HeZvjoKV2Wbxa5HUcERhzb0PDW7VNeTNnQhNqYY4=; b=ptYFktOZ81SR9eU2hJ+qphSNARh22huNILugdiXABtaA0IADQU+cv81LCFtAjRS8mx NTIYJFZsbntDvn+46Ee6iRusV8W1RabwWXU8Qtzzg26Xm3rXhrzmY2euURhjsS6kXIhV U8FaoCCh7FK4wolJvtK+3mkwSAPrfl3YUMGiuZxT/yq+3rkyeorWGzGL3y+Qpac+uSE8 3JA551Y7KREzM3B1irlYMDainzDCHo/DSqUSz6W5FnBGSCmF77HI5j/ORnQuMZSH7gaU BaBeZa8JBU5BehP9MFi+zjGBlWsGUSBWe3IXutxpAItgzpW/m5VPjIWZcP90RfGAZwqA W5kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704396802; x=1705001602; 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=CN9HeZvjoKV2Wbxa5HUcERhzb0PDW7VNeTNnQhNqYY4=; b=S5P/T3BGush7QLdoDwt5D8M2kRpQwQTY69tfi3GfXQB5clkmqCW4nCZvVt5CAeVpzJ ps/H4cfMSAJ6hkEUj6pCSj2CIYEYVB25xQjPKJw/8OrKoSvHhxH3kKZpf0bL3OwRiruy LQdhiI0HFwZ7PpHiLWsEBlZWxU5/tt31DH/mCy94UjBXC5NoZiLdHBDFv0euvigs1Ivt bJmubbB4P5gavFGZE8Tq17vDvGXgGoyBp+tnEOryorSUbzzXslXgQM5J+NuYkOlaFnXi VWde6VtxSVdrodmlsDQW0pLVayHEDQNqJVsIY1cDV7R3QUMwv3ht4DMw187h2J4Al6VD pBDQ== X-Gm-Message-State: AOJu0YxMJnSk7THiz471gs3cX+FSSjZVoMt5984UBHFMu5kIt11RIR3P kJxcJUenL2Z2bouvKYTDN84fwhRlx22qSIS4sA== X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a25:8512:0:b0:dbd:99af:daba with SMTP id w18-20020a258512000000b00dbd99afdabamr354711ybk.5.1704396802607; Thu, 04 Jan 2024 11:33:22 -0800 (PST) Reply-To: Sean Christopherson Date: Thu, 4 Jan 2024 11:33:03 -0800 In-Reply-To: <20240104193303.3175844-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: <20240104193303.3175844-1-seanjc@google.com> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog Message-ID: <20240104193303.3175844-9-seanjc@google.com> Subject: [GIT PULL] KVM: x86: Xen change for 6.8 From: Sean Christopherson To: Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Sean Christopherson X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787189760039895690 X-GMAIL-MSGID: 1787189760039895690 A single Xen fix (of sorts) to let userspace workaround buggy guests that don't react well to KVM setting the "stable TSC" bit in Xen PV clocks. The following changes since commit e9e60c82fe391d04db55a91c733df4a017c28b2f: selftests/kvm: fix compilation on non-x86_64 platforms (2023-11-21 11:58:25 -0500) are available in the Git repository at: https://github.com/kvm-x86/linux.git tags/kvm-x86-xen-6.8 for you to fetch changes up to 6d72283526090850274d065cd5d60af732cc5fc8: KVM x86/xen: add an override for PVCLOCK_TSC_STABLE_BIT (2023-12-07 15:52:57 -0800) ---------------------------------------------------------------- KVM Xen change for 6.8: To workaround Xen guests that don't expect Xen PV clocks to be marked as being based on a stable TSC, add a Xen config knob to allow userspace to opt out of KVM setting the "TSC stable" bit in Xen PV clocks. Note, the "TSC stable" bit was added to the PVCLOCK ABI by KVM without an ack from Xen, i.e. KVM isn't entirely blameless for the buggy guest behavior. ---------------------------------------------------------------- Paul Durrant (1): KVM x86/xen: add an override for PVCLOCK_TSC_STABLE_BIT Documentation/virt/kvm/api.rst | 6 ++++++ arch/x86/kvm/x86.c | 28 +++++++++++++++++++++++----- arch/x86/kvm/xen.c | 9 ++++++++- include/uapi/linux/kvm.h | 1 + 4 files changed, 38 insertions(+), 6 deletions(-)