Re: [Xen-devel] [PATCH] xen: Fix possible user space selector corruption

2013-10-03 Thread Andrew Cooper
is set to ds and es. > > This is quite hard to detect cause after a while these selectors are fixed > (__USER_DS seems sticky). > > Bisecting the code commit 7076aada1040de4ed79a5977dbabdb5e5ea5e249 appears > to be the first one that have this issue. > > Signed-off-by: F

Re: [Xen-devel] [PATCH] xen: Fix possible user space selector corruption

2013-10-04 Thread Andrew Cooper
On 04/10/13 14:20, Konrad Rzeszutek Wilk wrote: > On Thu, Oct 03, 2013 at 01:51:32PM +0100, Frediano Ziglio wrote: >> On Thu, 2013-10-03 at 11:04 +0100, Andrew Cooper wrote: >>> On 03/10/13 09:24, Frediano Ziglio wrote: >>>> >>>> Bisecting the code commi

Re: [PATCH v2] xen: Fix possible user space selector corruption

2013-10-07 Thread Andrew Cooper
set to ds and es. > > This is quite hard to detect cause after a while these selectors are fixed > (__USER_DS seems sticky). > > Bisecting the code commit 7076aada1040de4ed79a5977dbabdb5e5ea5e249 appears > to be the first one that have this issue. > > Signed-off-by:

Re: [PATCH v3 00/11] xen: Initial kexec/kdump implementation

2012-12-27 Thread Andrew Cooper
On 27/12/2012 07:53, Eric W. Biederman wrote: > The syscall ABI still has the wrong semantics. > > Aka totally unmaintainable and umergeable. > > The concept of domU support is also strange. What does domU support even > mean, when the dom0 support is loading a kernel to pick up Xen when Xen fall

Re: [Xen-devel] [PATCH v3 00/11] xen: Initial kexec/kdump implementation

2013-01-02 Thread Andrew Cooper
On 27/12/12 18:02, Eric W. Biederman wrote: Andrew Cooper writes: On 27/12/2012 07:53, Eric W. Biederman wrote: The syscall ABI still has the wrong semantics. Aka totally unmaintainable and umergeable. The concept of domU support is also strange. What does domU support even mean, when

Re: [PATCH v2 01/11] kexec: introduce kexec_ops struct

2012-11-22 Thread Andrew Cooper
ng memory, and possibly get corrupt. > > -hpa > I agree that regular guests should not be using the kexec/kdump. However, this patch series is required for allowing a pvops kernel to be a crash kernel for Xen, which is very important from dom0/Xen's point of view. -- Andrew Cooper

Re: [PATCH v2 01/11] kexec: introduce kexec_ops struct

2012-11-22 Thread Andrew Cooper
On 22/11/2012 17:47, H. Peter Anvin wrote: > The other thing that should be considered here is how utterly > preposterous the notion of doing in-guest crash dumping is in a system > that contains a hypervisor. The reason for kdump is that on bare metal > there are no other options, but in a hyp

Re: [PATCH v2 01/11] kexec: introduce kexec_ops struct

2012-11-22 Thread Andrew Cooper
On 23/11/2012 01:38, H. Peter Anvin wrote: > I still don't really get why it can't be isolated from dom0, which would make > more sense to me, even for a Xen crash. > The crash region (as specified by crashkernel= on the Xen command line) is isolated from dom0. dom0 (using the kexec utility etc)

[PATCH] xen: Fix stack corruption in xen_failsafe_callback for 32bit PVOPS guests.

2013-01-16 Thread Andrew Cooper
(xen: Core Xen implementation), in 2.6.23. Signed-off-by: Frediano Ziglio Signed-off-by: Andrew Cooper Cc: sta...@vger.kernel.org --- Cc: oss-secur...@lists.openwall.com Cc: Konrad Rzeszutek Wilk Cc: xen-de...@lists.xen.org Cc: secur...@xen.org --- arch/x86/kernel/entry_32.S |1 - 1 files

Re: [Xen-devel] [PATCH v3 00/11] xen: Initial kexec/kdump implementation

2013-01-07 Thread Andrew Cooper
On 07/01/13 10:25, Ian Campbell wrote: On Fri, 2013-01-04 at 19:11 +, Konrad Rzeszutek Wilk wrote: On Fri, Jan 04, 2013 at 06:07:51PM +0100, Daniel Kiper wrote: Because current KEXEC_CMD_kexec_load does not load kernel image and other things into Xen memory. It means that it should live som

Re: [Xen-devel] [GIT PULL] xen: features and fixes for 4.8-rc0

2016-07-27 Thread Andrew Cooper
On 27/07/16 19:42, Linus Torvalds wrote: > On Wed, Jul 27, 2016 at 6:45 AM, David Vrabel wrote: >> Shannon Zhao (16): >> Xen: ACPI: Hide UART used by Xen > So this caused a trivial conflict. No biggie, it wasn't bad and the > patch was acked by Rafael. However, looking at it made me somewhat

Re: [Xen-devel] [GIT PULL] xen: features and fixes for 4.8-rc0

2016-07-27 Thread Andrew Cooper
On 28/07/2016 00:46, Rafael J. Wysocki wrote: > On Wednesday, July 27, 2016 04:18:32 PM Linus Torvalds wrote: >> On Wed, Jul 27, 2016 at 4:09 PM, Rafael J. Wysocki >> wrote: >>> The STAO definition document: >>> >>> http://wiki.xenproject.org/mediawiki/images/0/02/Status-override-table.pdf >>> >>

Re: [PATCH] prctl,x86 Add PR_[GET|SET]_CPUID for controlling the CPUID instruction.

2016-09-14 Thread Andrew Cooper
On 14/09/2016 20:23, Boris Ostrovsky wrote: > On 09/14/2016 02:52 PM, Andy Lutomirski wrote: >> On Tue, Sep 13, 2016 at 11:13 PM, Kyle Huey wrote: >>> On Mon, Sep 12, 2016 at 9:56 AM, Andy Lutomirski >>> wrote: You should explicitly check that, if the feature is set under Xen PV, then

Re: [PATCH] prctl,x86 Add PR_[GET|SET]_CPUID for controlling the CPUID instruction.

