From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id A5130D811AC for ; Fri, 1 Mar 2024 08:44:40 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=8YdPGQswSPHr9Vgbxznt60e3AN2TulML7Et81YojDIc=; c=relaxed/simple; d=groups.io; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:To:Cc:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding; s=20140610; t=1709282679; v=1; b=w3+VcOn//2uZ17A4u5Y1X/Ab1JrIeUMjn4nWo5mle5QFSQEyCzcmO3NLHmL4PmvBTXLkpGy5 a8pzL3oviWQrhuPeCyk7mb7N5KJl86Ipzwf2K8LCrX8UOoBsfQk+tALsub7d9BrsjOPiF20iIl6 OyeWztr7S2fI9+ipkfBqsIlU= X-Received: by 127.0.0.2 with SMTP id W9bvYY7687511xOYM3B35e40; Fri, 01 Mar 2024 00:44:39 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web10.18312.1709282678730899678 for ; Fri, 01 Mar 2024 00:44:38 -0800 X-Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-48-uaqp3dcJP3W9XhLPZhf6aA-1; Fri, 01 Mar 2024 03:44:36 -0500 X-MC-Unique: uaqp3dcJP3W9XhLPZhf6aA-1 X-Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-412add7c18fso8698585e9.2 for ; Fri, 01 Mar 2024 00:44:36 -0800 (PST) X-Gm-Message-State: SaCgQXd5mzhei5B7kRUomsrkx7686176AA= X-Received: by 2002:adf:fe87:0:b0:33d:e4c2:1d09 with SMTP id l7-20020adffe87000000b0033de4c21d09mr748107wrr.55.1709282675220; Fri, 01 Mar 2024 00:44:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IHJZRfr5VLzgi/Djkgna/hRsO7U/bTgussM3/SipCv1XkY51JYSi3/eTmDuxP00V+PMxwgx6cepYQJzRdADWxA= X-Received: by 2002:adf:fe87:0:b0:33d:e4c2:1d09 with SMTP id l7-20020adffe87000000b0033de4c21d09mr748092wrr.55.1709282674928; Fri, 01 Mar 2024 00:44:34 -0800 (PST) MIME-Version: 1.0 References: <20240229130246.3-1-ray.ni@intel.com> <20240229130246.3-3-ray.ni@intel.com> In-Reply-To: <20240229130246.3-3-ray.ni@intel.com> From: "Paolo Bonzini" Date: Fri, 1 Mar 2024 09:44:23 +0100 Message-ID: Subject: Re: [edk2-devel] [PATCH 2/2] MdeModulePkg/DxeCore: Fix stack overflow issue due to nested interrupts To: Ray Ni Cc: devel@edk2.groups.io, Michael D Kinney , Liming Gao , Laszlo Ersek , Michael Brown X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pbonzini@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b="w3+VcOn/"; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.com (policy=none) One fix is needed in the code. On Thu, Feb 29, 2024 at 2:04=E2=80=AFPM Ray Ni wrote: > + // > + // Save the "Interrupted TPL" (TPL that was interrupted). > + // > + mInterruptedTplMask |=3D (UINTN)(1 << gEfiCurrentTpl); > + } > } > + // > + // Clear interrupted TPL level mask, but do not re-enable interrup= ts here > + // This will return to CoreTimerTick() and interrupts will be re-e= nabled > + // when the timer interrupt handlers returns from interrupt contex= t. > + // > + ASSERT ((INTN)gEfiCurrentTpl =3D=3D HighBitSet64 (mInterruptedTplM= ask)); > + mInterruptedTplMask &=3D ~(UINTN)(1 << gEfiCurrentTpl); > + } > } Both of these need to use "1U" to avoid sign extending bit 31 into bits 31.= .63. The same issue is (in three places) present in my own version of the patch.= :( Paolo -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#116225): https://edk2.groups.io/g/devel/message/116225 Mute This Topic: https://groups.io/mt/104642317/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-