On 7/23/25 4:17 PM, Eric Farman wrote: > On Fri, 2025-07-11 at 17:10 -0400, Zhuoying Cai wrote:
... >> + if (!diag_parm_addr_valid(addr, sizeof(VCStorageSizeBlock), >> + true)) { >> + s390_program_interrupt(env, PGM_ADDRESSING, ra); >> + return; >> + } >> + >> + if (!qcs || !qcs->count) { > > For my own curiosity, can qcs actually be NULL? Looks like > s390_ipl_get_certificate_store() returns > the address of the cert_store struct in the IPL device. > Thanks for pointing it out. qcs can't be NULL for the reason you mentioned. I'll remove the check since it's unnecessary. >> + vcssb.length = cpu_to_be32(4); >> + } else { >> + vcssb.length = cpu_to_be32(VCSSB_MAX_LEN); >> + vcssb.version = 0; >> + vcssb.total_vc_ct = cpu_to_be16(qcs->count); >> + vcssb.max_vc_ct = cpu_to_be16(MAX_CERTIFICATES); >> + vcssb.max_vce_len = cpu_to_be32(VCE_HEADER_LEN + >> qcs->max_cert_size); >> + vcssb.max_single_vcb_len = cpu_to_be32(VCB_HEADER_LEN + >> VCE_HEADER_LEN + >> + qcs->max_cert_size); >> + vcssb.total_vcb_len = cpu_to_be32(VCB_HEADER_LEN + >> + qcs->count * VCE_HEADER_LEN + >> + qcs->total_bytes); >> + } >> + >> + if (s390_cpu_virt_mem_write(cpu, addr, r1, &vcssb, >> sizeof(VCStorageSizeBlock))) { >> + s390_cpu_virt_mem_handle_exc(cpu, ra); >> + return; >> + } >> rc = DIAG_320_RC_OK; >> break; >> default: