From nobody Sun Feb 8 09:49:09 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602755661; cv=none; d=zohomail.com; s=zohoarc; b=ASeHRgQHpr6KW4a668oQvB/GoOHpiz5fJ4IOOTwSF+Vc4KReoIdQCa6Dqw7BI91lGeJlJRCz5ANTHh4KY3FcHHr4OfOrwiDusITFtQOzkfbgprPeJtb5IQw0VnX6qVyn51hHDqa5qudMRLbm2OFIvog+9Y+SdLj8FLJkUg3i6Pw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602755661; h=Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To; bh=CVL1Lk008m2jM9jWCmddFEDDIVap1LQpxh1UQ+7A9gg=; b=PgDDWhQ5uUX1807WGZJWUqZxlP9VeCSowLUuEi05sIej9hhY7CVQZGEA7UyYYypPNMRWCOQ9f9KgrNvmVGEof1HnM2PG2a3AdXdy4sgKmk0jAxNQpRMjLpEjdH3AhO1kdOSHlgyv/rxEtyXy3v2Gg2YqxYJ1Lo1riNHToroKOxY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1602755661576435.8296204426664; Thu, 15 Oct 2020 02:54:21 -0700 (PDT) Received: from localhost ([::1]:33818 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kSzxk-0003x9-0p for importer@patchew.org; Thu, 15 Oct 2020 05:54:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46964) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kSzvP-0002Ta-G1 for qemu-devel@nongnu.org; Thu, 15 Oct 2020 05:51:55 -0400 Received: from mail-ej1-x642.google.com ([2a00:1450:4864:20::642]:43001) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kSzvN-0002k1-Vu for qemu-devel@nongnu.org; Thu, 15 Oct 2020 05:51:55 -0400 Received: by mail-ej1-x642.google.com with SMTP id h24so2666026ejg.9 for ; Thu, 15 Oct 2020 02:51:53 -0700 (PDT) Received: from localhost.localdomain ([194.230.155.110]) by smtp.gmail.com with ESMTPSA id ce15sm1249733ejc.39.2020.10.15.02.51.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Oct 2020 02:51:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=CVL1Lk008m2jM9jWCmddFEDDIVap1LQpxh1UQ+7A9gg=; b=gK4crFcwANGsVJhPtNVzbTFSGa9NjrI6btATKo8sjFUeYZyiuexJbQDNsNhrYzCD/6 uLctiKn9SYH4h0yaqi6shn4wmSaLxHFPyHclIE6k0gZH/7ojwaq9o3YnryZ+U0wh54K2 32WXs5Dt7I+7M72LUb6L+EBJE2xLKipa+9eZ8BsoksXgRGlni5vuBxyoN9LAho6tLDzL KuDijQX7EF3Q9iDb5kCKQaB+h3S2hgAFWa3GmGz5uKZitU5NUQN+OdoAL3R4w1wUxe/z mnP/9YdLuPS/9xxkMc5iz8xoQUud+aerR0BUnHNel0MPEkPZj8S4mMHI4rGTqgFtR+4S PSrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=CVL1Lk008m2jM9jWCmddFEDDIVap1LQpxh1UQ+7A9gg=; b=qQV+XbTnP/UEbI6CKX14YxZDPIGbkR1Xv3CdYb4r+ow86D4h500W2/ClEWaaw0/Rg0 fqeOWZR0LedSakmVoZtty2qpJroGrMMBLkt4jJ2znA1l00LLsqw92J3vCZwNcWCFNmEJ 72YVWwRO+p5vFw44RFSP44P0qmlKEzewlv9COynYPpGLa4nZsBftPmg3Ip7f7v2oyEmL MP09mssqcg2JrfnE9bdD3qA2CSWa64EN4ks9g+qBlsQZY17EURdGCV0SlBFehslHDazf reTQ4fVT1UYmx54A9I3Ea7qnhZ4bHjxceBlwaBUbMyDWrj6/uJpgvHTlho9w2C4v11Z9 nbQQ== X-Gm-Message-State: AOAM53265zHy+5GihyPuxlPbwu0sIpMzkoSz6WskPGq/XzjKWG7kJENj d/nj5VDo8XO0mayZHNySJ7SaYhLbvzFTLA== X-Google-Smtp-Source: ABdhPJynDQ54TkcoquvWvLTTalAkzeaCsDXmOEkrjPJ6oBf5A5leItOFkK20NaclPMaPdSxDaezPbg== X-Received: by 2002:a17:906:f11a:: with SMTP id gv26mr3402200ejb.13.1602755511240; Thu, 15 Oct 2020 02:51:51 -0700 (PDT) From: Emanuele Giuseppe Esposito To: qemu-devel@nongnu.org Subject: [PATCH] loads-stores.rst: add footnote that clarifies GETPC usage Date: Thu, 15 Oct 2020 11:51:47 +0200 Message-Id: <20201015095147.1691-1-e.emanuelegiuseppe@gmail.com> X-Mailer: git-send-email 2.17.1 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::642; envelope-from=e.emanuelegiuseppe@gmail.com; helo=mail-ej1-x642.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Richard Henderson , Emanuele Giuseppe Esposito , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Current documentation is not too clear on the GETPC usage. In particular, when used outside the top level helper function it causes unexpected behavior. Signed-off-by: Emanuele Giuseppe Esposito --- docs/devel/loads-stores.rst | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/devel/loads-stores.rst b/docs/devel/loads-stores.rst index 9a944ef1af..59c1225391 100644 --- a/docs/devel/loads-stores.rst +++ b/docs/devel/loads-stores.rst @@ -93,7 +93,13 @@ guest CPU state in case of a guest CPU exception. This = is passed to ``cpu_restore_state()``. Therefore the value should either be 0, to indicate that the guest CPU state is already synchronized, or the result of ``GETPC()`` from the top level ``HELPER(foo)`` -function, which is a return address into the generated code. +function, which is a return address into the generated code [#gpc]_. + +.. [#gpc] Note that ``GETPC()`` should be used with great care: calling + it in other functions that are *not* the top level + ``HELPER(foo)`` will cause unexpected behavior. Instead, the + value of ``GETPC()`` should be read from the helper and passed + if needed to the functions that the helper calls. =20 Function names follow the pattern: =20 --=20 2.17.1