From patchwork Mon Oct 14 10:49:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 11188257 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CB561912 for ; Mon, 14 Oct 2019 10:56:17 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A0E3A207FF for ; Mon, 14 Oct 2019 10:56:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="XGLIPR6X" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A0E3A207FF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:47016 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iJy1Q-0005m0-G4 for patchwork-qemu-devel@patchwork.kernel.org; Mon, 14 Oct 2019 06:56:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44565) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iJxvP-0007OU-S9 for qemu-devel@nongnu.org; Mon, 14 Oct 2019 06:50:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iJxvO-00069H-GY for qemu-devel@nongnu.org; Mon, 14 Oct 2019 06:50:03 -0400 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:39768) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iJxvO-00064l-9R for qemu-devel@nongnu.org; Mon, 14 Oct 2019 06:50:02 -0400 Received: by mail-wr1-x442.google.com with SMTP id r3so19147941wrj.6 for ; Mon, 14 Oct 2019 03:49:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=E4BbTLUhgH0gtmNgtyAxk8tGYN84mDNVyOEt1ck3Wbk=; b=XGLIPR6Xsw7LwxRHkhq6p6RCCGAAm7ICoPIEhGXbcTHBpVYqraazUia9Pj2fIzwWpg oM3eR8Mv5FfnFtsK0Jnu86/HgrT+H3PE/rzFuny+t0WlLcDidPh84I9aTeq8UTy4e7I+ eBBVMsS6JniwfLc/ZdRc4DrZVl0QnNX+VUIECqSCkRDKZdMe28TmmscKR5QYkPkeLomn NrbPBHyApHqpaJmrQpvpjKYRBnq0ohdlpMUUR6IFi/aOzC08nGss3BF/hgcS+yOCdiEP wBtHCC6Vzp27CT2eGWFBOsIqoddYD5M11c+85uzcjTwAF2vjae6aP2KlFmPvtvZJsCHk uW5w== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=E4BbTLUhgH0gtmNgtyAxk8tGYN84mDNVyOEt1ck3Wbk=; b=fD5tvOPo/oVZ//0mt/hS8MId1CMHVK26aVCvO9F2iLfkiU474dLpN1fCZbzBXqru4+ 4IhglMvlQoEg2rn42JqK8tY0PQY6Cba6zmgjVnZRlbiz6GOW+2l3dRxpBECINkGDsFIo MAmnF07juhl+pr9P5bxy73KoAotvE1RYED6noa3kR+YsXeUMRcCyDluNRAghkZ7E1NQR 0bnHIpSukRFFPxoXVjpPr7GfXbObxi2gKXmwziXTdi5iutNcTpLvXp8HGdI7pJaa2Iie Vz7G+f0sx+3AG3OgtQT0LrVOp2jWnm50lv26qqREobKNHa2SuwyCsryVDy4fTe+5TbPU Zg1g== X-Gm-Message-State: APjAAAVx2uyfdiAG+972mhefADA0pT+INVsYKUd8sW18UMdzm1NtK+fn HDZpal0j/rGUKs8xYCokXgsAiQ== X-Google-Smtp-Source: APXvYqzGKxdU6dRo7lGVZH95cJ622idO93uFEidxtXtRsWnze9lVMTd1lLlpxBFzXkDtoYVIqhWvpg== X-Received: by 2002:a5d:638b:: with SMTP id p11mr18986022wru.372.1571050198810; Mon, 14 Oct 2019 03:49:58 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id y13sm26345055wrg.8.2019.10.14.03.49.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2019 03:49:54 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 810321FF99; Mon, 14 Oct 2019 11:49:51 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v5 11/55] cputlb: document get_page_addr_code Date: Mon, 14 Oct 2019 11:49:04 +0100 Message-Id: <20191014104948.4291-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191014104948.4291-1-alex.bennee@linaro.org> References: <20191014104948.4291-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::442 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: robert.foley@futurewei.com, Richard Henderson , peter.puhov@futurewei.com, aaron@os.amperecomputing.com, cota@braap.org, Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Suggested-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- include/exec/exec-all.h | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 49db07ba0b..6352316de1 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -487,7 +487,15 @@ void mmap_lock(void); void mmap_unlock(void); bool have_mmap_lock(void); -static inline tb_page_addr_t get_page_addr_code(CPUArchState *env1, target_ulong addr) +/** + * get_page_addr_code() - user-mode version + * @env: CPUArchState + * @addr: guest virtual address of guest code + * + * Returns @addr. + */ +static inline tb_page_addr_t get_page_addr_code(CPUArchState *env, + target_ulong addr) { return addr; } @@ -495,8 +503,18 @@ static inline tb_page_addr_t get_page_addr_code(CPUArchState *env1, target_ulong static inline void mmap_lock(void) {} static inline void mmap_unlock(void) {} -/* cputlb.c */ -tb_page_addr_t get_page_addr_code(CPUArchState *env1, target_ulong addr); +/** + * get_page_addr_code() - full-system version + * @env: CPUArchState + * @addr: guest virtual address of guest code + * + * If we cannot translate and execute from the entire RAM page, or if + * the region is not backed by RAM, returns -1. Otherwise, returns the + * ram_addr_t corresponding to the guest code at @addr. + * + * Note: this function can trigger an exception. + */ +tb_page_addr_t get_page_addr_code(CPUArchState *env, target_ulong addr); void tlb_reset_dirty(CPUState *cpu, ram_addr_t start1, ram_addr_t length); void tlb_set_dirty(CPUState *cpu, target_ulong vaddr);