2016-09-14 Thread Andrew Cooper
On 14/09/2016 19:52, Andy Lutomirski wrote: > On Tue, Sep 13, 2016 at 11:13 PM, Kyle Huey wrote: >> On Mon, Sep 12, 2016 at 9:56 AM, Andy Lutomirski wrote: >>> You should explicitly check that, if the >>> feature is set under Xen PV, then the MSR actually works as >>> advertised. This may requir

Re: [PATCH] prctl,x86 Add PR_[GET|SET]_CPUID for controlling the CPUID instruction.

2016-09-14 Thread Andrew Cooper
On 14/09/2016 20:36, Andy Lutomirski wrote: > On Wed, Sep 14, 2016 at 12:28 PM, Andrew Cooper > wrote: >> On 14/09/2016 20:23, Boris Ostrovsky wrote: >>> On 09/14/2016 02:52 PM, Andy Lutomirski wrote: >>>> On Tue, Sep 13, 2016 at 11:13 PM, Kyle Huey wrote: >

Re: [Xen-devel] [PATCH 2/2] x86/xen/efi: Init only efi struct members used by Xen

2017-06-21 Thread Andrew Cooper
On 20/06/2017 21:14, Daniel Kiper wrote: > Current approach, wholesale efi struct initialization from efi_xen, is not > good. Usually if new member is defined then it is properly initialized in > drivers/firmware/efi/efi.c but not in arch/x86/xen/efi.c. As I saw it happened > a few times until now.

Re: [Xen-devel] [PATCH v2 1/2] doc, xen: document hypervisor sysfs nodes for xen

2017-05-26 Thread Andrew Cooper
On 26/05/17 13:56, Juergen Gross wrote: > Today only a few sysfs nodes under /sys/hypervisor/ are documented > for Xen in Documentation/ABI/testing/sysfs-hypervisor-pmu. > > Add the remaining Xen sysfs nodes under /sys/hypervisor/ in a new > file Documentation/ABI/stable/sysfs-hypervisor-xen and ad

Re: [Xen-devel] ce56a86e2a ("x86/mm: Limit mmap() of /dev/mem to valid physical addresses"): kernel BUG at arch/x86/mm/physaddr.c:79!

2017-10-26 Thread Andrew Cooper
On 26/10/17 20:29, Sander Eikelenboom wrote: > On 26/10/17 19:49, Craig Bergstrom wrote: >> Sander, thanks for the details, they've been very useful. >> >> I suspect that your host system's mem=2048M parameter is causing the >> problem. Any chance you can confirm by removing the parameter and >> r

Re: [Xen-devel] [RFC PATCH] Use vAPIC when doing IPI for PVHVM guests.

2015-10-08 Thread Andrew Cooper
On 08/10/15 06:05, Juergen Gross wrote: > On 10/07/2015 10:21 PM, Konrad Rzeszutek Wilk wrote: >> Hey, >> >> I was running some tools in which we would heavily do rescheduling >> of events - and realized to my surprise that the event channels (and >> the hypercall) would slow things down. If I used

Re: [PATCH v2 5/5] x86/pti: Do not enable PTI on fixed Intel processors

2018-01-23 Thread Andrew Cooper
On 23/01/18 18:45, Alan Cox wrote: > On Tue, 23 Jan 2018 16:52:55 + > David Woodhouse wrote: > >> When they advertise the IA32_ARCH_CAPABILITIES MSR and it has the RDCL_NO >> bit set, they don't need KPTI either. > This is starting to get messy because we will eventually need to integrate > >

Re: [Xen-devel] HPET enabled in BIOS, not presented as available_clocksource -- config, kernel code, &/or BIOS?

2017-05-13 Thread Andrew Cooper
On 13/05/2017 20:49, PGNet Dev wrote: > On 5/13/17 12:38 PM, Andrew Cooper wrote: >> What is the issue here? >> >> Xen owns (and may use) any HPETs in the system. They are purposefully >> unavailable to even dom0. > The issue is that, when booting to Xen, hpet is not

Re: [Xen-devel] HPET enabled in BIOS, not presented as available_clocksource -- config, kernel code, &/or BIOS?

2017-05-13 Thread Andrew Cooper
On 13/05/2017 20:28, Randy Dunlap wrote: > On 05/13/17 11:26, PGNet Dev wrote: >> On 5/13/17 10:41 AM, Randy Dunlap wrote: >>> [adding HPET driver maintainer] >> Thanks >> >>> A couple of comments below... In BIOS, HPET's enabled. >>> How about if you just boot Linux without Xen? Does HPET sh

Re: [Xen-devel] HPET enabled in BIOS, not presented as available_clocksource -- config, kernel code, &/or BIOS?

2017-05-13 Thread Andrew Cooper
On 13/05/2017 21:05, PGNet Dev wrote: > On 5/13/17 12:59 PM, Andrew Cooper wrote: >> Ok. Lack of a clocksource is to be expected. >> >> The reason why the HPETs are unavailable is that dom0 is not a position >> to program them; dom0 doesn't know what Xen has set up

Re: [Xen-devel] HPET enabled in BIOS, not presented as available_clocksource -- config, kernel code, &/or BIOS?

2017-05-14 Thread Andrew Cooper
On 14/05/17 00:17, PGNet Dev wrote: > On 5/13/17 3:15 PM, Valentin Vidic wrote: >> Try booting without 'hpet=force,verbose clocksource=hpet' and it should >> select xen by default: > Nope. Well, not quite ... > > With both > > 'hpet=force,verbose clocksource=hpet' > > removed, I end up with

Re: [PATCH] x86/retpoline: Fill RSB on context switch for affected CPUs

2018-01-12 Thread Andrew Cooper
On 12/01/18 17:49, David Woodhouse wrote: > When we context switch from a shallow call stack to a deeper one, as we > 'ret' up the deeper side we may encounter RSB entries (predictions for > where the 'ret' goes to) which were populated in userspace. This is > problematic if we have neither SMEP no

Re: [PATCH] x86/xen: init %gs very early to avoid page faults with stack protector

