From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web10.1669.1610703082333875339 for ; Fri, 15 Jan 2021 01:31:22 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IgBwwgug; spf=pass (domain: redhat.com, ip: 216.205.24.124, mailfrom: philmd@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610703081; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=K20fThb2/cYD/oZeMrfeCnRRzfGYSamoVXXMH8Znvq8=; b=IgBwwgugWywwtYkOO5tpZDYvJAPBXgssE1ae9OD6Dgsruw8VAbtZc+MWjn+Ka/7iWegWyv XjaeeeVmjGO0OTK0sN9Z+1h1en+yXcKJXjXJlB8a2A+HxoEJ9onAlwiL7+xXfkjQcrqA2f PfuhLTBYF0Bs2DdBfckpd+rGN4/wfKQ= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-477-P33Jl_ejOOW9pUL22VzBUg-1; Fri, 15 Jan 2021 04:31:17 -0500 X-MC-Unique: P33Jl_ejOOW9pUL22VzBUg-1 Received: by mail-ed1-f71.google.com with SMTP id x13so3607611edi.7 for ; Fri, 15 Jan 2021 01:31:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=K20fThb2/cYD/oZeMrfeCnRRzfGYSamoVXXMH8Znvq8=; b=owDOli3FB+Ny8PqIg6KsaMJDOtjRxTDNejyOJLM9QRBI/VXJO6HQbfw+C9YXO4j22y qm8Fxx/DXTalMEnT+Bui8+gYT4TU1u75RaxEOrYDCSo72lQ7qRwtBBTR4/3BYoGrOQWe zYFBBWCIBNW9AuG2cDs6himkHdhiIkfy/eEkx4juvt58cX4ZYl5gl36Vu0dBVrFnZqwf Xb2WQeV2sXD5H5ON4KzDxF4MNEyYeqbJCDPWSXzxqKVxqphFyqbvklDJ/OwctSKQUvMr ymxTkZAP4Cjn5lr58LTzCvU4Z3YtW7ZWZ5k1i9M+WHoAFt+TQrdssOjU7bmDvCc5z+eh kc1g== X-Gm-Message-State: AOAM533Fs9l/bAo9+WPmwo4LEvY9uQW2KQPS8iwJNa4ZOQbX6PG4ABry Ff62vpYclWYq/+t2lTbEZ/uXtctAfxX+D6oNhCFy0TxIap5BlALaj/3rff7Hb9upRrEpHGVexJn E63xdzXftiA1azQ== X-Received: by 2002:aa7:db1a:: with SMTP id t26mr9046259eds.25.1610703076581; Fri, 15 Jan 2021 01:31:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJw4AavHIYW/M1oVz/KD5y3Vhy/jXbFf+Ns78L+8uaZ8M6ewbvZ9ItX2gkkgAEygKcqAYVOl+g== X-Received: by 2002:aa7:db1a:: with SMTP id t26mr9046251eds.25.1610703076414; Fri, 15 Jan 2021 01:31:16 -0800 (PST) Return-Path: Received: from [192.168.1.36] (13.red-83-57-169.dynamicip.rima-tde.net. [83.57.169.13]) by smtp.gmail.com with ESMTPSA id pg9sm3015715ejb.102.2021.01.15.01.31.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 15 Jan 2021 01:31:15 -0800 (PST) Subject: Re: [PATCH v2 10/10] ArmVirtPkg: disable list length checks in NOOPT and DEBUG builds To: Laszlo Ersek , devel@edk2.groups.io Cc: Ard Biesheuvel , Julien Grall , Leif Lindholm , Sami Mujawar References: <20210113085453.10168-1-lersek@redhat.com> <20210113085453.10168-11-lersek@redhat.com> From: =?UTF-8?B?UGhpbGlwcGUgTWF0aGlldS1EYXVkw6k=?= Message-ID: <618ca873-d23d-7b0a-05eb-36f9e108bbd4@redhat.com> Date: Fri, 15 Jan 2021 10:31:14 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210113085453.10168-11-lersek@redhat.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit On 1/13/21 9:54 AM, Laszlo Ersek wrote: > In NOOPT and DEBUG builds, if "PcdMaximumLinkedListLength" is nonzero, > then several LIST_ENTRY *node* APIs in BaseLib compare the *full* list > length against the PCD. > > This turns the time complexity of node-level APIs from constant to linear, > and that of full-list manipulations from linear to quadratic. > > (See some example OVMF numbers in the previous patch.) > > Checking list lengths against an arbitrary maximum -- default value, and > current ArmVirtPkg setting: 1,000,000 -- seems useless even in NOOPT and > DEBUG builds, while the cost is significant; so set the PCD to 0. > > Cc: Ard Biesheuvel > Cc: Julien Grall > Cc: Leif Lindholm > Cc: Philippe Mathieu-Daudé > Cc: Sami Mujawar > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3152 > Signed-off-by: Laszlo Ersek > Acked-by: Ard Biesheuvel > --- > > Notes: > v2: > - no changes > - pick up Ard's A-b > > ArmVirtPkg/ArmVirt.dsc.inc | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Philippe Mathieu-Daude