<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/powerpc/include/asm/time.h, branch linux-4.17.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.17.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.17.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2018-03-23T21:43:18Z</updated>
<entry>
<title>Merge branch 'topic/ppc-kvm' into next</title>
<updated>2018-03-23T21:43:18Z</updated>
<author>
<name>Michael Ellerman</name>
</author>
<published>2018-03-23T21:43:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a26cf1c9fe3c2e3b671b490aeb708ea72fb5ac0a'/>
<id>urn:sha1:a26cf1c9fe3c2e3b671b490aeb708ea72fb5ac0a</id>
<content type='text'>
This brings in two series from Paul, one of which touches KVM code and
may need to be merged into the kvm-ppc tree to resolve conflicts.
</content>
</entry>
<entry>
<title>powerpc: Use feature bit for RTC presence rather than timebase presence</title>
<updated>2018-03-23T13:36:45Z</updated>
<author>
<name>Paul Mackerras</name>
</author>
<published>2018-03-19T21:46:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c0d64cf9fefd58831ce2cc81b2683bfff3760f7a'/>
<id>urn:sha1:c0d64cf9fefd58831ce2cc81b2683bfff3760f7a</id>
<content type='text'>
All PowerPC CPUs other than the original PPC601 have a timebase
register rather than the "real-time clock" (RTC) register that the
PPC601 (and the original POWER and POWER2 CPUs) had.  Currently
we have a CPU feature bit to indicate the presence of the timebase,
but it makes more sense to use a bit to indicate the unusual
situation rather than the common situation.  This therefore defines
a CPU_FTR_USE_RTC bit in place of the CPU_FTR_USE_TB bit, and
arranges for it to be set on PPC601 systems.

Signed-off-by: Paul Mackerras &lt;paulus@ozlabs.org&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
<entry>
<title>powerpc: Add missing prototype for time_init()</title>
<updated>2018-03-13T04:50:36Z</updated>
<author>
<name>Mathieu Malaterre</name>
</author>
<published>2018-02-25T17:22:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=848092faa0c7687a99bf465808f7dae5bb5ca6be'/>
<id>urn:sha1:848092faa0c7687a99bf465808f7dae5bb5ca6be</id>
<content type='text'>
The function time_init did not have a prototype defined in the time.h
header. Fix the following warning (treated as error in W=1):

  arch/powerpc/kernel/time.c:1068:13: error: no previous prototype for ‘time_init’

