Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1669154pxu; Sun, 6 Dec 2020 03:27:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJxzT+85ttnuWqoTr4QXetYKDZAypMD0waltJg0SWfGJ03WO2idGnSS/nDMjem/4TexDgsPy X-Received: by 2002:a50:fd88:: with SMTP id o8mr15709307edt.386.1607254050390; Sun, 06 Dec 2020 03:27:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607254050; cv=none; d=google.com; s=arc-20160816; b=ozPVp0PH97N8KCdRJrxMKtmahHBrZ9F3aUJmKOH9JVaxZWDTsWA9zSXlruLKmYbnqM CAmqox+NeGfo6j37PMbGXIUmV1L6nGvI1tdeaTFj4lM0LEc7Yx30Ub0V5jP3dl4U11Rv Ev671ygGTho2rl3I0ObGtV1hlIO+SWPm3tMJrSqjLxca1IMXY+/Ge9V9FE6bbHkezx3G lUZvAlukH9WpmrAvKfH7nVMGdmwYcCylzOWkU4g3p4SksjaL/5uzfQ/cQZD1nc9EdeCy rBvELoYd7wpQnkkQKp5afKlsxtAmvOGblUN7mDLjrHDV8e2moIo0NIDB8VzPD/mkPg16 r95g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=CdYoKLzu3dd766pS5qgLizC926YGw0zOhejthN2TSxI=; b=zKmW/k3tlN52pUAglOFMnxMGY4ek8UTh+t1GDcjo7YoGq3KwMdEFv+GZ87TqDmZLjL 4dW5kTJcjE2QeqZzgieC2bexOnIsiWhBigZg+2NxjFa4XY7o0yLOvMfBZdoQL+AbsJtj iJnsvkyuZk+Se1qJDSYA425jYN7yC5pnTWccXpyBFZmYPfi3GjrhyB6DOYnJVUXLCGx4 WARpSHYfi6h9EaCR63bRuimU8Ka7d3J54pKeD75uXeelCs7opI2dEnn9Mfdjmn5qVxhS iciveWykloVlZvHu22rQ06U5hJpo0WG7iECjSgoGRqKkCpS938/7+zYhjnsTjWuIHsYx RToA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HBOkEN15; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n27si4650532ejc.673.2020.12.06.03.27.06; Sun, 06 Dec 2020 03:27:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HBOkEN15; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727387AbgLFLYx (ORCPT + 99 others); Sun, 6 Dec 2020 06:24:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726904AbgLFLYx (ORCPT ); Sun, 6 Dec 2020 06:24:53 -0500 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 653F4C0613D1; Sun, 6 Dec 2020 03:24:13 -0800 (PST) Received: by mail-pg1-x544.google.com with SMTP id n7so6521637pgg.2; Sun, 06 Dec 2020 03:24:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=CdYoKLzu3dd766pS5qgLizC926YGw0zOhejthN2TSxI=; b=HBOkEN15GsbIeJd5qYcyivRHL9gxhB70wVoXHe0axffUak+gz37Td+4vt9XuGjsqQU SS8j217GqrHkGNdgNQLWMneCtqcqGHe1usD7cfYF72as85gsN+x1quFag1WoA3Wl376F 9KhLhG7AFpM6iFe3W/jDl7cR03Wu3vy7iPZMfkE0haUQWgqCWfHhqNca1fH1UoS7M/vr 4VMIxAesWGm5xDnVUM1Lkf+B0SfcwFhucUacZLfamQMmxzxna4uC3Cf2GPSR5MU3HK8z 211xr4IxSbunDx8EWuSx5Le3h1XLNJG0Y7rHO3ZcUkA+/dtJxMSgyz8cUKMGwgxZEXGj ib/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=CdYoKLzu3dd766pS5qgLizC926YGw0zOhejthN2TSxI=; b=ZDQnjFZq2L9xgTObnHqXriyId96MS8IMydWjli8AXzhlIe/5yeDvqknpDJxKNDohBA ngUB8UC6RC1qUb5bMjb4VDXV3VmjRLxUtFUr0Rzbk5BdgFCiz/kdPZDNafvS9nRKBBHE xuEoml2Eq79sjfNiVDRvlPIum2fMKa72Ata6IUPBEr//+drknzIW6YWhV3a8etGNfpgB yOI7Kw54Y0gjbcKsN0igiWowKPrmhFlw/4dxORWhHaB270NQujQpl9u4/WfnxSyzEq7z r049zwkvj3UwozHNCbPDEw5UdIHWRhXRiNBd6wYYler1hAabI+5b4MgUf1aZlYLa/vUs Kp7Q== X-Gm-Message-State: AOAM530WeqPcTM5ac1++wLLLZFu6tfjCTh/haiV/ZVZQ0CbBj8Ohan6L DxliIu1gDnldraHq0QUXnc8= X-Received: by 2002:a05:6a00:848:b029:197:e659:e236 with SMTP id q8-20020a056a000848b0290197e659e236mr11728461pfk.74.1607253852896; Sun, 06 Dec 2020 03:24:12 -0800 (PST) Received: from minh ([113.162.156.187]) by smtp.gmail.com with ESMTPSA id z188sm10936552pfb.121.2020.12.06.03.24.09 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 06 Dec 2020 03:24:12 -0800 (PST) Date: Sun, 6 Dec 2020 18:24:05 +0700 From: Bui Quang Minh To: Alan Stern Cc: Felipe Balbi , Greg Kroah-Hartman , Corentin Labbe , Jules Irenge , Andrey Konovalov , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] USB: dummy-hcd: Fix uninitialized array use in init() Message-ID: <20201206112405.GB3006@minh> References: <1607063090-3426-1-git-send-email-minhquangbui99@gmail.com> <20201204161249.GA1141609@rowland.harvard.edu> <20201205151511.GA1179536@rowland.harvard.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20201205151511.GA1179536@rowland.harvard.edu> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Dec 05, 2020 at 10:15:11AM -0500, Alan Stern wrote: > On Sat, Dec 05, 2020 at 07:47:01PM +0700, Minh Bùi Quang wrote: > > Vào Th 6, 4 thg 12, 2020 vào lúc 23:12 Alan Stern > > đã viết: > > > Does this initialization end up using less memory than an explicit > > > memset() call? > > > > You mean speed? > > No, I mean memory space. > > A memset call requires a certain amount of instruction space (to push > the arguments and make the call) but no static data space. > Initialization requires some instruction space (to copy the data) and > static data space as well (to hold the data that is to be copied). > > Alan Stern > Thank you for your clarification, I didn't think about it before. As I check when compiling the code, with MAX_NUM_UDC=32 the initialization becomes xor eax,eax mov ecx,0x40 rep stos DWORD PTR es:[rdi],eax With MAX_NUM_UDC=2, the initialization becomes mov QWORD PTR [rbp-0x30],0x0 mov QWORD PTR [rbp-0x28],0x0 As I see, initialization does not require additional static data space. Am I right? Thanks, Quang Minh