Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1270056lql; Tue, 12 Mar 2024 11:58:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXFnctm8ybPg9e1J7hu3byNblUCh8azPbVDcaOWhCGR3/HBprf+OntQfGsvkqt4pSpak7stGiKZOuL1KGtwmwNXXQwY2SVuDE1w6cSweQ== X-Google-Smtp-Source: AGHT+IH7dqtbeSrhVz/0q/TM5PKkZ1fkpN5LQaMPpVmCtBDVWZaFr/lOIeMsAHKqukwS5PWAaLQE X-Received: by 2002:a17:903:94e:b0:1dd:bf6c:8973 with SMTP id ma14-20020a170903094e00b001ddbf6c8973mr2121935plb.68.1710269919890; Tue, 12 Mar 2024 11:58:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710269919; cv=pass; d=google.com; s=arc-20160816; b=vTOZOIQo41l46JHFn1oMlPGsUUAcaYYV4AI4XrtiWb3XI6WA5Fc7R/kHDgtzVpg6hE tU5JF2L/5wSRfdNEcfwCsVq44hS1wqv8cPORsY4P9DrmeUVc9Zvgy53exGq5sRRqnj4i ryLugE5Y/vvVV5/WJL8zJ59oaz7gE5p/SGAJR5AWkG6OWteIIm+TtIo1rkskPPQfWDnv r9PJBtOLlXKWqgbVEiJ2s2injTdiWQeCIEXS1e2VyZm1AdqqPWCUIdiN6hJg8XE5Cz+l OKO5uA8plT1nT4xnzx/J2FxmpGjMOrZDo0fZLqz9xNxR2Qe5kq20TndtnhPFoKhf5LkU YHZQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :dkim-signature; bh=kcNw7BbBTvDVZigmwhGYQ/p09R6CDgjmySJUJxjAXMQ=; fh=l4alI5Sgm/QMrcMIZIWC6mo3RU+l156dNCjr6qJPVPU=; b=oUZSeqhs83uUXR+aYQiMDfy2p0T47mI6UpSAhlZhsi4673qSrph0ufH6nNZNTkmLas M5/LzaIPswf0ebE10SqiNFlIXnIshmgOAnzSLaf/q/C1qmOp366rkXqd0gHUKpFMHwLb uHisimkmZXN5VR3UEtZpzaMSH/YguEPFpeOCz0UwO68IHO3+JTM/k4Etamg5W/IjnfQ1 DXsMgSS6WngXrSCdvS0gyYNYpNs3w7ANfxXorvJEluicP7gghxQ8Zsb7JyVqCYifVyox GtD6kYvXxwL4tJCYF4A2pxcTHktmmxry0/ECYjcQ5N3HUqFwxV9vWHXRVwNSPZW3oo2x M8Ng==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=vP4DvnHD; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-100680-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100680-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id j13-20020a170902f24d00b001dcf7b28e05si7188090plc.288.2024.03.12.11.58.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 11:58:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-100680-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=vP4DvnHD; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-100680-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100680-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 0BEDCB20EFE for ; Tue, 12 Mar 2024 18:41:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 47FD1145661; Tue, 12 Mar 2024 18:38:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="vP4DvnHD" Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 004031428F9 for ; Tue, 12 Mar 2024 18:38:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710268696; cv=none; b=T47w5/56erCHD23xL6q+YZxBFrw/JZANiVe4qBJOKfd0fFOMNwh1GhATF2apa6pQjRwGHtkPJo8AHYqWCfyN4t8EN9CiPLldPAqBKMth34he+ZcN0YW9L9nrTi/AGhOv0jsUiCAwZcVwQ5DTsnZ9C+D85fsSxzzw8CQIpO2VJTg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710268696; c=relaxed/simple; bh=wYX4U4mgWZDDTAVNg6/c0mwBAAO7KZiivCc6MfSMAN0=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=WcJRyvJ+Ax4CMdfW3qnOHnfvwqJj1oInQZFEJM1OS1HtkCfmaEgeW5VCG8FM5DxcA7ETDUdoiO2nPQrFZkWMSO8kk1Kt1ct6PMIEAb01TzgkBGPYWVZwG8tmA4fG6ks7GM01ktWxIXjaGI1Q3wWZo9oJ6Jqmt94EqjpLBGN16iA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=vP4DvnHD; arc=none smtp.client-ip=209.85.214.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-1ddafc9a900so15360425ad.3 for ; Tue, 12 Mar 2024 11:38:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1710268694; x=1710873494; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=kcNw7BbBTvDVZigmwhGYQ/p09R6CDgjmySJUJxjAXMQ=; b=vP4DvnHDTUkfquUVXNOhtR4snNzWYxhhefeuYo664upQcJcp8vSuZ5x6uuGIohSYEI 4AT1tPiam+BYeXUBrqBDUM8KLyxsy1ZsfPqey/qr0SHCVLtfhWb0GKkdnibTIaV+Ilyf PZbTt2/hWuhheexirbnprTSLvF5BSvLdMg1/iWp9LbnAeaqOQlaxaM8Ab8VrmDJQ6JBZ gPnRb3v3mTBJ/YlA+K1S/wVpbeF7FhcDd+LLAbU7YLHArnjjvMlyjokJzcyDmONq9h7C g7KT8LJJWz+VCdMLBzADIPipb9FwEQ7vO1TpQdnyqouigWiexZnEb98/4+8YOGC2Gxly uFPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710268694; x=1710873494; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=kcNw7BbBTvDVZigmwhGYQ/p09R6CDgjmySJUJxjAXMQ=; b=YRv8P+0E+axU7SF1JuDF/ef5K4CBP1vuA9HzDRD6RVIEDEEzYq/ViIdZvovOD7G3+I CAu70f7YAJ4c3eFa1DJCUgXHrf4posOrp4t057p4Qim9mIHGSDWuGssjfNwuCbeUqZNo U3MY0FysD6e6yfsAOOuX87f1aESMTNgI0Ekw9HNeu3+o4cHwSYs8sbMa4BIh5j4+sFQa VSWhUsLposic+N7gPf1ohh1k7xlIGuGLuM4Kk5j0BtFAwk+jeTkmEnPj4qVwCsia+5rs T1fVUVs6VLQ6Ywz2daVnzvay+dlUI+0ETZuCmESrMJ48Ir8mTq5QQDf10ZXCqBXDVSie j2dw== X-Forwarded-Encrypted: i=1; AJvYcCXrPox47L3Sl6o9PgM0SoEOagKe/pXmt9bEGILGJNla0S32gL1b0zZCNsmDkF+8bR9/53VAtPpBiVbadbJ5R8Irs5OULiTk+BGaEj22 X-Gm-Message-State: AOJu0YxMAwv8eFR1waLLMp+Wq2gRA/guOGTdILt2nuBGcZLezx0oG6Au XMty+NiC8IJOXrwG7oyF5z0Ay7kSM4fN3Cs/9/VO5Sorfrh9x/HE4uAJXMa8645K5gD/ihW3Uo2 Z+g== X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:902:ecc2:b0:1dd:8360:df97 with SMTP id a2-20020a170902ecc200b001dd8360df97mr664667plh.13.1710268694242; Tue, 12 Mar 2024 11:38:14 -0700 (PDT) Date: Tue, 12 Mar 2024 11:38:09 -0700 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: Message-ID: Subject: Re: [PATCH] KVM: SVM: Remove a useless zeroing of allocated memory From: Sean Christopherson To: Christophe JAILLET Cc: Paolo Bonzini , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, kvm@vger.kernel.org Content-Type: text/plain; charset="us-ascii" On Sat, Mar 09, 2024, Christophe JAILLET wrote: > Depending of the memory size needed, we clear or not the allocated memory. > This is not consistent. > > So remove the zeroing of the memory in the __vmalloc() case. > > Signed-off-by: Christophe JAILLET > --- > This is just a guess. > > I don't know this code at all, but because of KVM, it is maybe safer to > clear the memory in both cases? > So, maybe it is better to use kzalloc() in the other path. Not zeroing should be totally fine, the array is only used to hold kernel pointers, if KVM leaks that state and/or accesses uninitialized data, we have bigger problems :-)