Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1623245imm; Tue, 22 May 2018 06:59:39 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoxGM8S5Jb2sMWnlOMI32adQdyKZ2x+3c/UnUApnCsNuArE1mhoLDZMzhuFCrpbfPGwQnvp X-Received: by 2002:a17:902:6181:: with SMTP id u1-v6mr24478863plj.272.1526997579868; Tue, 22 May 2018 06:59:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526997579; cv=none; d=google.com; s=arc-20160816; b=RG2C9bvLKMyv6nT1xng5butTApHJpXrIf1mYnDJzVCoV5D0oV+goi3YAkLhWBRGxx1 xubPRyEd+RYpaZn2Od94ixDPUV7UWsnvWOOnRN149MTRGZnCNBKMdiDqr8JXuz3lX8iH e/8etBjd0zmAQeDjYAQkRXNOFQfCTX6R8H2iO9lwBvHCaPbwN7nlAMQKuKOavxFM0gz2 jol1Zh3iSQcPqwwGzqgxJIeui+3lHH3c1DAlvC0hEVZYClKE40K+iwYdpBcu+awUIZqI rPJ2NOx8sE1a8R802BEL2sBY5erG+Hmm0udJ/UdgEhg+SxguTS3tuXljBpNK/KBoNLgd tw5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:in-reply-to:references :subject:cc:to:from:date:message-id:arc-authentication-results; bh=EXpsv3QU9ksCz62BxWF9d7tGlfC5mHa8qOGsswscCrw=; b=cVBzcnqPBweEu8pP8R0+Y9x+/TpvdPBPGOhTl0VyrqpFqw/aP0GBUioxhetbQAOLqg uzg/LyA5JqSAmqNsZdqnD+WRfF0mZHbqzaiosRe2vk7fM6XBd0HkqIB1OOrOPmoEOaDA mZAcv5dA2lESo7TCGcRJZma6OXw0QBZTxrc06/wJmaFErSd2ZrbO34oPsL1VtioBN0Gx T2EWhtDMko7G7ZFFrk7lcTFv0o2d8eEDwyE8GtFie7UGzphOYklh0LmlFRCJG23VUgKs DQx67Vhd3ayrUbd3S25obKx+oFlyD9JY+KSGzWizdd5Se2xRl3aOFu1BrBMX/nT9DPE4 EIBg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n187-v6si2248511pga.267.2018.05.22.06.59.25; Tue, 22 May 2018 06:59:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751656AbeEVN6H convert rfc822-to-8bit (ORCPT + 99 others); Tue, 22 May 2018 09:58:07 -0400 Received: from prv1-mh.provo.novell.com ([137.65.248.33]:48485 "EHLO prv1-mh.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751613AbeEVN6B (ORCPT ); Tue, 22 May 2018 09:58:01 -0400 Received: from INET-PRV1-MTA by prv1-mh.provo.novell.com with Novell_GroupWise; Tue, 22 May 2018 07:58:00 -0600 Message-Id: <5B0421E502000078001C4B91@prv1-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 18.0.0 Date: Tue, 22 May 2018 07:57:57 -0600 From: "Jan Beulich" To: Cc: "xen-devel" , "Boris Ostrovsky" , "Juergen Gross" , Subject: Re: [PATCH v4 1/2] xen/PVH: Set up GS segment for stack canary References: <20180522035445.16911-1-boris.ostrovsky@oracle.com> <20180522035445.16911-2-boris.ostrovsky@oracle.com> In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8BIT Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >>> On 22.05.18 at 15:45, wrote: > On Mon, May 21, 2018 at 11:54 PM, Boris Ostrovsky wrote: >> @@ -98,6 +101,12 @@ ENTRY(pvh_start_xen) >> /* 64-bit entry point. */ >> .code64 >> 1: >> + /* Set base address in stack canary descriptor. */ >> + mov $MSR_GS_BASE,%ecx >> + mov $canary, %rax >> + cdq >> + wrmsr > > CDQ only sign-extends EAX to RAX. What you really want is to move the > high 32-bits to EDX (or zero EDX if we can guarantee it is loaded > below 4G). What you describe is CDQE (AT&T name: CLTD); CDQ (AT&T: CLTQ) sign-extends EAX to EDX:EAX. Jan