<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/arm/kvm, branch linux-3.15.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.15.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.15.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2014-04-28T10:21:48Z</updated>
<entry>
<title>arm: KVM: fix possible misalignment of PGDs and bounce page</title>
<updated>2014-04-28T10:21:48Z</updated>
<author>
<name>Mark Salter</name>
</author>
<published>2014-03-28T14:25:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5d4e08c45a6cf8f1ab3c7fa375007635ac569165'/>
<id>urn:sha1:5d4e08c45a6cf8f1ab3c7fa375007635ac569165</id>
<content type='text'>
The kvm/mmu code shared by arm and arm64 uses kalloc() to allocate
a bounce page (if hypervisor init code crosses page boundary) and
hypervisor PGDs. The problem is that kalloc() does not guarantee
the proper alignment. In the case of the bounce page, the page sized
buffer allocated may also cross a page boundary negating the purpose
and leading to a hang during kvm initialization. Likewise the PGDs
allocated may not meet the minimum alignment requirements of the
underlying MMU. This patch uses __get_free_page() to guarantee the
worst case alignment needs of the bounce page and PGDs on both arm
and arm64.

Cc: &lt;stable@vger.kernel.org&gt; # 3.10+
Signed-off-by: Mark Salter &lt;msalter@redhat.com&gt;
Acked-by: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Signed-off-by: Christoffer Dall &lt;christoffer.dall@linaro.org&gt;
</content>
</entry>
<entry>
<title>ARM: KVM: disable KVM in Kconfig on big-endian systems</title>
<updated>2014-04-26T11:20:03Z</updated>
<author>
<name>Will Deacon</name>
</author>
<published>2014-04-25T10:46:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4e4468fac4381b92eb333d94256e7fb8350f3de3'/>
<id>urn:sha1:4e4468fac4381b92eb333d94256e7fb8350f3de3</id>
<content type='text'>
KVM currently crashes and burns on big-endian hosts, so don't allow it
to be selected until we've got that fixed.

