From nobody Tue Apr 15 03:09:24 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544758413876135.2530158709094; Thu, 13 Dec 2018 19:33:33 -0800 (PST) Received: from localhost ([::1]:59125 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXeE9-00018K-C6 for importer@patchew.org; Thu, 13 Dec 2018 22:33:25 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58918) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXe1B-0006FP-1e for qemu-devel@nongnu.org; Thu, 13 Dec 2018 22:20:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXe18-0007Xn-2q for qemu-devel@nongnu.org; Thu, 13 Dec 2018 22:19:59 -0500 Received: from mail-oi1-x22a.google.com ([2607:f8b0:4864:20::22a]:45953) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gXe16-0007Ha-6R for qemu-devel@nongnu.org; Thu, 13 Dec 2018 22:19:56 -0500 Received: by mail-oi1-x22a.google.com with SMTP id y1so3443316oie.12 for ; Thu, 13 Dec 2018 19:19:51 -0800 (PST) Received: from cloudburst.twiddle.net ([187.217.227.243]) by smtp.gmail.com with ESMTPSA id g138sm2367537oib.26.2018.12.13.19.19.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Dec 2018 19:19:50 -0800 (PST) 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; bh=uVZMeAEuQkuDfx0GTso68uP/IjGxBfXPVSvp3EKoquc=; b=IlYfe1SY91b0MEf95aYTJkB5tdTE0m+SWLNaCXUB8ncOk+47QZHy7nIPBfa1xI1X9d nYXl+7fCtnGQXd3hyfw/FRhQ70pma0eIClXisqYz2bhdSGuUyxxs4vsIhFz4D01A9XUg +29N5dmy9tSICHKgyY/wukPQunRvInLNaeZcI= 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; bh=uVZMeAEuQkuDfx0GTso68uP/IjGxBfXPVSvp3EKoquc=; b=bR7eL6AlC2nznS4mCligAIA8LdvbuXwvh52pGu21TdTUnl5amSYx3I/odBdDR1F8PS lr/T+XPFU1AOfDPnT+7Som5gZFqgDaNd80fzOB3s5outFWPFHWjC3D5vwANPt80vfa8q qyGXaAFTb2ERU61P9yCdpXoCE7mEZ3NsJQuESEP92jiNh2waZoHeLA301D+i9FZzemWx zrY211tKFYflfQ1bWtjUVrdPlWJtpgDXzEbL1SJNDVokBCNj+7Aggelv9f41Ip9hvHFy kBVZtCuYKHgKvjsGWWIjZQzmINDM3MrqRlDAw0gRZXj3V84Nl3lAN7Fwrxov6P+gcrTh AtNQ== X-Gm-Message-State: AA+aEWYijRNENinSaG+JTd3UHj/2MYeD9wodUpinGaIMV7uX1oVQDUvq EZSbGVCIQX6WWuoy/dmLagj6Kkxei/yavQ== X-Google-Smtp-Source: AFSGD/VSb6XzDDDSNImPdbhpgVuVEpJpzZ+N3cJ36KCZyOUqOJdZrMZtEwhLirZLINv4ujHeHd+tGg== X-Received: by 2002:aca:4ac9:: with SMTP id x192mr761519oia.211.1544757591071; Thu, 13 Dec 2018 19:19:51 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 21:19:13 -0600 Message-Id: <20181214031923.29527-24-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181214031923.29527-1-richard.henderson@linaro.org> References: <20181214031923.29527-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::22a Subject: [Qemu-devel] [PULL 22/32] tcg/i386: Add setup_guest_base_seg for FreeBSD X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org 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" Reviewed-by: Emilio G. Cota Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.inc.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tcg/i386/tcg-target.inc.c b/tcg/i386/tcg-target.inc.c index 3fb2f4b971..c21c3272f2 100644 --- a/tcg/i386/tcg-target.inc.c +++ b/tcg/i386/tcg-target.inc.c @@ -1876,6 +1876,15 @@ static inline int setup_guest_base_seg(void) } return 0; } +# elif defined (__FreeBSD__) || defined (__FreeBSD_kernel__) +# include +static inline int setup_guest_base_seg(void) +{ + if (sysarch(AMD64_SET_GSBASE, &guest_base) =3D=3D 0) { + return P_GS; + } + return 0; +} # else static inline int setup_guest_base_seg(void) { --=20 2.17.2