From patchwork Fri Dec 14 03:19:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 153723 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1603298ljp; Thu, 13 Dec 2018 19:34:32 -0800 (PST) X-Google-Smtp-Source: AFSGD/VdBha1bQJnV40psgeDEm/zx9CRpFgHSSYgNUaBNAvjoq3wCrGlC6dVofHsUb+BhSP190r/ X-Received: by 2002:a37:7cc5:: with SMTP id x188mr1095430qkc.307.1544758472548; Thu, 13 Dec 2018 19:34:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544758472; cv=none; d=google.com; s=arc-20160816; b=O7/RC2uZoIqaqef7tftblBj4QsFCZ96IMfY0xV3SDu6LziBaLpmx6MAbRUXB3KxaTa JBZfbR4NatN8gdDd0maW58QzEKs81TZznSG3gExobDjozliqN+cABQStNsVHWHOKQi/P wSz+yzSxx9YhVPipsgOgtIsBe2pXvF7TQdRjf2iJeaLar4Do2k66tEcOF/h1zTmaUyuU F8ynANi0Az8D4Dfe3+Ok+RE6v9A9srHG2M/U/x0xT3uJxJTWiIKswy9ZhyyZJalKAa10 sMXT4ktgFwzwdxKHOYjTe6FN8N81cRcA3JfDNZOlVU8dOFEjMIpUL2YkRCtzrZTOQ9yD 6+4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=uVZMeAEuQkuDfx0GTso68uP/IjGxBfXPVSvp3EKoquc=; b=yCPTZNWYgLGdoItmXZlc8iZ4+vAOyQz6HggscQPZGw1H8QlGMngDvR2/Bb6P8xVBH0 lNu2ziuXeFvsw6+DMQy6BnAhNByNEFKvjVPH0lsOC8RHGjpPkCAvDNchhCxX2wa3f/lW Dly0CDeFK+gOWOD/Bxm69hmHBjYFqvzIvSxkDscNns2hQ0F2upJbGYXLdMU4txPYV7NZ inUJz8QnrCXX8LandpUkX+66EeLOtYlMkTcKXF6yvwD9wzdTg3CS8CRCkgEce+2hglQJ FTXMMtHfIRWDymG1OxO/5qvY8RWhlqWCYjC27j+YU0dZJTiCJz4iPs47BbTipVrUhszz 048g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=IlYfe1SY; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id x9si2079155qkf.220.2018.12.13.19.34.32 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 13 Dec 2018 19:34:32 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=IlYfe1SY; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:59125 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXeFE-00018K-26 for patch@linaro.org; Thu, 13 Dec 2018 22:34:32 -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) 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-Received: by 2002:aca:4ac9:: with SMTP id x192mr761519oia.211.1544757591071; 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) 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Emilio G. Cota Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.inc.c | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.17.2 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) == 0) { + return P_GS; + } + return 0; +} # else static inline int setup_guest_base_seg(void) {