From patchwork Mon May 27 00:49:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 799186 Delivered-To: patch@linaro.org Received: by 2002:a5d:6a47:0:b0:354:fb4b:99cd with SMTP id t7csp1657777wrw; Sun, 26 May 2024 17:51:13 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUqYOq6sCLN6E5Vezm+UDhkdAo1WRUTMnV3dwXwNHH591xn7aGleA2VlLo8cHGstXn31cwYqabf1FlfXHzw0EcM X-Google-Smtp-Source: AGHT+IFLgcmE7wgJeukp89hMzzxsQf+R9pIfJmi5mEqbSJjN2EhW+I62DpMnp3owOLnd/xlZUbH9 X-Received: by 2002:a05:6808:309e:b0:3c6:d31:757b with SMTP id 5614622812f47-3d1a7938000mr10214507b6e.49.1716771073280; Sun, 26 May 2024 17:51:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716771073; cv=none; d=google.com; s=arc-20160816; b=SjM+si/AqCQnSVTWxl20SkfUJJKvAmGMbP6UJNQWxyIDxtuUn23TK+s6xEcv9qyeHb eWWjDKq0VXRxjraX8liJ6oUmLR+9/wR4oscLi1PRl9w6SZrcQq48kjF/YbcUHfaDOQAZ UqBpir0i3NZJ+rHShm2EQzPtFuo55l8Xfc1Bbv6gsOwiz/OQIlqKRXfaIuG9368SZvm8 kRoZ7noRAR7oVlpC1o1TEmT3Rj+p3+iLq2eO/emRTPZ/ua5x2/yYyeb9/TnaCCdM9aJn YdQSM/OzhhcUBAhJIGRRzmkXQdtLmZN5o7CY+1aw8AY02ED8d9H9C7I2ORaXOGmotiwO LGbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=KDDtUfw/mczHul15uHGYjteOGPBpu+USO8s2KogQRUY=; fh=OTkfrEnbNDInppsfj4HB8z6V33zCj7LOct256XBfW6M=; b=Ihe9uGT9gqIqzmNc+509RbouZYvD94KkPAUWFFKKIz6OHl4CisrDxjcujTRusrXQyO 9/jaVoKQwar55sVvs3NgVOl03c4YmXXRkuodNpbzMkEGgA99jc1amlD5wwMicMXwrFUW vKw3lEP8QLO+qc/gYa9qn5p+Q3fmMlYkRX30WW1nH/e4w2Ohk8XH4pFt7e7VbROriX/K PmwmXuanjh6wzKSO4DlEuL7vK5yAuiIm6Fu8uI6I+ZoMDCc2YvCZ2Se5yeVBQXBOV8c9 CTTo9xYbSqGzIx8FvHwdTaY6v182WZSd6TlpqVI/pzQKv1wgew3UQPop75hCzmuxdLoG XzFg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=HoyXytj9; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-43fb18a6deasi71118041cf.296.2024.05.26.17.51.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 26 May 2024 17:51:13 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=HoyXytj9; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sBOZM-0007HR-Nq; Sun, 26 May 2024 20:50:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sBOZI-0007Cn-Ny for qemu-devel@nongnu.org; Sun, 26 May 2024 20:50:29 -0400 Received: from mail-oa1-x2c.google.com ([2001:4860:4864:20::2c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sBOZ4-0003bj-7L for qemu-devel@nongnu.org; Sun, 26 May 2024 20:50:21 -0400 Received: by mail-oa1-x2c.google.com with SMTP id 586e51a60fabf-24ca0876a83so1543460fac.2 for ; Sun, 26 May 2024 17:50:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716771013; x=1717375813; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KDDtUfw/mczHul15uHGYjteOGPBpu+USO8s2KogQRUY=; b=HoyXytj9WCZgFOFG/M+aGfS+1VXHTPPm0rZRZpOgL6Fs67FCC81CzWG7tYoZ2mlhsJ NNMlbhuuajZ4CzICywFFf5KFTLNhVFh6PFOZqV9eTqqnSV5wnhS8goy1b+08hRrq6vMA YuXNbb1REoq0JO0//gXsj1oEE/cP3vM2y36VtRO/AJL7TuNft0airRWIX67yR8zdKv6c /rc/eS/OBTcEdEgQb/ncniFMnImdr8zi5w09PV08kP04VaF82SVoNuFKUW7LzXVy6d3v 5xjtjIyrqM4uZJdOo2MF0fsuR/tdR6Tb5UqbNjtUPe59+wstvBjiE3F+IvA2tY70djFu FE6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716771013; x=1717375813; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KDDtUfw/mczHul15uHGYjteOGPBpu+USO8s2KogQRUY=; b=VdbZxnEeAq9GPEGmUc7cAwejW5RQM0zj38DiOsudSjaCHVFSZx+qQlNxJv6F9uviBY IuCwA85kvcqI8Lm8q1MY73fMhNSTXzvcjDXYR/xmkfPUfrJJwjjNAi1eZJAPgJ7AP+5g jB8GLNz8VFNe2hJ3hhcn6Qcmm+rucoa789JcwHrp4C+VSqph2kevCBlYx/zKHylGpKp2 Q0wSLop/CINLzNUda2jQdObCCZdC+qjtBANfiSOHWqoUNVq1esZGRn8SSF6cSz66o3ct KCWgQEmzVOwX+3ekZO37aafDTaVTHWt38WlblBABfKXs8M+MRjmkTfMsnJN2VHX8x0BZ uH5w== X-Gm-Message-State: AOJu0Yz4eYe/dL6zKPmC6B1ip7LWUcUjb+V7dd41Cw//ixXU1FbVNRX1 6KppuUKYSUdOzMh1WcBMgw/07D9u7v1R266/eEA7qgXm0VgsRw3+i4BfrXCHAXgnD85M/2jxfeJ x X-Received: by 2002:a05:6870:472c:b0:24c:b2d9:77af with SMTP id 586e51a60fabf-24cb2d9a877mr7671954fac.19.1716771012979; Sun, 26 May 2024 17:50:12 -0700 (PDT) Received: from stoup.. (174-21-72-5.tukw.qwest.net. [174.21.72.5]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f8fd6d7598sm3942958b3a.220.2024.05.26.17.50.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 May 2024 17:50:12 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Paolo Bonzini Subject: [PULL 13/28] target/i386: Add rbfm argument to cpu_x86_{xsave, xrstor} Date: Sun, 26 May 2024 17:49:46 -0700 Message-Id: <20240527005001.642825-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240527005001.642825-1-richard.henderson@linaro.org> References: <20240527005001.642825-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2001:4860:4864:20::2c; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x2c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org For now, continue to pass all 1's from signal.c. Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target/i386/cpu.h | 4 ++-- linux-user/i386/signal.c | 4 ++-- target/i386/tcg/fpu_helper.c | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index c500a69a69..91170a088a 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -2262,8 +2262,8 @@ void cpu_x86_fsave(CPUX86State *s, target_ulong ptr, int data32); void cpu_x86_frstor(CPUX86State *s, target_ulong ptr, int data32); void cpu_x86_fxsave(CPUX86State *s, target_ulong ptr); void cpu_x86_fxrstor(CPUX86State *s, target_ulong ptr); -void cpu_x86_xsave(CPUX86State *s, target_ulong ptr); -void cpu_x86_xrstor(CPUX86State *s, target_ulong ptr); +void cpu_x86_xsave(CPUX86State *s, target_ulong ptr, uint64_t rbfm); +void cpu_x86_xrstor(CPUX86State *s, target_ulong ptr, uint64_t rbfm); /* cpu.c */ void x86_cpu_vendor_words2str(char *dst, uint32_t vendor1, diff --git a/linux-user/i386/signal.c b/linux-user/i386/signal.c index 990048f42a..824375d42a 100644 --- a/linux-user/i386/signal.c +++ b/linux-user/i386/signal.c @@ -268,7 +268,7 @@ static void xsave_sigcontext(CPUX86State *env, struct target_fpstate_fxsave *fxs /* Zero the header, XSAVE *adds* features to an existing save state. */ memset(fxsave->xfeatures, 0, 64); - cpu_x86_xsave(env, fxsave_addr); + cpu_x86_xsave(env, fxsave_addr, -1); __put_user(TARGET_FP_XSTATE_MAGIC1, &fxsave->sw_reserved.magic1); __put_user(extended_size, &fxsave->sw_reserved.extended_size); __put_user(env->xcr0, &fxsave->sw_reserved.xfeatures); @@ -569,7 +569,7 @@ static int xrstor_sigcontext(CPUX86State *env, struct target_fpstate_fxsave *fxs return 1; } if (tswapl(*(uint32_t *) &fxsave->xfeatures[xfeatures_size]) == TARGET_FP_XSTATE_MAGIC2) { - cpu_x86_xrstor(env, fxsave_addr); + cpu_x86_xrstor(env, fxsave_addr, -1); return 0; } } diff --git a/target/i386/tcg/fpu_helper.c b/target/i386/tcg/fpu_helper.c index 6a319dadf2..a09d6aaf07 100644 --- a/target/i386/tcg/fpu_helper.c +++ b/target/i386/tcg/fpu_helper.c @@ -3047,14 +3047,14 @@ void cpu_x86_fxrstor(CPUX86State *env, target_ulong ptr) do_fxrstor(&ac, ptr); } -void cpu_x86_xsave(CPUX86State *env, target_ulong ptr) +void cpu_x86_xsave(CPUX86State *env, target_ulong ptr, uint64_t rfbm) { - do_xsave(env, ptr, -1, get_xinuse(env), -1, 0); + do_xsave(env, ptr, rfbm, get_xinuse(env), -1, 0); } -void cpu_x86_xrstor(CPUX86State *env, target_ulong ptr) +void cpu_x86_xrstor(CPUX86State *env, target_ulong ptr, uint64_t rfbm) { - do_xrstor(env, ptr, -1, 0); + do_xrstor(env, ptr, rfbm, 0); } #endif