2018-02-01 Thread Andrew Cooper
On 01/02/18 12:16, Juergen Gross wrote: > When running as Xen pv guest %gs is initialized some time after > C code is started. Depending on stack protector usage this might be > too late, resulting in page faults. > > So setup %gs and MSR_GS_BASE in assembly code already. > > Cc: sta...@vger.kernel

Re: [PATCH 23/35] x86/speculation: Add basic speculation control code

2018-01-18 Thread Andrew Cooper
On 18/01/2018 23:25, Andy Lutomirski wrote: > On Thu, Jan 18, 2018 at 11:08 AM, Andrea Arcangeli > wrote: >> On Thu, Jan 18, 2018 at 12:24:31PM -0600, Josh Poimboeuf wrote: >>> On Thu, Jan 18, 2018 at 06:12:36PM +0100, Paolo Bonzini wrote: On 18/01/2018 18:08, Dave Hansen wrote: > On 01/

Re: [PATCH v2 2/8] x86/cpufeatures: Add AMD feature bits for Prediction Command

2018-01-21 Thread Andrew Cooper
On 21/01/18 17:50, Tom Lendacky wrote: > On 1/21/2018 3:49 AM, David Woodhouse wrote: >> AMD doesn't implement the Speculation Control MSR that Intel does, but >> the Prediction Control MSR does exist and is advertised by a separate >> CPUID bit. Add support for that. >> >> Signed-off-by: David Woo

Re: [PATCH v2 5/8] x86/speculation: Add basic support for IBPB

2018-01-21 Thread Andrew Cooper
On 21/01/18 19:31, David Woodhouse wrote: > On Sun, 2018-01-21 at 20:01 +0100, Borislav Petkov wrote: >> so execution runs directly into the MSR write and the JMP is gone. >> >> So I don't see indirect branches anywhere... > Wait until the wind changes. > > Congratulations, you've just turned a pot

Re: [PATCH v2 5/8] x86/speculation: Add basic support for IBPB

2018-01-21 Thread Andrew Cooper
On 21/01/2018 20:04, David Woodhouse wrote: > On Sun, 2018-01-21 at 19:37 +0000, Andrew Cooper wrote: >> It doesn't matter if an attacker can use SP1 to try and skip the IBPB. >> >> Exits to userspace/guest are serialising (with some retroactive updates >> to the

Re: [PATCH v2 2/8] x86/cpufeatures: Add AMD feature bits for Prediction Command

2018-01-22 Thread Andrew Cooper
On 22/01/18 14:31, Tom Lendacky wrote: > On 1/21/2018 12:01 PM, Andrew Cooper wrote: >> On 21/01/18 17:50, Tom Lendacky wrote: >>> On 1/21/2018 3:49 AM, David Woodhouse wrote: >>>> AMD doesn't implement the Speculation Control MSR that Intel does, but >>>

Re: [PATCH 0/7] IBRS patch series

