1. 19 6月, 2020 1 次提交
  2. 29 5月, 2020 1 次提交
  3. 23 5月, 2020 1 次提交
  4. 14 4月, 2020 1 次提交
  5. 25 3月, 2020 1 次提交
  6. 17 1月, 2020 3 次提交
  7. 09 11月, 2019 1 次提交
    • B
      EDAC/amd64: Get rid of the ECC disabled long message · 7fdfee92
      Borislav Petkov 提交于
      This message keeps flooding dmesg on boxes where ECC is disabled or the
      DIMMs do not support ECC but the module gets auto-probed. What's even
      worse is that autoprobing happens on every CPU due to the CPU-family
      matching the driver does and uevent being generated for each CPU device.
      
      What is more, this message is becoming even more useless on newer
      systems where forcing ECC is not recommended and it should be done in
      the BIOS so the BIOS can do all the necessary work, i.e., just setting a
      bit in an MSR is not enough anymore.
      
      So get rid of it.
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Cc: Yazen Ghannam <yazen.ghannam@amd.com>
      Cc: linux-edac@vger.kernel.org
      Link: https://lkml.kernel.org/r/20191106160607.GC28380@zn.tnic
      7fdfee92
  8. 06 11月, 2019 5 次提交
  9. 25 10月, 2019 1 次提交
  10. 07 9月, 2019 1 次提交
  11. 23 8月, 2019 7 次提交
    • Y
      EDAC/amd64: Support asymmetric dual-rank DIMMs · 81f5090d
      Yazen Ghannam 提交于
      Future AMD systems will support asymmetric dual-rank DIMMs. These are
      DIMMs where the ranks are of different sizes.
      
      The even rank will use the Primary Even Chip Select registers and the
      odd rank will use the Secondary Odd Chip Select registers.
      
      Recognize if a Secondary Odd Chip Select is being used. Use the
      Secondary Odd Address Mask when calculating the chip select size.
      
       [ bp: move csrow_sec_enabled() to the header, fix CS_ODD define and
         tone-down the capitalized words spelling. ]
      Signed-off-by: NYazen Ghannam <yazen.ghannam@amd.com>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Cc: "linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>
      Cc: James Morse <james.morse@arm.com>
      Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
      Cc: Tony Luck <tony.luck@intel.com>
      Link: https://lkml.kernel.org/r/20190821235938.118710-8-Yazen.Ghannam@amd.com
      81f5090d
    • Y
      EDAC/amd64: Cache secondary Chip Select registers · 7574729e
      Yazen Ghannam 提交于
      AMD Family 17h systems have a set of secondary Chip Select Base
      Addresses and Address Masks. These do not represent unique Chip
      Selects, rather they are used in conjunction with the primary
      Chip Select registers in certain cases.
      
      Cache these secondary Chip Select registers for future use.
      Signed-off-by: NYazen Ghannam <yazen.ghannam@amd.com>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Cc: "linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>
      Cc: James Morse <james.morse@arm.com>
      Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
      Cc: Tony Luck <tony.luck@intel.com>
      Link: https://lkml.kernel.org/r/20190821235938.118710-7-Yazen.Ghannam@amd.com
      7574729e
    • Y
      EDAC/amd64: Decode syndrome before translating address · 8a2eaab7
      Yazen Ghannam 提交于
      AMD Family 17h systems currently require address translation in order to
      report the system address of a DRAM ECC error. This is currently done
      before decoding the syndrome information. The syndrome information does
      not depend on the address translation, so the proper EDAC csrow/channel
      reporting can function without the address. However, the syndrome
      information will not be decoded if the address translation fails.
      
      Decode the syndrome information before doing the address translation.
      The syndrome information is architecturally defined in MCA_SYND and can
      be considered robust. The address translation is system-specific and may
      fail on newer systems without proper updates to the translation
      algorithm.
      
      Fixes: 713ad546 ("EDAC, amd64: Define and register UMC error decode function")
      Signed-off-by: NYazen Ghannam <yazen.ghannam@amd.com>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Cc: "linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>
      Cc: James Morse <james.morse@arm.com>
      Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
      Cc: Tony Luck <tony.luck@intel.com>
      Link: https://lkml.kernel.org/r/20190821235938.118710-6-Yazen.Ghannam@amd.com
      8a2eaab7
    • Y
      EDAC/amd64: Find Chip Select memory size using Address Mask · e53a3b26
      Yazen Ghannam 提交于
      Chip Select memory size reporting on AMD Family 17h was recently fixed
      in order to account for interleaving. However, the current method is not
      robust.
      
      The Chip Select Address Mask can be used to find the memory size. There
      are a couple of cases.
      
      1) For single-rank and dual-rank non-interleaved, use the address mask
      plus 1 as the size.
      
      2) For dual-rank interleaved, do #1 but "de-interleave" the address mask
      first.
      
      Always "de-interleave" the address mask in order to simplify the code
      flow. Bit mask manipulation is necessary to check for interleaving, so
      just go ahead and do the de-interleaving. In the non-interleaved case,
      the original and de-interleaved address masks will be the same.
      
      To de-interleave the mask, count the number of zero bits in the middle
      of the mask and swap them with the most significant bits.
      
      For example,
      Original=0xFFFF9FE, De-interleaved=0x3FFFFFE
      Signed-off-by: NYazen Ghannam <yazen.ghannam@amd.com>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Cc: "linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>
      Cc: James Morse <james.morse@arm.com>
      Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
      Cc: Tony Luck <tony.luck@intel.com>
      Link: https://lkml.kernel.org/r/20190821235938.118710-5-Yazen.Ghannam@amd.com
      e53a3b26
    • Y
      EDAC/amd64: Initialize DIMM info for systems with more than two channels · 353a1fcb
      Yazen Ghannam 提交于
      Currently, the DIMM info for AMD Family 17h systems is initialized in
      init_csrows(). This function is shared with legacy systems, and it has a
      limit of two channel support.
      
      This prevents initialization of the DIMM info for a number of ranks, so
      there will be missing ranks in the EDAC sysfs.
      
      Create a new init_csrows_df() for Family17h+ and revert init_csrows()
      back to pre-Family17h support.
      
      Loop over all channels in the new function in order to support systems
      with more than two channels.
      Signed-off-by: NYazen Ghannam <yazen.ghannam@amd.com>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Cc: "linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>
      Cc: James Morse <james.morse@arm.com>
      Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
      Cc: Tony Luck <tony.luck@intel.com>
      Link: https://lkml.kernel.org/r/20190821235938.118710-4-Yazen.Ghannam@amd.com
      353a1fcb
    • Y
      EDAC/amd64: Recognize DRAM device type ECC capability · f8be8e56
      Yazen Ghannam 提交于
      AMD Family 17h systems support x4 and x16 DRAM devices. However, the
      device type is not checked when setting mci.edac_ctl_cap.
      
      Set the appropriate capability flag based on the device type.
      
      Default to x8 DRAM device when neither the x4 or x16 bits are set.
      
       [ bp: reverse cpk_en check to save an indentation level. ]
      
      Fixes: 2d09d8f3 ("EDAC, amd64: Determine EDAC MC capabilities on Fam17h")
      Signed-off-by: NYazen Ghannam <yazen.ghannam@amd.com>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Cc: "linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>
      Cc: James Morse <james.morse@arm.com>
      Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
      Cc: Tony Luck <tony.luck@intel.com>
      Link: https://lkml.kernel.org/r/20190821235938.118710-3-Yazen.Ghannam@amd.com
      f8be8e56
    • Y
      EDAC/amd64: Support more than two controllers for chip selects handling · d971e28e
      Yazen Ghannam 提交于
      The struct chip_select array that's used for saving chip select bases
      and masks is fixed at length of two. There should be one struct
      chip_select for each controller, so this array should be increased to
      support systems that may have more than two controllers.
      
      Increase the size of the struct chip_select array to eight, which is the
      largest number of controllers per die currently supported on AMD
      systems.
      
      Fix number of DIMMs and Chip Select bases/masks on Family17h, because
      AMD Family 17h systems support 2 DIMMs, 4 CS bases, and 2 CS masks per
      channel.
      
      Also, carve out the Family 17h+ reading of the bases/masks into a
      separate function. This effectively reverts the original bases/masks
      reading code to before Family 17h support was added.
      Signed-off-by: NYazen Ghannam <yazen.ghannam@amd.com>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Cc: "linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>
      Cc: James Morse <james.morse@arm.com>
      Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
      Cc: Tony Luck <tony.luck@intel.com>
      Link: https://lkml.kernel.org/r/20190821235938.118710-2-Yazen.Ghannam@amd.com
      d971e28e
  12. 21 5月, 2019 1 次提交
  13. 25 4月, 2019 1 次提交
    • B
      Revert "EDAC/amd64: Support more than two controllers for chip select handling" · 8de9930a
      Borislav Petkov 提交于
      This reverts commit 0a227af5.
      
      Unfortunately, this commit caused wrong detection of chip select sizes
      on some F17h client machines:
      
        --- 00-rc6+     2019-02-14 14:28:03.126622904 +0100
        +++ 01-rc4+     2019-04-14 21:06:16.060614790 +0200
         EDAC amd64: MC: 0:     0MB 1:     0MB
        -EDAC amd64: MC: 2: 16383MB 3: 16383MB
        +EDAC amd64: MC: 2:     0MB 3: 2097151MB
         EDAC amd64: MC: 4:     0MB 5:     0MB
         EDAC amd64: MC: 6:     0MB 7:     0MB
         EDAC MC: UMC1 chip selects:
         EDAC amd64: MC: 0:     0MB 1:     0MB
        -EDAC amd64: MC: 2: 16383MB 3: 16383MB
        +EDAC amd64: MC: 2:     0MB 3: 2097151MB
         EDAC amd64: MC: 4:     0MB 5:     0MB
         EDAC amd64: MC: 6:     0MB 7:     0M
      
      Revert it for now until it has been solved properly.
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Cc: Yazen Ghannam <yazen.ghannam@amd.com>
      8de9930a
  14. 27 3月, 2019 7 次提交
  15. 28 9月, 2018 1 次提交
  16. 27 8月, 2018 1 次提交
  17. 13 6月, 2018 1 次提交
    • K
      treewide: kzalloc() -> kcalloc() · 6396bb22
      Kees Cook 提交于
      The kzalloc() function has a 2-factor argument form, kcalloc(). This
      patch replaces cases of:
      
              kzalloc(a * b, gfp)
      
      with:
              kcalloc(a * b, gfp)
      
      as well as handling cases of:
      
              kzalloc(a * b * c, gfp)
      
      with:
      
              kzalloc(array3_size(a, b, c), gfp)
      
      as it's slightly less ugly than:
      
              kzalloc_array(array_size(a, b), c, gfp)
      
      This does, however, attempt to ignore constant size factors like:
      
              kzalloc(4 * 1024, gfp)
      
      though any constants defined via macros get caught up in the conversion.
      
      Any factors with a sizeof() of "unsigned char", "char", and "u8" were
      dropped, since they're redundant.
      
      The Coccinelle script used for this was:
      
      // Fix redundant parens around sizeof().
      @@
      type TYPE;
      expression THING, E;
      @@
      
      (
        kzalloc(
      -	(sizeof(TYPE)) * E
      +	sizeof(TYPE) * E
        , ...)
      |
        kzalloc(
      -	(sizeof(THING)) * E
      +	sizeof(THING) * E
        , ...)
      )
      
      // Drop single-byte sizes and redundant parens.
      @@
      expression COUNT;
      typedef u8;
      typedef __u8;
      @@
      
      (
        kzalloc(
      -	sizeof(u8) * (COUNT)
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(__u8) * (COUNT)
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(char) * (COUNT)
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(unsigned char) * (COUNT)
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(u8) * COUNT
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(__u8) * COUNT
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(char) * COUNT
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(unsigned char) * COUNT
      +	COUNT
        , ...)
      )
      
      // 2-factor product with sizeof(type/expression) and identifier or constant.
      @@
      type TYPE;
      expression THING;
      identifier COUNT_ID;
      constant COUNT_CONST;
      @@
      
      (
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * (COUNT_ID)
      +	COUNT_ID, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * COUNT_ID
      +	COUNT_ID, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * (COUNT_CONST)
      +	COUNT_CONST, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * COUNT_CONST
      +	COUNT_CONST, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * (COUNT_ID)
      +	COUNT_ID, sizeof(THING)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * COUNT_ID
      +	COUNT_ID, sizeof(THING)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * (COUNT_CONST)
      +	COUNT_CONST, sizeof(THING)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * COUNT_CONST
      +	COUNT_CONST, sizeof(THING)
        , ...)
      )
      
      // 2-factor product, only identifiers.
      @@
      identifier SIZE, COUNT;
      @@
      
      - kzalloc
      + kcalloc
        (
      -	SIZE * COUNT
      +	COUNT, SIZE
        , ...)
      
      // 3-factor product with 1 sizeof(type) or sizeof(expression), with
      // redundant parens removed.
      @@
      expression THING;
      identifier STRIDE, COUNT;
      type TYPE;
      @@
      
      (
        kzalloc(
      -	sizeof(TYPE) * (COUNT) * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE) * (COUNT) * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE) * COUNT * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE) * COUNT * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kzalloc(
      -	sizeof(THING) * (COUNT) * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        kzalloc(
      -	sizeof(THING) * (COUNT) * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        kzalloc(
      -	sizeof(THING) * COUNT * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        kzalloc(
      -	sizeof(THING) * COUNT * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      )
      
      // 3-factor product with 2 sizeof(variable), with redundant parens removed.
      @@
      expression THING1, THING2;
      identifier COUNT;
      type TYPE1, TYPE2;
      @@
      
      (
        kzalloc(
      -	sizeof(TYPE1) * sizeof(TYPE2) * COUNT
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
        , ...)
      |
        kzalloc(
      -	sizeof(THING1) * sizeof(THING2) * COUNT
      +	array3_size(COUNT, sizeof(THING1), sizeof(THING2))
        , ...)
      |
        kzalloc(
      -	sizeof(THING1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(THING1), sizeof(THING2))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE1) * sizeof(THING2) * COUNT
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
        , ...)
      )
      
      // 3-factor product, only identifiers, with redundant parens removed.
      @@
      identifier STRIDE, SIZE, COUNT;
      @@
      
      (
        kzalloc(
      -	(COUNT) * STRIDE * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	COUNT * (STRIDE) * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	COUNT * STRIDE * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	(COUNT) * (STRIDE) * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	COUNT * (STRIDE) * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	(COUNT) * STRIDE * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	(COUNT) * (STRIDE) * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	COUNT * STRIDE * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      )
      
      // Any remaining multi-factor products, first at least 3-factor products,
      // when they're not all constants...
      @@
      expression E1, E2, E3;
      constant C1, C2, C3;
      @@
      
      (
        kzalloc(C1 * C2 * C3, ...)
      |
        kzalloc(
      -	(E1) * E2 * E3
      +	array3_size(E1, E2, E3)
        , ...)
      |
        kzalloc(
      -	(E1) * (E2) * E3
      +	array3_size(E1, E2, E3)
        , ...)
      |
        kzalloc(
      -	(E1) * (E2) * (E3)
      +	array3_size(E1, E2, E3)
        , ...)
      |
        kzalloc(
      -	E1 * E2 * E3
      +	array3_size(E1, E2, E3)
        , ...)
      )
      
      // And then all remaining 2 factors products when they're not all constants,
      // keeping sizeof() as the second factor argument.
      @@
      expression THING, E1, E2;
      type TYPE;
      constant C1, C2, C3;
      @@
      
      (
        kzalloc(sizeof(THING) * C2, ...)
      |
        kzalloc(sizeof(TYPE) * C2, ...)
      |
        kzalloc(C1 * C2 * C3, ...)
      |
        kzalloc(C1 * C2, ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * (E2)
      +	E2, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * E2
      +	E2, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * (E2)
      +	E2, sizeof(THING)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * E2
      +	E2, sizeof(THING)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	(E1) * E2
      +	E1, E2
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	(E1) * (E2)
      +	E1, E2
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	E1 * E2
      +	E1, E2
        , ...)
      )
      Signed-off-by: NKees Cook <keescook@chromium.org>
      6396bb22
  18. 15 2月, 2018 1 次提交
  19. 25 9月, 2017 1 次提交
  20. 17 7月, 2017 1 次提交
  21. 03 5月, 2017 1 次提交
  22. 28 1月, 2017 1 次提交