Backport request: include PRD support for OpenPower kernels

Bug #1464560 reported by Jeremy Kerr
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
High
Chris J Arges
Utopic
Invalid
High
Chris J Arges
Vivid
Fix Released
High
Chris J Arges

Bug Description

[Impact]

Following up on patches that were skipped in bug 1439562, this request is for the PRD (Processor Runtime Diagnostics) support in the ppc64le kernel.

[Fix]

For Wily:
1cbb4a1 mtd: powernv: Add powernv flash MTD abstraction driver *
48c0615 powerpc/powernv: Merge common platform device initialisation *
594fcb9 powerpc/powernv: Expose OPAL APIs required by PRD interface *
0d7cd85 powerpc/powernv: Add opal-prd channel *
7185795 powerpc/powernv: fix construction of opal PRD messages *
cdf2bc1 powerpc/include: Add opal-prd to installed uapi headers *
d8ea782 powerpc/powernv: Fix vma page prot flags in opal-prd driver *

For Vivid:
d800ba1 powerpc/powernv: Move OPAL API definitions to opal-api.h
d7cf83f powerpc/powernv: Move opal-api.h closer to the Skiboot version
ed59190 powerpc/powernv: Add interfaces for flash device access
1cbb4a1 mtd: powernv: Add powernv flash MTD abstraction driver
48c0615 powerpc/powernv: Merge common platform device initialisation
594fcb9 powerpc/powernv: Expose OPAL APIs required by PRD interface
646b54f powerpc/powernv: Remove powernv RTAS support
0d7cd85 powerpc/powernv: Add opal-prd channel
7185795 powerpc/powernv: fix construction of opal PRD messages
cdf2bc1 powerpc/include: Add opal-prd to installed uapi headers
d8ea782 powerpc/powernv: Fix vma page prot flags in opal-prd driver

All commits are in at most v4.2
Plus config changes.

[Test Case]

'modprobe opal_prb' and use PRD support.

CVE References

Revision history for this message
Brad Figg (brad-figg) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:

apport-collect 1464560

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Tim Gardner (timg-tpi)
Changed in linux (Ubuntu):
assignee: nobody → Chris J Arges (arges)
penalvch (penalvch)
Changed in linux (Ubuntu):
importance: Undecided → High
status: Incomplete → Triaged
tags: added: cherry-pick
Revision history for this message
Jeremy Kerr (jk-ozlabs) wrote :

We've just had the last of our feature-enablement patches hit linux-next:

1cbb4a1 mtd: powernv: Add powernv flash MTD abstraction driver

The MTD driver is required for full PRD functionality, but I can open a separate issue if you prefer.

Revision history for this message
Chris J Arges (arges) wrote :

Jeremy,
Which Ubuntu series kernels are you requesting this for specifically, 3.19?
Wily will track upstream a bit, so if these make 4.1/4.2 they might just come in through a rebase.

Changed in linux (Ubuntu):
status: Triaged → In Progress
Revision history for this message
Breno Leitão (breno-leitao) wrote :

Chris, I understand that this is a request for 14.04.3 (3.19). and possibly for 14.04.2 (3.16).

Revision history for this message
Jeremy Kerr (jk-ozlabs) wrote :

And we've just had a couple of fixes hit linux-next too:

7185795 powerpc/powernv: fix construction of opal PRD messages
cdf2bc1 powerpc/include: Add opal-prd to installed uapi headers

Yes, as Breno has mentioned, we're looking at 3.19 and (if possible) 3.16.

Chris J Arges (arges)
description: updated
Chris J Arges (arges)
description: updated
Chris J Arges (arges)
description: updated
Revision history for this message
Chris J Arges (arges) wrote :

Ok these are all mainline now, but I'm needing some deps to get this applied to v3.19.

Patch 48c0615, seems to require ed59190e, which in turn probably needs d800ba1 (plus I'm not sure what.) Since there are large amount of change, I'd like to see what you suggest should be backported as well to make the first patch a cleaner change. Removing opal_flash_init without ed59190e seems dangerous, but since I'm not an expert here I'd like to get your strategy for applying this to v3.19.

Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

One of the aspects of this is to ship opal-prd tools in the archive; for that, we need uapi/asm/opal-prd.h (but it will also require the opal-prd device to exist to be of any use) to be available on each of the releases on which the opal-prd tools need to be shipped -- see bug 1467542.

Revision history for this message
Jeremy Kerr (jk-ozlabs) wrote :
Download full text (3.5 KiB)

Hi Chris,

The following commits should bring the PRD support into the current vivid branch, using only pristine upstream changes:

d800ba1 powerpc/powernv: Move OPAL API definitions to opal-api.h
d7cf83f powerpc/powernv: Move opal-api.h closer to the Skiboot version
ed59190 powerpc/powernv: Add interfaces for flash device access
1cbb4a1 mtd: powernv: Add powernv flash MTD abstraction driver
48c0615 powerpc/powernv: Merge common platform device initialisation
594fcb9 powerpc/powernv: Expose OPAL APIs required by PRD interface
646b54f powerpc/powernv: Remove powernv RTAS support
0d7cd85 powerpc/powernv: Add opal-prd channel
7185795 powerpc/powernv: fix construction of opal PRD messages
cdf2bc1 powerpc/include: Add opal-prd to installed uapi headers

(the last two are fixes that have hit mainline since the original merge)

However, we'll also need the changes in the actual merge commit to mainline:

commit df60f57684529a1dde4461cf84354453b440806a
Merge: 605f302 b921e90
Author: Michael Ellerman <email address hidden>
Date: Thu Mar 26 20:03:16 2015 +1100

    Merge branch 'next-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc into test

    Merge miscellaneous bits from benh. Fix a minor conflict with
    OpalMessageType changing names to opal_msg_type.

diff --cc arch/powerpc/include/asm/opal.h
index 0ef0fd6,4ea21ea..c08de77
--- a/arch/powerpc/include/asm/opal.h
+++ b/arch/powerpc/include/asm/opal.h
@@@ -208,8 -946,10 +208,10 @@@ extern void hvc_opal_init_early(void)
  extern int opal_notifier_register(struct notifier_block *nb);
  extern int opal_notifier_unregister(struct notifier_block *nb);

 -extern int opal_message_notifier_register(enum OpalMessageType msg_type,
 +extern int opal_message_notifier_register(enum opal_msg_type msg_type,
        struct notifier_block *nb);
 -extern int opal_message_notifier_unregister(enum OpalMessageType msg_type,
++extern int opal_message_notifier_unregister(enum opal_msg_type msg_type,
+ struct notifier_block *nb);
  extern void opal_notifier_enable(void);
  extern void opal_notifier_disable(void);
  extern void opal_notifier_update_evt(uint64_t evt_mask, uint64_t evt_val);
diff --cc arch/powerpc/platforms/powernv/opal.c
index 142a08a,8b3834a..d403b2b
--- a/arch/powerpc/platforms/powernv/opal.c
+++ b/arch/powerpc/platforms/powernv/opal.c
@@@ -302,16 -305,11 +305,11 @@@ void opal_notifier_disable(void
   * Opal message notifier based on message type. Allow subscribers to get
   * notified for specific messgae type.
   */
 -int opal_message_notifier_register(enum OpalMessageType msg_type,
 +int opal_message_notifier_register(enum opal_msg_type msg_type,
       struct notifier_block *nb)
  {
- if (!nb) {
- pr_warning("%s: Invalid argument (%p)\n",
- __func__, nb);
- return -EINVAL;
- }
- if (msg_type > OPAL_MSG_TYPE_MAX) {
- pr_warning("%s: Invalid message type argument (%d)\n",
+ if (!nb || msg_type >= OPAL_MSG_TYPE_MAX) {
+ pr_warning("%s: Invalid arguments, msg_type:%d\n",
        __func__, msg_type);
    return -EINVAL;
   }
@@@ -319,6 -318,13 +318,13 @@@
      &opal_msg_notifier_head[msg_type], nb);
  }

 -int opal_message_notifier_unregister(enum Op...

Read more...

Revision history for this message
Joel Stanley (shenki) wrote :

Hello,

Have these patches made their way into a kernel? If you need any help from the IBM side then please let me know.

One issue that's come up since Jeremy posted the list of patches is a bug fix "powerpc/powernv: Fix vma page prot flags in opal-prd driver". Can we please get that added in addition to the patches above?

It hit Linus' tree in the 4.2 merge window:

 https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=d8ea782b56d9d2c46a47b3231cfd16ecfb538c60

Revision history for this message
Chris J Arges (arges) wrote :

Ok I have the set of patches in my tree now, in addition there is a config change needed.
Does the following work?

MTD_POWERNV_FLASH = m
OPAL_PRD = m

Thanks,
--chris

Revision history for this message
Chris J Arges (arges) wrote :

* when I say in my tree, I mean locally and not in the Ubuntu kernel tree. : )

Revision history for this message
Joel Stanley (shenki) wrote : Re: [Bug 1464560] Re: Backport request: include PRD support for OpenPower kernels

On Wed, Jul 15, 2015 at 2:21 AM, Chris J Arges
<email address hidden> wrote:
> Ok I have the set of patches in my tree now, in addition there is a config change needed.
> Does the following work?
>
> MTD_POWERNV_FLASH = m
> OPAL_PRD = m

Yes, that looks good to me.

If you want to push your tree and the config somewhere I can access I
will give it a spin here.

Cheers!

Revision history for this message
Chris J Arges (arges) wrote :
Chris J Arges (arges)
Changed in linux (Ubuntu Utopic):
assignee: nobody → Chris J Arges (arges)
Changed in linux (Ubuntu Vivid):
assignee: nobody → Chris J Arges (arges)
Changed in linux (Ubuntu Utopic):
importance: Undecided → Medium
Changed in linux (Ubuntu Vivid):
importance: Undecided → Medium
Changed in linux (Ubuntu Utopic):
status: New → In Progress
Changed in linux (Ubuntu Vivid):
status: New → In Progress
Changed in linux (Ubuntu Utopic):
importance: Medium → High
Changed in linux (Ubuntu Vivid):
importance: Medium → High
Chris J Arges (arges)
description: updated
Revision history for this message
Chris J Arges (arges) wrote :

Config can be generated with 'fakeroot debian/rules genconfigs' and look for CONFIGS/*ppc64el*.

Revision history for this message
Joel Stanley (shenki) wrote :

Thanks Chris.

I'm not familiar with the Ubuntu kernel build scripts, any idea what I'm missing here (apart from debian/control, obviously):

~/dev/kernels/ubuntu-vivid :lp1464560 $ find . -name control
./debian/tests/control

~/dev/kernels/ubuntu-vivid :lp1464560 $ fakeroot debian/rules genconfigs
dh_testdir;
dh_testdir: "debian/control" not found. Are you sure you are in the correct directory?
debian/rules.d/1-maintainer.mk:43: recipe for target 'genconfigs' failed
make: *** [genconfigs] Error 2

Revision history for this message
Joel Stanley (shenki) wrote :

I need to run 'clean' first. Sorry for the noise

Revision history for this message
Joel Stanley (shenki) wrote :

Hey Chris,

I managed to build a kernel (took some stuffing about, nouveau wouldn't build) here and give it a spin on an OpenPower box. From my minimal The PRD and MTD functionality appears be good to go.

Where do we go from here? Are we able to get this into a -proposed kernel so our test teams can do some verification?

Cheers

Revision history for this message
Chris J Arges (arges) wrote :

Joel,
Yup I'll handle the rest. Thanks a ton for the testing!
--chris

Chris J Arges (arges)
description: updated
Revision history for this message
Chris J Arges (arges) wrote :

Ok so I'll push the vivid(3.19) SRU out first, but for utopic(3.16) I think a bit more help is required. In order to prepare to cherry-pick d800ba1 (since it is moving a bunch of code into a new file), I wanted to be sure not to lose any of the other cherry-picked features we added. So I came up with the following patches needed before-hand (which adds other features... and makes me a bit nervous):

6d626c5e
5b642340
d9df1b5d
d1a85eee
1212aa1c
16b1d26e

However even with that when I cherry-pick the rest of the series, I get a ton of conflicts.

Any advice would be helpful here, I don't want to lose any features we have in 3.16, nor cause regression. We don't require clean cherry-picks, but I'd like to make things as easy as possible for future cherry-picks and fixes.

Our current utopic tree is here (branch master-next for the latest):
http://kernel.ubuntu.com/git/ubuntu/ubuntu-utopic.git/

Revision history for this message
Chris J Arges (arges) wrote :

Sent pull requests for Wily/Vivid to <email address hidden>

description: updated
Brad Figg (brad-figg)
Changed in linux (Ubuntu Vivid):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux - 4.1.0-1.1

---------------
linux (4.1.0-1.1) wily; urgency=low

  [ Andy Whitcroft ]

  * SAUCE: overlay: add backwards compatible overlayfs format support V3
    - LP: #1395877, #1410480
  * SAUCE: overlayfs: when copying up and reading directories ensure
    mounter had permissions V2
    - CVE-2015-1328
  * [Packaging] fix up Vcs-Git: to point to launchpad
  * [Config] correct linux-initramfs-tool virtual linkage
    - LP: #1474810

  [ Chris J Arges ]

  * [Config] Add dm-service-time to multipath-modules
    - LP: #1469240
  * [Config] Add MTD_POWERNV_FLASH and OPAL_PRD
    - LP: #1464560

  [ Jay Vosburgh ]

  * SAUCE: fan: Proof of concept implementation (v2)
    - LP: #1439706
  * SAUCE: fan: tunnel multiple mapping mode (v3)
    - LP: #1470091

  [ Leann Ogasawara ]

  * Revert "SAUCE: ext4: disable ext4_punch_hole for indirect filesystems"
  * Revert "SAUCE: intel_pstate: inform user that thermald is worth
    considering"
  * Revert "SAUCE: Work around broken ACPI backlight on Dell Inspiron 5537"
  * Revert "SAUCE: dm-crypt: never use write same"
  * Release Tracking Bug
    - LP: #1476333

  [ Tim Gardner ]

  * Rebase to v4.1
    - LP: #1443371
  * [Config] Enable Apparmor
  * [Config] CONFIG_OVERLAY_FS_V1=y
  * [Config] DEFAULT_IOSCHED="deadline" for ppc64el
    - LP: #1469829
  * [Config] CONFIG_VM86=n
    - LP: #1473447
  * [Config] ACORN_PARTITION=n
    - LP: #1453117

  [ Timo Aaltonen ]

  * [Config] Disable CONFIG_DRM_I915_PRELIMINARY_HW_SUPPORT
    - LP: #1473319

  [ Upstream Kernel Changes ]

  * efi: efivar_create_sysfs_entry() should return negative error codes
  * efi: Add esrt support
  * x86, doc: Remove cmdline_size from list of fields to be filled in for
    EFI handover
  * efi/esrt: Fix some compiler warnings
  * efi: dmi: List SMBIOS3 table before SMBIOS table
  * efi: Add 'systab' information to Documentation/ABI
  * ALSA: hda - restore the MIC FIXUP for some Dell machines
    - LP: #1473560
  * mtd: powernv: Add powernv flash MTD abstraction driver
    - LP: #1464560
  * powerpc/powernv: Expose OPAL APIs required by PRD interface
    - LP: #1464560
  * powerpc/powernv: Add opal-prd channel
    - LP: #1464560
  * powerpc/powernv: fix construction of opal PRD messages
    - LP: #1464560
  * powerpc/include: Add opal-prd to installed uapi headers
    - LP: #1464560
  * powerpc/powernv: Fix vma page prot flags in opal-prd driver
    - LP: #1464560

 -- Leann Ogasawara <email address hidden> Mon, 20 Jul 2015 10:16:06 -0700

Changed in linux (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Breno Leitão (breno-leitao) wrote :

Hi Chris,

Any ETA for this fix in vivid? This is blocking 1467542, which is expected to be fixed by 14.04.3 release.

Revision history for this message
Brad Figg (brad-figg) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-vivid' to 'verification-done-vivid'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-vivid
Revision history for this message
Jeremy Kerr (jk-ozlabs) wrote :

Just booted 3.19.0-26-generic, all looks good!

tags: added: verification-done-vivid
removed: verification-needed-vivid
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (30.6 KiB)

This bug was fixed in the package linux - 3.19.0-26.28

---------------
linux (3.19.0-26.28) vivid; urgency=low

  [ Luis Henriques ]

  * Release Tracking Bug
    - LP: #1483630

  [ Upstream Kernel Changes ]

  * Revert "Bluetooth: ath3k: Add support of 04ca:300d AR3012 device"

linux (3.19.0-26.27) vivid; urgency=low

  [ Luis Henriques ]

  * Release Tracking Bug
    - LP: #1479055
  * [Config] updateconfigs for 3.19.8-ckt4 stable update

  [ Chris J Arges ]

  * [Config] Add MTD_POWERNV_FLASH and OPAL_PRD
    - LP: #1464560

  [ Mika Kuoppala ]

  * SAUCE: i915_bpo: drm/i915: Fix divide by zero on watermark update
    - LP: #1473175

  [ Tim Gardner ]

  * [Config] ACORN_PARTITION=n
    - LP: #1453117
  * [Config] Add i40e[vf] to d-i
    - LP: #1476393

  [ Timo Aaltonen ]

  * SAUCE: i915_bpo: Rebase to v4.2-rc3
    - LP: #1473175
  * SAUCE: i915_bpo: Revert "mm/fault, drm/i915: Use pagefault_disabled()
    to check for disabled pagefaults"
    - LP: #1473175
  * SAUCE: i915_bpo: Revert "drm: i915: Port to new backlight interface
    selection API"
    - LP: #1473175

  [ Upstream Kernel Changes ]

  * Revert "tools/vm: fix page-flags build"
    - LP: #1473547
  * Revert "ALSA: hda - Add mute-LED mode control to Thinkpad"
    - LP: #1473547
  * Revert "drm/radeon: adjust pll when audio is not enabled"
    - LP: #1473547
  * Revert "crypto: talitos - convert to use be16_add_cpu()"
    - LP: #1479048
  * module: Call module notifier on failure after complete_formation()
    - LP: #1473547
  * gpio: gpio-kempld: Fix get_direction return value
    - LP: #1473547
  * ARM: dts: imx27: only map 4 Kbyte for fec registers
    - LP: #1473547
  * ARM: 8356/1: mm: handle non-pmd-aligned end of RAM
    - LP: #1473547
  * x86/mce: Fix MCE severity messages
    - LP: #1473547
  * mac80211: don't use napi_gro_receive() outside NAPI context
    - LP: #1473547
  * iwlwifi: mvm: Free fw_status after use to avoid memory leak
    - LP: #1473547
  * iwlwifi: mvm: clean net-detect info if device was reset during suspend
    - LP: #1473547
  * drm/plane-helper: Adapt cursor hack to transitional helpers
    - LP: #1473547
  * ARM: dts: set display clock correctly for exynos4412-trats2
    - LP: #1473547
  * hwmon: (ntc_thermistor) Ensure iio channel is of type IIO_VOLTAGE
    - LP: #1473547
  * mfd: da9052: Fix broken regulator probe
    - LP: #1473547
  * ALSA: hda - Fix noise on AMD radeon 290x controller
    - LP: #1473547
  * lguest: fix out-by-one error in address checking.
    - LP: #1473547
  * xfs: xfs_attr_inactive leaves inconsistent attr fork state behind
    - LP: #1473547
  * xfs: xfs_iozero can return positive errno
    - LP: #1473547
  * fs, omfs: add NULL terminator in the end up the token list
    - LP: #1473547
  * omfs: fix sign confusion for bitmap loop counter
    - LP: #1473547
  * d_walk() might skip too much
    - LP: #1473547
  * dm: fix casting bug in dm_merge_bvec()
    - LP: #1473547
  * hwmon: (nct6775) Add missing sysfs attribute initialization
    - LP: #1473547
  * hwmon: (nct6683) Add missing sysfs attribute initialization
    - LP: #1473547
  * target/pscsi: Don't leak scsi_host if hba is VIRTUAL_HOST
    - LP: #1473547
  * net...

Changed in linux (Ubuntu Vivid):
status: Fix Committed → Fix Released
Chris J Arges (arges)
Changed in linux (Ubuntu Utopic):
status: In Progress → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.