Cc: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
Signed-off-by: Christoffer Dall &lt;christoffer.dall@linaro.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'cpu-hotplug-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm</title>
<updated>2014-04-07T21:55:46Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2014-04-07T21:55:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=467a9e1633043810259a7f5368fbcc1e84746137'/>
<id>urn:sha1:467a9e1633043810259a7f5368fbcc1e84746137</id>
<content type='text'>
Pull CPU hotplug notifiers registration fixes from Rafael Wysocki:
 "The purpose of this single series of commits from Srivatsa S Bhat
  (with a small piece from Gautham R Shenoy) touching multiple
  subsystems that use CPU hotplug notifiers is to provide a way to
  register them that will not lead to deadlocks with CPU online/offline
  operations as described in the changelog of commit 93ae4f978ca7f ("CPU
  hotplug: Provide lockless versions of callback registration
  functions").

  The first three commits in the series introduce the API and document
  it and the rest simply goes through the users of CPU hotplug notifiers
  and converts them to using the new method"

* tag 'cpu-hotplug-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (52 commits)
  net/iucv/iucv.c: Fix CPU hotplug callback registration
  net/core/flow.c: Fix CPU hotplug callback registration
  mm, zswap: Fix CPU hotplug callback registration
  mm, vmstat: Fix CPU hotplug callback registration
  profile: Fix CPU hotplug callback registration
  trace, ring-buffer: Fix CPU hotplug callback registration
  xen, balloon: Fix CPU hotplug callback registration
  hwmon, via-cputemp: Fix CPU hotplug callback registration
  hwmon, coretemp: Fix CPU hotplug callback registration
  thermal, x86-pkg-temp: Fix CPU hotplug callback registration
  octeon, watchdog: Fix CPU hotplug callback registration
  oprofile, nmi-timer: Fix CPU hotplug callback registration
  intel-idle: Fix CPU hotplug callback registration
  clocksource, dummy-timer: Fix CPU hotplug callback registration
  drivers/base/topology.c: Fix CPU hotplug callback registration
  acpi-cpufreq: Fix CPU hotplug callback registration
  zsmalloc: Fix CPU hotplug callback registration
  scsi, fcoe: Fix CPU hotplug callback registration
  scsi, bnx2fc: Fix CPU hotplug callback registration
  scsi, bnx2i: Fix CPU hotplug callback registration
  ...
</content>
</entry>
<entry>
<title>arm, kvm: Fix CPU hotplug callback registration</title>
<updated>2014-03-20T12:43:41Z</updated>
<author>
<name>Srivatsa S. Bhat</name>
</author>
<published>2014-03-18T10:23:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8146875de7d47c632921ea8284097a1ff0601ee7'/>
<id>urn:sha1:8146875de7d47c632921ea8284097a1ff0601ee7</id>
<content type='text'>
On 03/15/2014 12:40 AM, Christoffer Dall wrote:
&gt; On Fri, Mar 14, 2014 at 11:13:29AM +0530, Srivatsa S. Bhat wrote:
&gt;&gt; On 03/13/2014 04:51 AM, Christoffer Dall wrote:
&gt;&gt;&gt; On Tue, Mar 11, 2014 at 02:05:38AM +0530, Srivatsa S. Bhat wrote:
&gt;&gt;&gt;&gt; Subsystems that want to register CPU hotplug callbacks, as well as perform
&gt;&gt;&gt;&gt; initialization for the CPUs that are already online, often do it as shown
&gt;&gt;&gt;&gt; below:
&gt;&gt;&gt;&gt;
[...]
&gt;&gt;&gt; Just so we're clear, the existing code was simply racy as not prone to
&gt;&gt;&gt; deadlocks, right?
&gt;&gt;&gt;
&gt;&gt;&gt; This makes it clear that the test above for compatible CPUs can be quite
&gt;&gt;&gt; easily evaded by using CPU hotplug, but we don't really have a good
&gt;&gt;&gt; solution for handling that yet...  Hmmm, grumble grumble, I guess if you
&gt;&gt;&gt; hotplug unsupported CPUs on a KVM/ARM system for now, stuff will break.
&gt;&gt;&gt;
&gt;&gt;
&gt;&gt; In this particular case, there was no deadlock possibility, rather the
&gt;&gt; existing code had insufficient synchronization against CPU hotplug.
&gt;&gt;
&gt;&gt; init_hyp_mode() would invoke cpu_init_hyp_mode() on currently online CPUs
&gt;&gt; using on_each_cpu(). If a CPU came online after this point and before calling
&gt;&gt; register_cpu_notifier(), that CPU would remain uninitialized because this
&gt;&gt; subsystem would miss the hot-online event. This patch fixes this bug and
&gt;&gt; also uses the new synchronization method (instead of get/put_online_cpus())
&gt;&gt; to ensure that we don't deadlock with CPU hotplug.
&gt;&gt;
&gt;
&gt; Yes, that was my conclusion as well.  Thanks for clarifying.  (It could
&gt; be noted in the commit message as well if you should feel so inclined).
&gt;

Please find the patch with updated changelog (and your Ack) below.
(No changes in code).

From: Srivatsa S. Bhat &lt;srivatsa.bhat@linux.vnet.ibm.com&gt;
Subject: [PATCH] arm, kvm: Fix CPU hotplug callback registration

Subsystems that want to register CPU hotplug callbacks, as well as perform
initialization for the CPUs that are already online, often do it as shown
below:

	get_online_cpus();

	for_each_online_cpu(cpu)
		init_cpu(cpu);

	register_cpu_notifier(&amp;foobar_cpu_notifier);

	put_online_cpus();

This is wrong, since it is prone to ABBA deadlocks involving the
cpu_add_remove_lock and the cpu_hotplug.lock (when running concurrently
with CPU hotplug operations).

Instead, the correct and race-free way of performing the callback
registration is:

	cpu_notifier_register_begin();

	for_each_online_cpu(cpu)
		init_cpu(cpu);

	/* Note the use of the double underscored version of the API */
	__register_cpu_notifier(&amp;foobar_cpu_notifier);

	cpu_notifier_register_done();

In the existing arm kvm code, there is no synchronization with CPU hotplug
to avoid missing the hotplug events that might occur after invoking
init_hyp_mode() and before calling register_cpu_notifier(). Fix this bug
and also use the new synchronization method (instead of get/put_online_cpus())
to ensure that we don't deadlock with CPU hotplug.

Cc: Gleb Natapov &lt;gleb@kernel.org&gt;
Cc: Russell King &lt;linux@arm.linux.org.uk&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Acked-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Acked-by: Christoffer Dall &lt;christoffer.dall@linaro.org&gt;
Signed-off-by: Srivatsa S. Bhat &lt;srivatsa.bhat@linux.vnet.ibm.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>ARM: KVM: fix warning in mmu.c</title>
<updated>2014-03-03T01:15:25Z</updated>
<author>
<name>Marc Zyngier</name>
</author>
<published>2014-01-30T17:38:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=56041bf920d2937b7cadcb30cb206f0372eee814'/>
<id>urn:sha1:56041bf920d2937b7cadcb30cb206f0372eee814</id>
<content type='text'>
Compiling with THP enabled leads to the following warning:

arch/arm/kvm/mmu.c: In function ‘unmap_range’:
arch/arm/kvm/mmu.c:177:39: warning: ‘pte’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   if (kvm_pmd_huge(*pmd) || page_empty(pte)) {
                                        ^
Code inspection reveals that these two cases are mutually exclusive,
so GCC is a bit overzealous here. Silence it anyway by initializing
pte to NULL and testing it later on.

Signed-off-by: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Acked-by: Christoffer Dall &lt;christoffer.dall@linaro.org&gt;
</content>
</entry>
<entry>
<title>ARM: KVM: trap VM system registers until MMU and caches are ON</title>
<updated>2014-03-03T01:15:24Z</updated>
<author>
<name>Marc Zyngier</name>
</author>
<published>2014-01-14T18:00:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8034699a42d68043b495c7e0cfafccd920707ec8'/>
<id>urn:sha1:8034699a42d68043b495c7e0cfafccd920707ec8</id>
<content type='text'>
In order to be able to detect the point where the guest enables
its MMU and caches, trap all the VM related system registers.

Once we see the guest enabling both the MMU and the caches, we
can go back to a saner mode of operation, which is to leave these
registers in complete control of the guest.

Signed-off-by: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Acked-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Reviewed-by: Christoffer Dall &lt;christoffer.dall@linaro.org&gt;
</content>
</entry>
<entry>
<title>ARM: KVM: add world-switch for AMAIR{0,1}</title>
<updated>2014-03-03T01:15:24Z</updated>
<author>
<name>Marc Zyngier</name>
</author>
<published>2014-01-22T10:20:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=af20814ee927ed888288d98917a766b4179c4fe0'/>
<id>urn:sha1:af20814ee927ed888288d98917a766b4179c4fe0</id>
<content type='text'>
HCR.TVM traps (among other things) accesses to AMAIR0 and AMAIR1.
In order to minimise the amount of surprise a guest could generate by
trying to access these registers with caches off, add them to the
list of registers we switch/handle.

Signed-off-by: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Reviewed-by: Christoffer Dall &lt;christoffer.dall@linaro.org&gt;
Acked-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
</content>
</entry>
<entry>
<title>ARM: KVM: introduce per-vcpu HYP Configuration Register</title>
<updated>2014-03-03T01:15:23Z</updated>
<author>
<name>Marc Zyngier</name>
</author>
<published>2014-01-22T09:43:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ac30a11e8e92a03dbe236b285c5cbae0bf563141'/>
<id>urn:sha1:ac30a11e8e92a03dbe236b285c5cbae0bf563141</id>
<content type='text'>
So far, KVM/ARM used a fixed HCR configuration per guest, except for
the VI/VF/VA bits to control the interrupt in absence of VGIC.

With the upcoming need to dynamically reconfigure trapping, it becomes
necessary to allow the HCR to be changed on a per-vcpu basis.

The fix here is to mimic what KVM/arm64 already does: a per vcpu HCR
field, initialized at setup time.

Signed-off-by: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Reviewed-by: Christoffer Dall &lt;christoffer.dall@linaro.org&gt;
Acked-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
</content>
</entry>
<entry>
<title>ARM: KVM: fix ordering of 64bit coprocessor accesses</title>
<updated>2014-03-03T01:15:23Z</updated>
<author>
<name>Marc Zyngier</name>
</author>
<published>2014-01-21T18:56:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=547f781378a22b65c2ab468f235c23001b5924da'/>
<id>urn:sha1:547f781378a22b65c2ab468f235c23001b5924da</id>
<content type='text'>
Commit 240e99cbd00a (ARM: KVM: Fix 64-bit coprocessor handling)
added an ordering dependency for the 64bit registers.

The order described is: CRn, CRm, Op1, Op2, 64bit-first.

Unfortunately, the implementation is: CRn, 64bit-first, CRm...

Move the 64bit test to be last in order to match the documentation.

Signed-off-by: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Reviewed-by: Christoffer Dall &lt;christoffer.dall@linaro.org&gt;
Acked-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
</content>
</entry>
<entry>
<title>ARM: KVM: fix handling of trapped 64bit coprocessor accesses</title>
<updated>2014-03-03T01:15:23Z</updated>
<author>
<name>Marc Zyngier</name>
</author>
<published>2014-01-21T18:56:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=46c214dd595381c880794413facadfa07fba5c95'/>
<id>urn:sha1:46c214dd595381c880794413facadfa07fba5c95</id>
<content type='text'>
Commit 240e99cbd00a (ARM: KVM: Fix 64-bit coprocessor handling)
changed the way we match the 64bit coprocessor access from
user space, but didn't update the trap handler for the same
set of registers.

The effect is that a trapped 64bit access is never matched, leading
to a fault being injected into the guest. This went unnoticed as we
didn't really trap any 64bit register so far.

Placing the CRm field of the access into the CRn field of the matching
structure fixes the problem. Also update the debug feature to emit the
expected string in case of failing match.

Signed-off-by: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Reviewed-by: Christoffer Dall &lt;christoffer.dall@linaro.org&gt;
Acked-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
</content>
</entry>
</feed>
