Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp104367iof; Sun, 5 Jun 2022 22:30:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyL7UGQyYjKtYpeSAxdjv7kFs1E79vCEkjqKT2OF60MynJ+5qgm8Fs1I6OOBWWOzN1hdebZ X-Received: by 2002:a17:90a:c283:b0:1e3:7d6:8806 with SMTP id f3-20020a17090ac28300b001e307d68806mr24996741pjt.190.1654493429257; Sun, 05 Jun 2022 22:30:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654493429; cv=none; d=google.com; s=arc-20160816; b=V1Y+Yggg5ksA/5lCsnu1xJxUBPnAV0h2rwajRyKnYpSVfRCYAp9nDSamx4iQxhVLA/ 3vXvpq8/aC350bvaAAHmsBm9OMR9XAs2OMxAu6i+mshGBywUr/1ayu3YfCZUPEW4SWnB l+JIHlOkwf2hicjuTQOJnXdrfEJTfhNZc+Bqaky3AGEMrpgM8NJpB4dUEcW04eqxW4Yw KwSdJO4usZyUGB4+Mu+as/z4SNx9LVFdhYkAp7loQoJiIzRAQRBLQLum2e0iyR8BtDKq jt0SwcTEc73Fl8hXoDLtLhPEBhE3NPKfnzfXVUE3iSjhaZliyrQbbWqnjDAwsTihwW/g XYag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=HNG0pvMhGgxFerG2GWrJAfenLfiSwl0sPYL3hqEYyQ0=; b=Ss2EcuUGZc/STNaEJTBQGiftlckXTpEWB/gaZzTTSpyGOttvnv5j84+kr2Gyp10hjF YVTdlQzUFh2Lm/1/Css2+KG3mz5oMeYqITtE+SlaATUf+S0ZLrboS4gt/gbXzCxREuvk /zOyco3NMSu6J97exfsmCmaE9tBNC55R9RnVpJLaD41hxH2x8F6DB2LpIpqQ9NAyqUJJ ywEThaa4N9IQzzNZ1CmjrKYb06fMnp75WRcxZZEeaiglTGlT64VsAaNNH2JsP8E9Tdh7 sYItui+pYv62kJ2BXCO3ZiaHzYN6wkhrbW+cu/b64eD5v0f0Ao6GJMf8Hs5+o0lp9frS Zayg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=UBC3ctp8; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id u138-20020a627990000000b0051082e04bc6si17397525pfc.26.2022.06.05.22.30.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 22:30:29 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=UBC3ctp8; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C57DE63F4; Sun, 5 Jun 2022 21:30:45 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242107AbiFCG6f (ORCPT + 99 others); Fri, 3 Jun 2022 02:58:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241804AbiFCG5F (ORCPT ); Fri, 3 Jun 2022 02:57:05 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C8DA1094; Thu, 2 Jun 2022 23:56:56 -0700 (PDT) Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2536S0dV029915; Fri, 3 Jun 2022 06:56:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=HNG0pvMhGgxFerG2GWrJAfenLfiSwl0sPYL3hqEYyQ0=; b=UBC3ctp8m+88r2SN/GUt23j/kvse4wY7aBX2VyFCEf0O/U/8v/t6ycvsphgImmA9VwGo 0OB+UeBRBO1kNSZ0WKW/zAqqB5YY9PLg8L7BAK1jjm5QWBdR30Tb+NBasdwX58+iK4Lr oGz1KSX76tAI4H98JobqQ9nqjt2awm43rH52YwsGQxN5r9wPtS0KeIkICA5eNjT/FKee SxermZVnYc7KVkYGduCCYlaeLzv3rjnfZSvHemM8RXDTkU5G5vg8YYUhPSEnP91nr9RK LzCSJ67rYauW5/x7B4os30ou5mvxSR7icZmuFqbomoVpGKqQWmLGTPCWWMk9WgGdkqVb gg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3gfd2b0d3t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 03 Jun 2022 06:56:55 +0000 Received: from m0187473.ppops.net (m0187473.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 2536ggHd038235; Fri, 3 Jun 2022 06:56:55 GMT Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3gfd2b0d3g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 03 Jun 2022 06:56:55 +0000 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 2536pSpw001175; Fri, 3 Jun 2022 06:56:52 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma06ams.nl.ibm.com with ESMTP id 3gf40prgh5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 03 Jun 2022 06:56:52 +0000 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2536uoFU24314332 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 3 Jun 2022 06:56:50 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BBFAF42042; Fri, 3 Jun 2022 06:56:49 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5D16C4204B; Fri, 3 Jun 2022 06:56:49 +0000 (GMT) Received: from p-imbrenda.boeblingen.de.ibm.com (unknown [9.152.224.40]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 3 Jun 2022 06:56:49 +0000 (GMT) From: Claudio Imbrenda To: kvm@vger.kernel.org Cc: borntraeger@de.ibm.com, frankja@linux.ibm.com, thuth@redhat.com, pasic@linux.ibm.com, david@redhat.com, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, scgl@linux.ibm.com, mimu@linux.ibm.com, nrb@linux.ibm.com Subject: [PATCH v11 08/19] KVM: s390: pv: clear the state without memset Date: Fri, 3 Jun 2022 08:56:34 +0200 Message-Id: <20220603065645.10019-9-imbrenda@linux.ibm.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603065645.10019-1-imbrenda@linux.ibm.com> References: <20220603065645.10019-1-imbrenda@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: nUhEmPQXc7CHGAb7uLR9EcTDObsXWWeR X-Proofpoint-GUID: 9Nf3VS_Zd4VMR3takS3J0VMOswJAkgia X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.517,FMLib:17.11.64.514 definitions=2022-06-03_02,2022-06-02_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=812 spamscore=0 clxscore=1015 mlxscore=0 adultscore=0 bulkscore=0 malwarescore=0 phishscore=0 impostorscore=0 priorityscore=1501 suspectscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2206030027 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Do not use memset to clean the whole struct kvm_s390_pv; instead, explicitly clear the fields that need to be cleared. Upcoming patches will introduce new fields in the struct kvm_s390_pv that will not need to be cleared. Signed-off-by: Claudio Imbrenda Reviewed-by: Janosch Frank --- arch/s390/kvm/pv.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/s390/kvm/pv.c b/arch/s390/kvm/pv.c index f3134d79f8e1..9eca80afedce 100644 --- a/arch/s390/kvm/pv.c +++ b/arch/s390/kvm/pv.c @@ -16,6 +16,14 @@ #include #include "kvm-s390.h" +static void kvm_s390_clear_pv_state(struct kvm *kvm) +{ + kvm->arch.pv.handle = 0; + kvm->arch.pv.guest_len = 0; + kvm->arch.pv.stor_base = 0; + kvm->arch.pv.stor_var = NULL; +} + int kvm_s390_pv_destroy_cpu(struct kvm_vcpu *vcpu, u16 *rc, u16 *rrc) { int cc; @@ -110,7 +118,7 @@ static void kvm_s390_pv_dealloc_vm(struct kvm *kvm) vfree(kvm->arch.pv.stor_var); free_pages(kvm->arch.pv.stor_base, get_order(uv_info.guest_base_stor_len)); - memset(&kvm->arch.pv, 0, sizeof(kvm->arch.pv)); + kvm_s390_clear_pv_state(kvm); } static int kvm_s390_pv_alloc_vm(struct kvm *kvm) -- 2.36.1