2018-01-04 Thread Andrew Cooper
On 04/01/18 19:33, Linus Torvalds wrote: > On Thu, Jan 4, 2018 at 11:19 AM, David Woodhouse wrote: >> On Skylake the target for a 'ret' instruction may also come from the >> BTB. So if you ever let the RSB (which remembers where the 'call's came >> from get empty, you end up vulnerable. > That sou

Re: [PATCH 5/7] x86: Use IBRS for firmware update path

2018-01-04 Thread Andrew Cooper
On 04/01/18 20:05, Greg KH wrote: > On Thu, Jan 04, 2018 at 09:56:46AM -0800, Tim Chen wrote: >> From: David Woodhouse >> >> We are impervious to the indirect branch prediction attack with retpoline >> but firmware won't be, so we still need to set IBRS to protect >> firmware code execution when c

Re: Avoid speculative indirect calls in kernel

2018-01-04 Thread Andrew Cooper
On 04/01/2018 23:47, Tom Lendacky wrote: > On 1/4/2018 2:05 PM, David Woodhouse wrote: >> On Thu, 2018-01-04 at 14:00 -0600, Tom Lendacky wrote: >>> Yes, lfence is sufficient.  As long as the target is in the register >>> before the lfence and we jump through the register all is good, i.e.: >> Than

Re: [PATCH v5 02/12] x86/retpoline: Add initial retpoline support

2018-01-06 Thread Andrew Cooper
On 06/01/18 11:49, David Woodhouse wrote: > diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c > index 372ba3f..40e6e54 100644 > --- a/arch/x86/kernel/cpu/common.c > +++ b/arch/x86/kernel/cpu/common.c > @@ -904,6 +904,11 @@ static void __init early_identify_cpu(struct cpuinfo_

Re: [PATCH v5 02/12] x86/retpoline: Add initial retpoline support

2018-01-06 Thread Andrew Cooper
On 06/01/18 21:23, Thomas Gleixner wrote: > On Sat, 6 Jan 2018, Andrew Cooper wrote: >> On 06/01/18 11:49, David Woodhouse wrote: >>> diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c >>> index 372ba3f..40e6e54 100644 >>> --- a/arch/x86/ke

Re: [tip:x86/pti] x86/cpu/AMD: Use LFENCE_RDTSC instead of MFENCE_RDTSC

2018-01-08 Thread Andrew Cooper
On 08/01/18 10:08, Thomas Gleixner wrote: > On Sat, 6 Jan 2018, tip-bot for Tom Lendacky wrote: > >> Commit-ID: 0bf17c102177d5da9363bf8b1e4704b9996d5079 >> Gitweb: >> https://git.kernel.org/tip/0bf17c102177d5da9363bf8b1e4704b9996d5079 >> Author: Tom Lendacky >> AuthorDate: Fri, 5 Jan 201

Re: [PATCH v6 00/10] Retpoline: Avoid speculative indirect calls in kernel

2018-01-08 Thread Andrew Cooper
On 08/01/18 10:42, Paul Turner wrote: > A sequence for efficiently refilling the RSB is: > mov $8, %rax; > .align 16; >3: call 4f; > 3p: pause; call 3p; > .align 16; > 4: call 5f; > 4p: pause; call 4p; > .align 16; >5: dec %rax; > jnz 3b; > add $(16*8), %

Re: [tip:x86/pti] x86/cpu/AMD: Use LFENCE_RDTSC instead of MFENCE_RDTSC

2018-01-08 Thread Andrew Cooper
On 08/01/18 14:47, Tom Lendacky wrote: > On 1/8/2018 5:10 AM, Thomas Gleixner wrote: >> On Mon, 8 Jan 2018, Andrew Cooper wrote: >> >>> On 08/01/18 10:08, Thomas Gleixner wrote: >>>> On Sat, 6 Jan 2018, tip-bot for Tom Lendacky wrote: >>>> >>&g

Re: [RFC PATCH 00/16] PTI support for x86-32

2018-01-16 Thread Andrew Cooper
On 16/01/18 18:59, Linus Torvalds wrote: > On Tue, Jan 16, 2018 at 8:36 AM, Joerg Roedel wrote: >> One of the things that are surely broken is XEN_PV support. >> I'd appreciate any help with testing and bugfixing on that >> front. > Xen PV and PTI don't work together even on x86-64 afaik, the Xen

Re: [PATCH 02/16] x86/entry/32: Enter the kernel via trampoline stack

2018-01-17 Thread Andrew Cooper
On 17/01/18 09:02, Joerg Roedel wrote: > Hi Boris, > > thanks for testing this :) > > On Tue, Jan 16, 2018 at 09:47:06PM -0500, Boris Ostrovsky wrote: >> On 01/16/2018 11:36 AM, Joerg Roedel wrote: >>> +.macro SWITCH_TO_KERNEL_STACK nr_regs=0 check_user=0 >> >> This (and next patch's SWITCH_TO_ENTR

Re: [PATCH v6 11/10] x86/retpoline: Avoid return buffer underflows on context switch

2018-01-08 Thread Andrew Cooper
On 09/01/2018 00:58, Linus Torvalds wrote: > On Mon, Jan 8, 2018 at 4:44 PM, Andi Kleen wrote: >> Essentially the RSB are hidden registers, and the only way to clear them >> is the FILL_RETURN_BUFFER sequence. I don't see how clearing anything else >> would help? > Forget theory. Look at practice

Re: Improve retpoline for Skylake

2018-01-15 Thread Andrew Cooper
On 15/01/18 16:57, Andy Lutomirski wrote: > >> On Jan 15, 2018, at 12:26 AM, Jon Masters wrote: >> >>> On 01/12/2018 05:03 PM, Henrique de Moraes Holschuh wrote: >>> On Fri, 12 Jan 2018, Andi Kleen wrote: > Skylake still loses if it takes an SMI, right? SMMs are usually rare, especially

Re: [PATCH] fix one dead link in ia64/xen.txt

2018-03-20 Thread Andrew Cooper
On 20/03/18 19:56, Dongliang Mu wrote: > Signed-off-by: Dongliang Mu > --- > Documentation/ia64/xen.txt | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/Documentation/ia64/xen.txt b/Documentation/ia64/xen.txt > index a12c74ce2773..464d4c29b8b5 100644 > --- a/Documentat

Re: [PATCH] KVM: X86: Fix the decoding of segment overrides in 64bit mode

2018-03-22 Thread Andrew Cooper
On 22/03/2018 10:07, Paolo Bonzini wrote: > On 22/03/2018 09:34, Wanpeng Li wrote: >> From: Wanpeng Li >> >> Explicit segment overides other than %fs and %gs are documented as ignored by >> both Intel and AMD. >> >> In practice, this means that: >> >> * Explicit uses of %ss don't actually yield #

Re: [PATCH] KVM: X86: Fix the decoding of segment overrides in 64bit mode

2018-03-22 Thread Andrew Cooper
On 22/03/2018 10:42, Paolo Bonzini wrote: > On 22/03/2018 11:19, Andrew Cooper wrote: >> On 22/03/2018 10:07, Paolo Bonzini wrote: >>> On 22/03/2018 09:34, Wanpeng Li wrote: >>>> From: Wanpeng Li >>>> >>>> Explicit segment overides oth

Re: [PATCH] KVM: X86: Fix the decoding of segment overrides in 64bit mode

2018-03-22 Thread Andrew Cooper
On 22/03/18 13:39, Wanpeng Li wrote: > 2018-03-22 20:38 GMT+08:00 Paolo Bonzini : >> On 22/03/2018 12:04, Andrew Cooper wrote: >>> We've got a Force Emulation Prefix (ud2a; .ascii "xen") for doing >>> magic. Originally, this was used for PV guests to exp

Re: [PATCH] KVM: X86: Fix the decoding of segment overrides in 64bit mode

2018-03-23 Thread Andrew Cooper
On 23/03/18 14:27, Wanpeng Li wrote: > 2018-03-22 21:53 GMT+08:00 Andrew Cooper : >> On 22/03/18 13:39, Wanpeng Li wrote: >>> 2018-03-22 20:38 GMT+08:00 Paolo Bonzini : >>>> On 22/03/2018 12:04, Andrew Cooper wrote: >>>>> We've got a For

Re: [Xen-devel] [PATCH v8 1/7] xen/pvh: Split CONFIG_XEN_PVH into CONFIG_PVH and CONFIG_XEN_PVH

2018-12-06 Thread Andrew Cooper
On 06/12/2018 23:30, Paolo Bonzini wrote: > On 07/12/18 00:11, Boris Ostrovsky wrote: >> On 12/6/18 5:49 PM, Paolo Bonzini wrote: >>> On 06/12/18 23:34, Boris Ostrovsky wrote: On 12/6/18 5:11 PM, Paolo Bonzini wrote: > and also > > depends on !EFI > > because even th

Re: [Xen-devel] [PATCH v2] xen: add new hypercall buffer mapping device

2018-06-18 Thread Andrew Cooper
On 18/06/18 15:36, Juergen Gross wrote: > +static int privcmd_buf_mmap(struct file *file, struct vm_area_struct *vma) > +{ > + struct privcmd_buf_private *file_priv = file->private_data; > + struct privcmd_buf_vma_private *vma_priv; > + unsigned long count = vma_pages(vma); > + unsi

Re: [Xen-devel] [PATCH -next] x86/xen: Fix read buffer overflow

2018-12-18 Thread Andrew Cooper
On 18/12/2018 10:42, YueHaibing wrote: > On 2018/12/18 16:31, Juergen Gross wrote: >> On 18/12/2018 09:19, YueHaibing wrote: >>> Fix smatch warning: >>> >>> arch/x86/xen/enlighten_pv.c:649 get_trap_addr() error: >>> buffer overflow 'early_idt_handler_array' 32 <= 32 >>> >>> Fixes: 42b3a4cb5609 ("x

Re: [RFC v3 1/2] x86/xen: add xen_is_preemptible_hypercall()

2015-01-22 Thread Andrew Cooper
ary hypercall page, calls made via >>>>> the new page may be preempted. >>>>> >>>>> Andrew had originally submitted a version of this work [0]. >>>>> >>>>> [0] http://lists.xen.org/archives/html/xen-devel/2014-02/msg01056.

Re: [Xen-devel] [RFC v3 2/2] x86/xen: allow privcmd hypercalls to be preempted

2015-01-22 Thread Andrew Cooper
On 22/01/2015 20:58, Andy Lutomirski wrote: > On Thu, Jan 22, 2015 at 12:37 PM, Steven Rostedt wrote: >> On Thu, 22 Jan 2015 12:24:47 -0800 >> Andy Lutomirski wrote: >> Also, please remove the "notrace", because function tracing goes an extra step to not require RCU being visible. The o

Re: [Xen-devel] [PATCH v5 2/2] x86/xen: allow privcmd hypercalls to be preempted on 64-bit

2015-01-27 Thread Andrew Cooper
On 27/01/15 08:35, Jan Beulich wrote: On 27.01.15 at 02:51, wrote: > Even if David told you this would be acceptable, I have to question > an abstract model of fixing issues on only 64-bit kernels - this may > be acceptable for distro purposes, but seems hardly the right > approach for upstre

Re: [Xen-devel] [PATCH] x86, paravirt, xen: Remove the 64-bit irq_enable_sysexit pvop

2015-04-06 Thread Andrew Cooper
On 06/04/2015 16:29, Andy Lutomirski wrote: > On Mon, Apr 6, 2015 at 7:10 AM, Konrad Rzeszutek Wilk > wrote: >> On Fri, Apr 03, 2015 at 03:52:30PM -0700, Andy Lutomirski wrote: >>> [cc: Boris and Konrad. Whoops] >>> >>> On Fri, Apr 3, 2015 at 3:51 PM, Andy Lutomirski wrote: We don't use irq

[PATCH] [RFC] x86/cpu: Fix SMAP check in PVOPS environments

2015-04-20 Thread Andrew Cooper
not consistent for all builds. It has also been a sitting timebomb since SMAP support was introduced. Use native_save_fl() instead, which will obtain an accurate view of the AC flag. Signed-off-by: Andrew Cooper CC: Thomas Gleixner CC: Ingo Molnar CC: H. Peter Anvin CC: x...@kernel.org CC

Re: [PATCH] [RFC] x86/cpu: Fix SMAP check in PVOPS environments

2015-04-21 Thread Andrew Cooper
On 21/04/2015 01:35, Andy Lutomirski wrote: > On 04/20/2015 10:09 AM, Andrew Cooper wrote: >> There appears to be no formal statement of what pv_irq_ops.save_fl() is >> supposed to return precisely. Native returns the full flags, while >> lguest and >> Xen only return t

[PATCH] x86/cpu: Fix SMAP check in PVOPS environments

2015-06-03 Thread Andrew Cooper
not consistent for all builds. It has also been a sitting timebomb since SMAP support was introduced. Use native_save_fl() instead, which will obtain an accurate view of the AC flag. Signed-off-by: Andrew Cooper Reviewed-by: David Vrabel Tested-by: Rusty Russell CC: Thomas Gleixner CC: Ingo

Re: [PATCH] x86/cpu: Fix SMAP check in PVOPS environments

2015-06-04 Thread Andrew Cooper
On 04/06/15 07:38, H. Peter Anvin wrote: > On 06/03/2015 02:31 AM, Andrew Cooper wrote: >> There appears to be no formal statement of what pv_irq_ops.save_fl() is >> supposed to return precisely. Native returns the full flags, while lguest >> and >> Xen only return t

Re: [Xen-devel] [PATCH 95/98] HACK: fix include/uapi/xen/privcmd.h compilation in userspace

2015-05-30 Thread Andrew Cooper
On 30/05/15 16:39, Mikko Rapeli wrote: > privcmd.h depends on xen/interface/xen.h which is now exported to userspace. > xen/interface/xen.h then depends on asm/xen/interface.h which is now > exported to userspace together with its dependencies asm/xen/interface_32.h, > asm/xen/interface_64.h and as

Re: [Xen-devel] [PATCH 2/4] xen/PVH: Use proper CS selector in long mode

2018-05-02 Thread Andrew Cooper
On 02/05/18 16:09, Jan Beulich wrote: On 02.05.18 at 17:08, wrote: >> On 05/02/2018 11:00 AM, Jan Beulich wrote: >> On 02.05.18 at 16:57, wrote: On 05/02/2018 04:05 AM, Jan Beulich wrote: On 30.04.18 at 18:23, wrote: >> Signed-off-by: Boris Ostrovsky > Reviewed-by

Re: [Xen-devel] [PATCH] xen/privcmd: fix static checker warning

2018-06-07 Thread Andrew Cooper
On 07/06/18 11:21, Paul Durrant wrote: > Commit 3ad0876554ca ("xen/privcmd: add IOCTL_PRIVCMD_MMAP_RESOURCE") > introduced a static checker warning: > > drivers/xen/privcmd.c:827 privcmd_ioctl_mmap_resource() > warn: passing casted pointer 'pfns' to 'xen_remap_domain_mfn_array()' > 64 v

Re: [Xen-devel] [PATCH] xen-netback: fix occasional leak of grant ref mappings under memory pressure

2019-02-28 Thread Andrew Cooper
On 28/02/2019 02:03, Igor Druzhinin wrote: > Zero-copy callback flag is not yet set on frag list skb at the moment > xenvif_handle_frag_list() returns -ENOMEM. This eventually results in > leaking grant ref mappings since xenvif_zerocopy_callback() is never > called for these fragments. Those event

Re: [Xen-devel] xen: Can't insert balloon page into VM userspace (WAS Re: [linux-linus bisection] complete test-arm64-arm64-xl-xsm)

2019-03-12 Thread Andrew Cooper
On 12/03/2019 17:18, David Hildenbrand wrote: > On 12.03.19 18:14, Matthew Wilcox wrote: >> On Tue, Mar 12, 2019 at 05:05:39PM +, Julien Grall wrote: >>> On 3/12/19 3:59 PM, Julien Grall wrote: It looks like all the arm test for linus [1] and next [2] tree are now failing. x86 seems t

Re: [Xen-devel] xen/evtchn and forced threaded irq

2019-02-26 Thread Andrew Cooper
On 26/02/2019 09:14, Roger Pau Monné wrote: > On Mon, Feb 25, 2019 at 01:55:42PM +, Julien Grall wrote: >> Hi Oleksandr, >> >> On 25/02/2019 13:24, Oleksandr Andrushchenko wrote: >>> On 2/22/19 3:33 PM, Julien Grall wrote: Hi, On 22/02/2019 12:38, Oleksandr Andrushchenko wrote: >

Re: [RFC PATCH] x86/retpolines: Prevent speculation after RET

2021-02-19 Thread Andrew Cooper
On 19/02/2021 08:15, Peter Zijlstra wrote: > On Thu, Feb 18, 2021 at 08:11:38PM +0100, Borislav Petkov wrote: >> On Thu, Feb 18, 2021 at 08:02:31PM +0100, Peter Zijlstra wrote: >>> On Thu, Feb 18, 2021 at 07:46:39PM +0100, Borislav Petkov wrote: Both vendors speculate after a near RET in some

Re: [PATCH] x86/debug: 'Fix' ptrace dr6 output

2021-01-28 Thread Andrew Cooper
On 28/01/2021 18:20, Peter Zijlstra wrote: > --- a/arch/x86/kernel/hw_breakpoint.c > +++ b/arch/x86/kernel/hw_breakpoint.c > @@ -496,9 +496,32 @@ static int hw_breakpoint_handler(struct > dr6_p = (unsigned long *)ERR_PTR(args->err); > dr6 = *dr6_p; > > - /* If it's a single step,

Re: [RFC 03/20] mm/mprotect: do not flush on permission promotion

2021-01-31 Thread Andrew Cooper
On 31/01/2021 02:59, Andy Lutomirski wrote: diff --git a/arch/x86/include/asm/tlbflush.h b/arch/x86/include/asm/tlbflush.h index 8c87a2e0b660..a617dc0a9b06 100644 --- a/arch/x86/include/asm/tlbflush.h +++ b/arch/x86/include/asm/tlbflush.h @@ -255,6 +255,50 @@ static i

Re: [RFC 03/20] mm/mprotect: do not flush on permission promotion

2021-01-31 Thread Andrew Cooper
On 31/01/2021 01:07, Andy Lutomirski wrote: > Adding Andrew Cooper, who has a distressingly extensive understanding > of the x86 PTE magic. Pretty sure it is all learning things the hard way... > On Sat, Jan 30, 2021 at 4:16 PM Nadav Amit wrote: >> diff --git a/mm/mprotect.c

Re: [RFC 03/20] mm/mprotect: do not flush on permission promotion

2021-02-01 Thread Andrew Cooper
On 01/02/2021 05:58, Nadav Amit wrote: >> On Jan 31, 2021, at 4:10 AM, Andrew Cooper wrote: >> >> On 31/01/2021 01:07, Andy Lutomirski wrote: >>> Adding Andrew Cooper, who has a distressingly extensive understanding >>> of the x86 PTE magic. >> Pretty s

Re: [RFC][PATCH 2/2] x86: add extra serialization for non-serializing MSRs

2021-02-04 Thread Andrew Cooper
On 05/03/2020 17:47, Dave Hansen wrote: > Jan Kiszka reported that the x2apic_wrmsr_fence() function uses a > plain "mfence" while the Intel SDM (10.12.3 MSR Access in x2APIC > Mode) calls for "mfence;lfence". > > Short summary: we have special MSRs that have weaker ordering > than all the rest. A

Re: [RFC][PATCH 2/2] x86: add extra serialization for non-serializing MSRs

2021-02-05 Thread Andrew Cooper
On 05/02/2021 10:02, Peter Zijlstra wrote: > On Thu, Feb 04, 2021 at 04:11:12PM -0800, Andy Lutomirski wrote: >> I'm wondering if a more mild violation is possible: >> >> Initialize *addr = 0. >> >> mov $1, (addr) >> wrmsr >> >> remote cpu's IDT vector: >> >> mov (addr), %rax >> %rax == 0! >> >> Th

Re: [PATCH 02/14] x86/hw_breakpoint: Prevent data breakpoints on direct GDT

2020-05-30 Thread Andrew Cooper
On 29/05/2020 22:27, Peter Zijlstra wrote: > From: Lai Jiangshan > > A data breakpoint on the GDT is terrifying and should be avoided. > The GDT on CPU entry area is already protected. The direct GDT > should be also protected, although it is seldom used and only > used for short time. While I ag

Re: [patch V6 10/37] x86/entry: Switch XEN/PV hypercall entry to IDTENTRY

2020-05-20 Thread Andrew Cooper
On 20/05/2020 09:06, Jürgen Groß wrote: > On 19.05.20 21:44, Andy Lutomirski wrote: >> On Tue, May 19, 2020 at 11:58 AM Thomas Gleixner >> wrote: >>> >>> Andy Lutomirski writes: B: Turn this thing around.  Specifically, in the one and only case we care about, we know pretty much exactly

Re: [PATCH] xen/privcmd: allow fetching resource sizes

2021-01-11 Thread Andrew Cooper
On 11/01/2021 22:09, boris.ostrov...@oracle.com wrote: > On 1/11/21 10:29 AM, Roger Pau Monne wrote: >> >> +xdata.domid = kdata.dom; >> +xdata.type = kdata.type; >> +xdata.id = kdata.id; >> + >> +if (!kdata.addr && !kdata.num) { > > I think we should not allow only one of them to

Re: [patch 27/30] xen/events: Only force affinity mask for percpu interrupts

2020-12-11 Thread Andrew Cooper
On 11/12/2020 21:27, Thomas Gleixner wrote: > On Fri, Dec 11 2020 at 09:29, boris ostrovsky wrote: > >> On 12/11/20 7:37 AM, Thomas Gleixner wrote: >>> On Fri, Dec 11 2020 at 13:10, Jürgen Groß wrote: On 11.12.20 00:20, boris.ostrov...@oracle.com wrote: > On 12/10/20 2:26 PM, Thomas Gleixn

Re: [PATCH v2] xen/privcmd: allow fetching resource sizes

2021-01-12 Thread Andrew Cooper
r Pau Monné >> Cc: sta...@vger.kernel.org # >= 4.18 > > Reviewed-by: Juergen Gross Tested-by: Andrew Cooper

Re: [PATCH 17/21] x86/acpi: Convert indirect jump to retpoline

2021-01-14 Thread Andrew Cooper
On 14/01/2021 19:40, Josh Poimboeuf wrote: > It's kernel policy to not have (unannotated) indirect jumps because of > Spectre v2. This one's probably harmless, but better safe than sorry. > Convert it to a retpoline. > > Cc: "Rafael J. Wysocki" > Cc: Len Brown > Cc: Pavel Machek > Signed-off-by

Re: [PATCH 17/21] x86/acpi: Convert indirect jump to retpoline

2021-01-14 Thread Andrew Cooper
On 14/01/2021 23:47, Josh Poimboeuf wrote: > On Thu, Jan 14, 2021 at 10:59:39PM +0000, Andrew Cooper wrote: >> On 14/01/2021 19:40, Josh Poimboeuf wrote: >>> It's kernel policy to not have (unannotated) indirect jumps because of >>> Spectre v2. This one's pr

Re: Why does glibc use AVX-512?

2021-03-26 Thread Andrew Cooper
On 26/03/2021 19:47, Andy Lutomirski wrote: > On Fri, Mar 26, 2021 at 12:34 PM Florian Weimer wrote: >> * Andy Lutomirski: >> > AVX-512 cleared, and programs need to explicitly request enablement. > This would allow programs to opt into not saving/restoring across > signals or to save/

[PATCH] x86/cpu: Comment Skylake server stepping too

2021-04-09 Thread Andrew Cooper
Further to commit 53375a5a218e ("x86/cpu: Resort and comment Intel models"), CascadeLake and CooperLake are steppings of Skylake, and make up the 1st to 3rd generation "Xeon Scalable Processor" line. Signed-off-by: Andrew Cooper --- CC: Peter Zijlstra CC: Tony Luck CC

Re: [PATCH v2] xen/xenbus: make xs_talkv() interruptible

2020-12-17 Thread Andrew Cooper
On 16/12/2020 08:21, Jürgen Groß wrote: > On 15.12.20 21:59, Andrew Cooper wrote: >> On 15/12/2020 11:10, Juergen Gross wrote: >>> In case a process waits for any Xenstore action in the xenbus driver >>> it should be interruptible by signals. >>> >>>

Re: [PATCH 6/7] xen/evtch: use smp barriers for user event ring

2021-02-08 Thread Andrew Cooper
On 06/02/2021 10:49, Juergen Gross wrote: > The ring buffer for user events is used in the local system only, so > smp barriers are fine for ensuring consistency. > > Reported-by: Andrew Cooper > Signed-off-by: Juergen Gross These need to be virt_* to not break in UP bui

Re: [PATCH 6/7] xen/evtch: use smp barriers for user event ring

2021-02-08 Thread Andrew Cooper
On 08/02/2021 09:50, Jan Beulich wrote: > On 08.02.2021 10:44, Andrew Cooper wrote: >> On 06/02/2021 10:49, Juergen Gross wrote: >>> The ring buffer for user events is used in the local system only, so >>> smp barriers are fine for ensuring consistency. >>

Re: [PATCH 6/7] xen/evtch: use smp barriers for user event ring

2021-02-08 Thread Andrew Cooper
On 08/02/2021 10:25, Jürgen Groß wrote: > On 08.02.21 11:23, Andrew Cooper wrote: >> On 08/02/2021 09:50, Jan Beulich wrote: >>> On 08.02.2021 10:44, Andrew Cooper wrote: >>>> On 06/02/2021 10:49, Juergen Gross wrote: >>>>> The ring buffer for use

Re: [PATCH 6/7] xen/evtch: use smp barriers for user event ring

2021-02-08 Thread Andrew Cooper
On 08/02/2021 10:36, Jan Beulich wrote: > On 08.02.2021 11:23, Andrew Cooper wrote: >> On 08/02/2021 09:50, Jan Beulich wrote: >>> On 08.02.2021 10:44, Andrew Cooper wrote: >>>> On 06/02/2021 10:49, Juergen Gross wrote: >>>>> The ring buffer for use

Re: [PATCH] x86/xen: avoid warning in Xen pv guest with CONFIG_AMD_MEM_ENCRYPT enabled

2021-01-25 Thread Andrew Cooper
On 25/01/2021 14:00, Juergen Gross wrote: > diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c > index 4409306364dc..82948251f57b 100644 > --- a/arch/x86/xen/enlighten_pv.c > +++ b/arch/x86/xen/enlighten_pv.c > @@ -583,6 +583,14 @@ DEFINE_IDTENTRY_RAW(xenpv_exc_debug) >

Re: [PATCH v2] x86/xen: avoid warning in Xen pv guest with CONFIG_AMD_MEM_ENCRYPT enabled

2021-01-27 Thread Andrew Cooper
On 27/01/2021 09:38, Juergen Gross wrote: > diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c > index 4409306364dc..ca5ac10fcbf7 100644 > --- a/arch/x86/xen/enlighten_pv.c > +++ b/arch/x86/xen/enlighten_pv.c > @@ -583,6 +583,12 @@ DEFINE_IDTENTRY_RAW(xenpv_exc_debug) >

Re: [PATCH v2] x86/xen: avoid warning in Xen pv guest with CONFIG_AMD_MEM_ENCRYPT enabled

2021-01-27 Thread Andrew Cooper
On 27/01/2021 10:26, Jürgen Groß wrote: > On 27.01.21 10:43, Andrew Cooper wrote: >> On 27/01/2021 09:38, Juergen Gross wrote: >>> diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c >>> index 4409306364dc..ca5ac10fcbf7 100644 >>> --- a/arch/x

Re: [PATCH v2] x86/xen: avoid warning in Xen pv guest with CONFIG_AMD_MEM_ENCRYPT enabled

2021-01-27 Thread Andrew Cooper
On 27/01/2021 13:59, Jürgen Groß wrote: > On 27.01.21 12:23, Andrew Cooper wrote: >> On 27/01/2021 10:26, Jürgen Groß wrote: >>> On 27.01.21 10:43, Andrew Cooper wrote: >>>> On 27/01/2021 09:38, Juergen Gross wrote: >>>>> diff --git a/arch/x86/xen/enlig

Re: [PATCH v2] xen/xenbus: make xs_talkv() interruptible

2020-12-15 Thread Andrew Cooper
On 15/12/2020 11:10, Juergen Gross wrote: > In case a process waits for any Xenstore action in the xenbus driver > it should be interruptible by signals. > > Signed-off-by: Juergen Gross > --- > V2: > - don't special case SIGKILL as libxenstore is handling -EINTR fine > --- > drivers/xen/xenbus/x

Re: [PATCH] x86/cpu: correct values for GDT_ENTRY_INIT

2020-11-26 Thread Andrew Cooper
On 26/11/2020 11:54, Lukas Bulwahn wrote: > Commit 1e5de18278e6 ("x86: Introduce GDT_ENTRY_INIT()") unintentionally > transformed a few 0x values to 0xf (note: five times "f" instead of > four) as part of the refactoring. The transformation in that change is correct. Segment bases are 20

Re: [PATCH] x86/cpu: correct values for GDT_ENTRY_INIT

2020-11-26 Thread Andrew Cooper
On 26/11/2020 19:15, Andy Lutomirski wrote: > On Thu, Nov 26, 2020 at 11:07 AM Lukas Bulwahn > wrote: >> On Thu, Nov 26, 2020 at 6:16 PM Andrew Cooper >> wrote: >>> On 26/11/2020 11:54, Lukas Bulwahn wrote: >>>> Commit 1e5de18278e6 ("x86:

Re: [Xen-devel] [PATCH v4 3/5] xen: Put EFI machinery in place

2014-05-19 Thread Andrew Cooper
On 16/05/14 21:41, Daniel Kiper wrote: > @@ -0,0 +1,374 @@ > +/* > + * EFI support for Xen. > + * > + * Copyright (C) 1999 VA Linux Systems > + * Copyright (C) 1999 Walt Drummond > + * Copyright (C) 1999-2002 Hewlett-Packard Co. > + * David Mosberger-Tang > + * Stephane Eranian > + * Copyrig

Re: [Xen-devel] [PATCH] x86/xen: Fix 32-bit PV guests's usage of kernel_stack

2014-04-09 Thread Andrew Cooper
On 09/04/14 15:29, David Vrabel wrote: > On 09/04/14 15:21, Jan Beulich wrote: > On 09.04.14 at 16:06, wrote: >>> --- a/arch/x86/xen/xen-asm_32.S >>> +++ b/arch/x86/xen/xen-asm_32.S >>> @@ -88,7 +88,11 @@ ENTRY(xen_iret) >>> * avoid having to reload %fs >>> */ >>> #ifdef CONFIG_SMP

Re: [Xen-devel] [PATCH v3 3/5] x86: Call efi_memblock_x86_reserve_range() on native EFI platform only

2014-03-26 Thread Andrew Cooper
On 26/03/2014 22:01, Daniel Kiper wrote: > On Wed, Mar 26, 2014 at 01:57:23PM +, Matt Fleming wrote: >> On Wed, 26 Mar, at 02:48:45PM, Daniel Kiper wrote: >>> On my machine this function crashes on Xen so that is why I have changed >>> condition. However, if you say that this issue could be sol

Re: [Xen-devel] [PATCH v3 4/7] xen/pciback: Implement PCI reset slot or bus with 'do_flr' SysFS attribute

2014-07-08 Thread Andrew Cooper
On 08/07/14 19:58, kon...@kernel.org wrote: > From: Konrad Rzeszutek Wilk > > The life-cycle of a PCI device in Xen pciback is complex > and is constrained by the PCI generic locking mechanism. > > It starts with the device being binded to us - for which "being bound to us" ~Andrew -- To unsubsc

Re: [Xen-devel] [PATCH v3 1/7] xen-pciback: Document the various parameters and attributes in SysFS

2014-07-08 Thread Andrew Cooper
On 08/07/14 19:58, kon...@kernel.org wrote: > From: Konrad Rzeszutek Wilk > > Which hadn't been done with the initial commit. > > Signed-off-by: Konrad Rzeszutek Wilk > --- > Documentation/ABI/testing/sysfs-driver-pciback | 84 > > 1 files changed, 84 insertions(+), 0

Re: [Xen-devel] [PATCH v3 1/7] xen-pciback: Document the various parameters and attributes in SysFS

2014-07-09 Thread Andrew Cooper
On 09/07/14 14:59, Konrad Rzeszutek Wilk wrote: > >>> +What: /sys/bus/pci/drivers/pciback/irq_handler_state >>> +Date: Oct 2011 >>> +KernelVersion: 3.1 >>> +Contact:xen-de...@lists.xenproject.org >>> +Description: >>> +An option to toggle Xen PCI back to

Re: [Xen-devel] [PATCH v3 1/7] xen-pciback: Document the various parameters and attributes in SysFS

2014-07-09 Thread Andrew Cooper
On 09/07/14 15:13, Konrad Rzeszutek Wilk wrote: > On Wed, Jul 09, 2014 at 03:05:56PM +0100, Andrew Cooper wrote: >> On 09/07/14 14:59, Konrad Rzeszutek Wilk wrote: >>>>> +What: /sys/bus/pci/drivers/pciback/irq_handler_state >>>>> +Date:

  1   2   3   4   >