plpks.c (ea68a3e9d14e9e0bf017d178fb4bd53b6deb1482) | plpks.c (df9cad09493808dca7d16a2fbcac1a78e8d412af) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * POWER LPAR Platform KeyStore(PLPKS) 4 * Copyright (C) 2022 IBM Corporation 5 * Author: Nayna Jain <nayna@linux.ibm.com> 6 * 7 * Provides access to variables stored in Power LPAR Platform KeyStore(PLPKS). 8 */ --- 364 unchanged lines hidden (view full) --- 373{ 374 return ospasswordlength; 375} 376 377bool plpks_is_available(void) 378{ 379 int rc; 380 | 1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * POWER LPAR Platform KeyStore(PLPKS) 4 * Copyright (C) 2022 IBM Corporation 5 * Author: Nayna Jain <nayna@linux.ibm.com> 6 * 7 * Provides access to variables stored in Power LPAR Platform KeyStore(PLPKS). 8 */ --- 364 unchanged lines hidden (view full) --- 373{ 374 return ospasswordlength; 375} 376 377bool plpks_is_available(void) 378{ 379 int rc; 380 |
381 if (!firmware_has_feature(FW_FEATURE_LPAR)) | 381 if (!firmware_has_feature(FW_FEATURE_PLPKS)) |
382 return false; 383 384 rc = _plpks_get_config(); 385 if (rc) 386 return false; 387 388 return true; 389} --- 295 unchanged lines hidden (view full) --- 685 // Since we've cleared the password, we must update the FDT checksum 686 early_init_dt_verify(fdt); 687} 688 689static __init int pseries_plpks_init(void) 690{ 691 int rc; 692 | 382 return false; 383 384 rc = _plpks_get_config(); 385 if (rc) 386 return false; 387 388 return true; 389} --- 295 unchanged lines hidden (view full) --- 685 // Since we've cleared the password, we must update the FDT checksum 686 early_init_dt_verify(fdt); 687} 688 689static __init int pseries_plpks_init(void) 690{ 691 int rc; 692 |
693 if (!firmware_has_feature(FW_FEATURE_PLPKS)) 694 return -ENODEV; 695 |
|
693 rc = _plpks_get_config(); 694 695 if (rc) { 696 pr_err("POWER LPAR Platform KeyStore is not supported or enabled\n"); 697 return rc; 698 } 699 700 rc = plpks_gen_password(); 701 if (rc) 702 pr_err("Failed setting POWER LPAR Platform KeyStore Password\n"); 703 else 704 pr_info("POWER LPAR Platform KeyStore initialized successfully\n"); 705 706 return rc; 707} 708machine_arch_initcall(pseries, pseries_plpks_init); | 696 rc = _plpks_get_config(); 697 698 if (rc) { 699 pr_err("POWER LPAR Platform KeyStore is not supported or enabled\n"); 700 return rc; 701 } 702 703 rc = plpks_gen_password(); 704 if (rc) 705 pr_err("Failed setting POWER LPAR Platform KeyStore Password\n"); 706 else 707 pr_info("POWER LPAR Platform KeyStore initialized successfully\n"); 708 709 return rc; 710} 711machine_arch_initcall(pseries, pseries_plpks_init); |