Signed-off-by: Mathieu Malaterre &lt;malat@debian.org&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
<entry>
<title>powerpc: Add missing prototype for hdec_interrupt</title>
<updated>2018-03-13T04:50:35Z</updated>
<author>
<name>Mathieu Malaterre</name>
</author>
<published>2018-02-25T17:22:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8b604faff7d421904ebd1fa65d642f566f4a6648'/>
<id>urn:sha1:8b604faff7d421904ebd1fa65d642f566f4a6648</id>
<content type='text'>
In commit dabe859ec636 ("powerpc: Give hypervisor decrementer interrupts
their own handler") an empty body function was added, but no prototype
was declared. Fix warning (treated as error in W=1):

  arch/powerpc/kernel/time.c:629:6: error: no previous prototype for ‘hdec_interrupt’

Signed-off-by: Mathieu Malaterre &lt;malat@debian.org&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
<entry>
<title>powerpc: Move cpu_has_feature() to a separate file</title>
<updated>2016-08-01T01:15:03Z</updated>
<author>
<name>Kevin Hao</name>
</author>
<published>2016-07-23T09:12:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b92a226e528423b8d249dd09bb450d53361fbfcb'/>
<id>urn:sha1:b92a226e528423b8d249dd09bb450d53361fbfcb</id>
<content type='text'>
We plan to use jump label for cpu_has_feature(). In order to implement
this we need to include the linux/jump_label.h in asm/cputable.h.

Unfortunately if we do that it leads to an include loop. The root of the
problem seems to be that reg.h needs cputable.h (for CPU_FTRs), and then
cputable.h via jump_label.h eventually pulls in hw_irq.h which needs
reg.h (for MSR_EE).

So move cpu_has_feature() to a separate file on its own.

Signed-off-by: Kevin Hao &lt;haokexin@gmail.com&gt;
Signed-off-by: Aneesh Kumar K.V &lt;aneesh.kumar@linux.vnet.ibm.com&gt;
[mpe: Rename to cpu_has_feature.h and flesh out change log]
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
<entry>
<title>powerpc: Remove mfvtb()</title>
<updated>2016-08-01T01:15:03Z</updated>
<author>
<name>Kevin Hao</name>
</author>
<published>2016-07-23T09:12:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=905259e33d0ca0ee8e0d55783c3eef3402df81b7'/>
<id>urn:sha1:905259e33d0ca0ee8e0d55783c3eef3402df81b7</id>
<content type='text'>
This function is only used by get_vtb(). They are almost the same except
the reading from the real register. Move the mfspr() to get_vtb() and
kill the function mfvtb(). With this, we can eliminate the use of
cpu_has_feature() in very core header file like reg.h. This is a
preparation for the use of jump label for cpu_has_feature().

Signed-off-by: Kevin Hao &lt;haokexin@gmail.com&gt;
Signed-off-by: Aneesh Kumar K.V &lt;aneesh.kumar@linux.vnet.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
<entry>
<title>powerpc/timer: Large Decrementer support</title>
<updated>2016-07-05T13:58:53Z</updated>
<author>
<name>Oliver O'Halloran</name>
</author>
<published>2016-07-01T06:20:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=799010244685334b34e674d354a1a71a3a6b6148'/>
<id>urn:sha1:799010244685334b34e674d354a1a71a3a6b6148</id>
<content type='text'>
Power ISAv3 adds a large decrementer (LD) mode which increases the size
of the decrementer register. The size of the enlarged decrementer
register is between 32 and 64 bits with the exact size being dependent
on the implementation. When in LD mode, reads are sign extended to 64
bits and a decrementer exception is raised when the high bit is set (i.e
the value goes below zero). Writes however are truncated to the physical
register width so some care needs to be taken to ensure that the high
bit is not set when reloading the decrementer. This patch adds support
for using the LD inside the host kernel on processors that support it.

When LD mode is supported firmware will supply the ibm,dec-bits property
for CPU nodes to allow the kernel to determine the maximum decrementer
value. Enabling LD mode is a hypervisor privileged operation so the kernel
can only enable it manually when running in hypervisor mode. Guests that
support LD mode can request it using the "ibm,client-architecture-support"
firmware call (not implemented in this patch) or some other platform
specific method. If this property is not supplied then the traditional
decrementer width of 32 bit is assumed and LD mode will not be enabled.

This patch was based on initial work by Jack Miller.

Signed-off-by: Oliver O'Halloran &lt;oohall@gmail.com&gt;
Signed-off-by: Balbir Singh &lt;bsingharora@gmail.com&gt;
Acked-by: Michael Neuling &lt;mikey@neuling.org&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
<entry>
<title>powerpc/8xx: remove special handling of CPU6 errata in set_dec()</title>
<updated>2016-03-11T23:18:03Z</updated>
<author>
<name>Christophe Leroy</name>
</author>
<published>2016-02-09T16:08:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=63e9e1c28fa6fe714364c7817e60dbaed3cec95e'/>
<id>urn:sha1:63e9e1c28fa6fe714364c7817e60dbaed3cec95e</id>
<content type='text'>
CPU6 ERRATA is now handled directly in mtspr(), so we can use the
standard set_dec() fonction in all cases.

Signed-off-by: Christophe Leroy &lt;christophe.leroy@c-s.fr&gt;
Signed-off-by: Scott Wood &lt;oss@buserror.net&gt;
</content>
</entry>
<entry>
<title>powerpc: Remove broken GregorianDay()</title>
<updated>2015-12-16T01:54:04Z</updated>
<author>
<name>Daniel Axtens</name>
</author>
<published>2015-12-15T07:09:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=00b912b0c88e690b1662067497182454357b18b0'/>
<id>urn:sha1:00b912b0c88e690b1662067497182454357b18b0</id>
<content type='text'>
GregorianDay() is supposed to calculate the day of the week
(tm-&gt;tm_wday) for a given day/month/year. In that calcuation it
indexed into an array called MonthOffset using tm-&gt;tm_mon-1. However
tm_mon is zero-based, not one-based, so this is off-by-one. It also
means that every January, GregoiranDay() will access element -1 of
the MonthOffset array.

It also doesn't appear to be a correct algorithm either: see in
contrast kernel/time/timeconv.c's time_to_tm function.

It's been broken forever, which suggests no-one in userland uses
this. It looks like no-one in the kernel uses tm-&gt;tm_wday either
(see e.g. drivers/rtc/rtc-ds1305.c:319).

tm-&gt;tm_wday is conventionally set to -1 when not available in
hardware so we can simply set it to -1 and drop the function.
(There are over a dozen other drivers in drivers/rtc that do
this.)

Found using UBSAN.

Cc: Andrey Ryabinin &lt;aryabinin@virtuozzo.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt; # as an example of what UBSan finds.
Cc: Alessandro Zummo &lt;a.zummo@towertech.it&gt;
Cc: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
Cc: rtc-linux@googlegroups.com
Signed-off-by: Daniel Axtens &lt;dja@axtens.net&gt;
Acked-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
<entry>
<title>KVM: PPC: Book3S HV: Accumulate timing information for real-mode code</title>
<updated>2015-04-21T13:21:31Z</updated>
<author>
<name>Paul Mackerras</name>
</author>
<published>2015-03-28T03:21:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b6c295df3131c6fa25f8f29625ee0609506150ad'/>
<id>urn:sha1:b6c295df3131c6fa25f8f29625ee0609506150ad</id>
<content type='text'>
This reads the timebase at various points in the real-mode guest
entry/exit code and uses that to accumulate total, minimum and
maximum time spent in those parts of the code.  Currently these
times are accumulated per vcpu in 5 parts of the code:

* rm_entry - time taken from the start of kvmppc_hv_entry() until
  just before entering the guest.
* rm_intr - time from when we take a hypervisor interrupt in the
  guest until we either re-enter the guest or decide to exit to the
  host.  This includes time spent handling hcalls in real mode.
* rm_exit - time from when we decide to exit the guest until the
  return from kvmppc_hv_entry().
* guest - time spend in the guest
* cede - time spent napping in real mode due to an H_CEDE hcall
  while other threads in the same vcore are active.

These times are exposed in debugfs in a directory per vcpu that
contains a file called "timings".  This file contains one line for
each of the 5 timings above, with the name followed by a colon and
4 numbers, which are the count (number of times the code has been
executed), the total time, the minimum time, and the maximum time,
all in nanoseconds.

The overhead of the extra code amounts to about 30ns for an hcall that
is handled in real mode (e.g. H_SET_DABR), which is about 25%.  Since
production environments may not wish to incur this overhead, the new
code is conditional on a new config symbol,
CONFIG_KVM_BOOK3S_HV_EXIT_TIMING.

Signed-off-by: Paul Mackerras &lt;paulus@samba.org&gt;
Signed-off-by: Alexander Graf &lt;agraf@suse.de&gt;
</content>
</entry>
</feed>
