From: Sam Bobroff <sam.bobroff@au1.ibm.com>
To: david@gibson.dropbear.id.au
Cc: anton@au1.ibm.com, mikey@neuling.org, aik@ozlabs.ru,
mpe@ellerman.id.au, agraf@suse.de, qemu-devel@nongnu.org,
paulus@samba.org, qemu-ppc@nongnu.org,
linuxppc-dev@lists.ozlabs.org
Subject: [PATCH 0/3] Rework spapr: Better handling of ibm, pa-features TM bit
Date: Tue, 5 Jul 2016 15:19:21 +1000 [thread overview]
Message-ID: <cover.1467695915.git.sam.bobroff@au1.ibm.com> (raw)
In-Reply-To: <20160608022602.GU9226@voom.fritz.box>
Hi David,
Anton asked me to have a look at this, so here is an attempt at a
re-implementation of his: "spapr: Better handling of ibm, pa-features TM bit"
addressing your comments and those from Paul Mackerras. I've broken the
patch into one to unconditionally disable the HTM bit in pa-features and a
second one to set it conditionally based on a (new) KVM capability. It requires
a small patch to KVM to support the capability, presumably something like this:
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index 02416fe..4a8ddab 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -588,6 +588,9 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
r = 1;
break;
#endif
+ case KVM_CAP_PPC_HTM:
+ r = cpu_has_feature(CPU_FTR_TM);
+ break;
default:
r = 0;
break;
Adding a new capability requires changing linux/kvm.h but I believe we can
avoid incrementing KVM_API_VERSION at this stage since kernels that don't yet
support it will simply return false. However, due to the ambiguity of that
result I've included Anton's initial fallback approach to be used in that case.
Once the API version is incremented (and support for the capability is
guaranteed) the ambiguity would be gone and we should be able to remove the
fallback. As long as that happens before KVM PR supports HTM, this should
address Paul's concern about using the PVINFO capability to discover KVM-HV.
Note: I'm not sure how to handle the change to linux/kvm.h, I've included the
patch here because it's needed to compile, but I suspect it needs to go via the
kernel. Let's see if this part looks good first.
Note also: I've changed TM to HTM where possible in an attempt to be consistent.
Sam Bobroff (3):
spapr: Disable ibm, pa-features HTM bit
Add KVM_CAP_PPC_HTM to linux/kvm.h
spapr: Set ibm, pa-features HTM from KVM_CAP_PPC_HTM
hw/ppc/spapr.c | 3 ++-
linux-headers/linux/kvm.h | 1 +
target-ppc/kvm.c | 27 +++++++++++++++++++++++++++
target-ppc/kvm_ppc.h | 6 ++++++
4 files changed, 36 insertions(+), 1 deletion(-)
--
2.1.0
next prev parent reply other threads:[~2016-07-05 5:19 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-04 6:44 PR KVM and TM issues Anton Blanchard
2016-04-04 7:00 ` Alexey Kardashevskiy
2016-04-04 10:43 ` Anton Blanchard
2016-04-04 11:09 ` [PATCH] spapr: Don't set the TM ibm,pa-features bit in PR KVM mode Anton Blanchard
2016-04-04 11:13 ` [PATCH] spapr: Don't set the TM ibm, pa-features " Alexander Graf
2016-04-30 0:48 ` [PATCH v2] spapr: Don't set the TM ibm,pa-features " Anton Blanchard
2016-05-02 9:36 ` [Qemu-devel] [PATCH v2] spapr: Don't set the TM ibm, pa-features " haris iqbal
2016-05-27 4:52 ` David Gibson
2016-06-07 12:28 ` [PATCH 1/2] Add PowerPC AT_HWCAP2 definitions Anton Blanchard
2016-06-07 12:32 ` [PATCH 2/2] spapr: Better handling of ibm,pa-features TM bit Anton Blanchard
2016-06-08 2:26 ` David Gibson
2016-07-05 5:19 ` Sam Bobroff [this message]
2016-07-05 5:19 ` [PATCH 1/3] spapr: Disable ibm, pa-features HTM bit Sam Bobroff
2016-07-05 5:51 ` David Gibson
2016-07-05 5:19 ` [PATCH 2/3] Add KVM_CAP_PPC_HTM to linux/kvm.h Sam Bobroff
2016-07-05 6:05 ` David Gibson
2016-07-06 4:41 ` Sam Bobroff
2016-07-06 5:09 ` David Gibson
2016-07-05 5:19 ` [PATCH 3/3] spapr: Set ibm, pa-features HTM from KVM_CAP_PPC_HTM Sam Bobroff
2016-07-05 6:52 ` David Gibson
2016-07-06 5:35 ` [PATCH v2 0/3] Rework spapr: Better handling of ibm, pa-features TM bit Sam Bobroff
2016-07-06 5:35 ` [PATCH v2 1/3] spapr: Disable ibm, pa-features HTM bit Sam Bobroff
2016-07-07 4:38 ` David Gibson
2016-07-06 5:35 ` [PATCH v2 2/3] Add KVM_CAP_PPC_HTM to linux/kvm.h Sam Bobroff
2016-07-07 4:38 ` David Gibson
2016-07-06 5:35 ` [PATCH v2 3/3] spapr: Set ibm, pa-features HTM from KVM_CAP_PPC_HTM Sam Bobroff
2016-07-07 4:39 ` David Gibson
2016-06-08 2:19 ` [PATCH 1/2] Add PowerPC AT_HWCAP2 definitions David Gibson
2016-04-05 2:12 ` [PATCH] spapr: Don't set the TM ibm,pa-features bit in PR KVM mode Paul Mackerras
2016-04-05 4:09 ` David Gibson
2016-04-05 7:33 ` Alexey Kardashevskiy
2016-04-04 11:11 ` [PATCH] powerpc: Clear user CPU feature bits if TM is disabled at runtime Anton Blanchard
2016-04-05 0:52 ` David Gibson
2016-04-05 9:35 ` Michael Ellerman
2016-04-05 9:56 ` Benjamin Herrenschmidt
2016-04-05 22:40 ` Michael Ellerman
2016-04-15 2:06 ` [PATCH 1/3] powerpc: scan_features() updates incorrect bits Anton Blanchard
2016-04-15 14:27 ` [1/3] " Michael Ellerman
2016-04-18 4:40 ` Michael Ellerman
2016-04-18 4:16 ` Michael Ellerman
2016-04-18 10:36 ` [PATCH v2 1/3] powerpc: scan_features() updates incorrect bits for REAL_LE Michael Ellerman
2016-04-19 10:09 ` [v2, " Michael Ellerman
2016-04-15 2:07 ` [PATCH 2/3] powerpc: Update cpu_user_features2 in scan_features() Anton Blanchard
2016-04-19 10:09 ` [2/3] " Michael Ellerman
2016-04-15 2:08 ` [PATCH 3/3] powerpc: Update TM user feature bits " Anton Blanchard
2016-04-19 10:09 ` [3/3] " Michael Ellerman
2016-04-04 11:09 ` PR KVM and TM issues Michael Neuling
2016-04-05 7:29 ` Alexey Kardashevskiy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1467695915.git.sam.bobroff@au1.ibm.com \
--to=sam.bobroff@au1.ibm.com \
--cc=agraf@suse.de \
--cc=aik@ozlabs.ru \
--cc=anton@au1.ibm.com \
--cc=david@gibson.dropbear.id.au \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mikey@neuling.org \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).