Re: [PATCH v5 0/9] Enable Sub-page Write Protection Support

2019-09-17 Thread Konrad Rzeszutek Wilk
On Tue, Sep 17, 2019 at 04:52:55PM +0800, Yang Weijiang wrote: > EPT-Based Sub-Page write Protection(SPP)is a HW capability which allows > Virtual Machine Monitor(VMM) to specify write-permission for guest > physical memory at a sub-page(128 byte) granularity. When this > capability is enabled, the

Re: [PATCH] x86/microcode: Add an option to reload microcode even if revision is unchanged

2019-09-06 Thread Konrad Rzeszutek Wilk
> Or someone could rewrite arch/x86/ to rediscover new features upon a > microcode reload or a feature disabling. And do that in a clean way. Who > knows... The clean way to do microcode reloading and the vast amount of re-initialization that has to happen is the definitly what we all want. It ma

Re: [PATCH 1/3] KVM: x86: fix reporting of AMD speculation bug CPUID leaf

2019-08-22 Thread Konrad Rzeszutek Wilk
D, STIBP and AMD_SSB_NO bit were not set, and > VIRT_SSBD does not have to be added manually because it is a > cpufeature that comes directly from the host's CPUID bit. > > Signed-off-by: Paolo Bonzini Reviewed-by: Konrad Rzeszutek Wilk Thank you!

Re: [PATCH 3/3] KVM: x86: use Intel speculation bugs and features as derived in generic x86 code

2019-08-22 Thread Konrad Rzeszutek Wilk
ggested-by: Jim Mattson > Signed-off-by: Paolo Bonzini Reviewed-by: Konrad Rzeszutek Wilk Thank you!

Re: [PATCH 2/3] KVM: x86: always expose VIRT_SSBD to guests

2019-08-22 Thread Konrad Rzeszutek Wilk
CPUs. Make this apparent in the > result of KVM_GET_SUPPORTED_CPUID as well. > > While at it, reuse X86_FEATURE_* constants for the SVM leaf too. > > However, we need to hide the bit on Intel processors, so move > the setting to svm_set_supported_cpuid. > > Cc: Konrad

[GIT PULL] (swiotlb) for-linus-5.3

2019-07-25 Thread Konrad Rzeszutek Wilk
Hey Linus, I've sent you a prior git pull which contained two of the fixes, and this one expands on the one from Juergen which had been committed a while ago but hadn't been fully tested until during the merge window so I delayed until now. Please git pull the following branch: git push gitol...

[GIT PULL] (ibft) for-linus-5.3

2019-07-25 Thread Konrad Rzeszutek Wilk
Hey Linus, Please git pull the following branch which is a tiny bit late (patch was posted furing merge window and I wanted to wait until rc1): git://git.kernel.org/pub/scm/linux/kernel/git/konrad/ibft.git for-linus-5.3 which has one tiny fix to enable iSCSI IBFT to be compiled under ARM. Th

[GIT PULL] (swiotlb) for-linus-5.2

2019-07-17 Thread Konrad Rzeszutek Wilk
Hey Linus, Please git pull the following branch: git pull git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb.git for-linus-5.2 which has one compiler fix, and a bug-fix in swiotlb_nr_tbl() and swiotlb_max_segment() to check also for no_iotlb_memory. Diffstat and changelog below:

Re: cputime takes cstate into consideration

2019-06-26 Thread Konrad Rzeszutek Wilk
On Wed, Jun 26, 2019 at 06:16:08PM +0200, Peter Zijlstra wrote: > On Wed, Jun 26, 2019 at 10:54:13AM -0400, Konrad Rzeszutek Wilk wrote: > > On Wed, Jun 26, 2019 at 12:33:30PM +0200, Thomas Gleixner wrote: > > > On Wed, 26 Jun 2019, Wanpeng Li wrote: > > > > After e

Re: cputime takes cstate into consideration

2019-06-26 Thread Konrad Rzeszutek Wilk
On Wed, Jun 26, 2019 at 12:33:30PM +0200, Thomas Gleixner wrote: > On Wed, 26 Jun 2019, Wanpeng Li wrote: > > After exposing mwait/monitor into kvm guest, the guest can make > > physical cpu enter deeper cstate through mwait instruction, however, > > the top command on host still observe 100% cpu u

Re: [RFC 00/10] Process-local memory allocations for hiding KVM secrets

2019-06-17 Thread Konrad Rzeszutek Wilk
On Mon, Jun 17, 2019 at 11:07:45AM -0700, Dave Hansen wrote: > On 6/17/19 9:53 AM, Nadav Amit wrote: > >>> For anyone following along at home, I'm going to go off into crazy > >>> per-cpu-pgds speculation mode now... Feel free to stop reading now. :) > >>> > >>> But, I was thinking we could get aw

[GIT PULL] (swiotlb) stable/for-linus-5.2

2019-06-11 Thread Konrad Rzeszutek Wilk
Hey Linus, Please git pull the following tiny fix: git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb.git stable/for-linus-5.2 which has one tiny fix for ARM64 where we could allocate the SWIOTLB twice. drivers/xen/swiotlb-xen.c | 12 +++- 1 file changed, 11 insertions(+)

Re: [PATCH v4 5/9] iommu/vt-d: Don't switch off swiotlb if use direct dma

2019-06-10 Thread Konrad Rzeszutek Wilk
On Mon, Jun 03, 2019 at 09:16:16AM +0800, Lu Baolu wrote: > The direct dma implementation depends on swiotlb. Hence, don't > switch of swiotlb since direct dma interfaces are used in this s/of/off/ > driver. But I think you really want to leave the code as is but change the #ifdef to check for I

Re: [PATCH RFC 0/2] x86/boot: Introduce the setup_header2

2019-06-06 Thread Konrad Rzeszutek Wilk
On Thu, Jun 06, 2019 at 01:51:08PM +0200, Daniel Kiper wrote: > On Wed, Jun 05, 2019 at 10:01:17AM -0400, Konrad Rzeszutek Wilk wrote: > > On Wed, Jun 05, 2019 at 03:50:31PM +0200, Daniel Kiper wrote: > > > On Fri, May 24, 2019 at 11:55:02AM +0200, Daniel Kiper

Re: [PATCH RFC 0/2] x86/boot: Introduce the setup_header2

2019-06-05 Thread Konrad Rzeszutek Wilk
On Wed, Jun 05, 2019 at 03:50:31PM +0200, Daniel Kiper wrote: > On Fri, May 24, 2019 at 11:55:02AM +0200, Daniel Kiper wrote: > > Hi, > > > > This change is needed to properly start the Linux kernel in Intel TXT mode > > and > > is a part of the TrenchBoot project (https://github.com/TrenchBoot).

Re: [PATCH] sched: introduce configurable delay before entering idle

2019-05-14 Thread Konrad Rzeszutek Wilk
On Tue, May 14, 2019 at 10:50:23AM -0300, Marcelo Tosatti wrote: > On Mon, May 13, 2019 at 05:20:37PM +0800, Wanpeng Li wrote: > > On Wed, 8 May 2019 at 02:57, Marcelo Tosatti wrote: > > > > > > > > > Certain workloads perform poorly on KVM compared to baremetal > > > due to baremetal's ability to

Re: [PATCH] sched: introduce configurable delay before entering idle

2019-05-13 Thread Konrad Rzeszutek Wilk
On May 13, 2019 5:20:37 AM EDT, Wanpeng Li wrote: >On Wed, 8 May 2019 at 02:57, Marcelo Tosatti >wrote: >> >> >> Certain workloads perform poorly on KVM compared to baremetal >> due to baremetal's ability to perform mwait on NEED_RESCHED >> bit of task flags (therefore skipping the IPI). > >KVM s

Re: [PATCH] KVM: X86: Enable IA32_MSIC_ENABLE MONITOR bit when exposing mwait/monitor

2019-05-13 Thread Konrad Rzeszutek Wilk
On May 13, 2019 5:46:39 AM EDT, Wanpeng Li wrote: >From: Wanpeng Li > >MSR IA32_MSIC_ENABLE bit 18, according to SDM: > MSIC? (Also the $subject) >| When this bit is set to 0, the MONITOR feature flag is not set >(CPUID.01H:ECX[bit 3] = 0). > | This indicates that MONITOR/MWAIT are not suppo

Re: [PATCH v6 00/14] KVM/X86: Introduce a new guest mapping interface

2019-04-29 Thread Konrad Rzeszutek Wilk
On Mon, Mar 18, 2019 at 07:16:28PM +, Raslan, KarimAllah wrote: > On Mon, 2019-03-18 at 10:22 -0400, Konrad Rzeszutek Wilk wrote: > > On Mon, Mar 18, 2019 at 01:10:24PM +, Raslan, KarimAllah wrote: > > > > > > I guess this patch series missed the 5.1 merge win

Re: [PATCH] KVM: x86: Add Intel CPUID.1F cpuid emulation support

2019-04-22 Thread Konrad Rzeszutek Wilk
On Mon, Apr 22, 2019 at 02:40:34PM +0800, Like Xu wrote: > Expose Intel V2 Extended Topology Enumeration Leaf to guest only when > host system has multiple software-visible die within each package. Is there some doc on this? The https://software.intel.com/en-us/articles/intel-64-architecture-pro

Re: [PATCH v6 00/14] KVM/X86: Introduce a new guest mapping interface

2019-03-18 Thread Konrad Rzeszutek Wilk
On Mon, Mar 18, 2019 at 01:10:24PM +, Raslan, KarimAllah wrote: > I guess this patch series missed the 5.1 merge window? :) Were there any outstanding fixes that had to be addressed? > > On Thu, 2019-01-31 at 21:24 +0100, KarimAllah Ahmed wrote: > > Guest memory can either be directly manage

Re: [PATCH] doc: add boot protocol 2.13 description to Documentation/x86/boot.txt

2019-03-08 Thread Konrad Rzeszutek Wilk
On March 8, 2019 6:43:10 AM EST, Juergen Gross wrote: >Documentation/x86/boot.txt is missing protocol 2.13 description. > >Signed-off-by: Juergen Gross You forgot Reported-by: Ross Philipson ... And pls feel free to add Reviewed-by from me as well. >--- > Documentation/x86/boot.txt | 4

[GIT PULL] (xen) stable/for-jens-5.1 to your 'for-5.1/block' branch.

2019-03-05 Thread Konrad Rzeszutek Wilk
Hi Jens, Apologies for doing it right at the merge window time. This patchset has been brewing for quite a while. git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git stable/for-jens-5.1 This patchset makes the backend more robust by reading a negotiation variable only once and not twic

[GIT PULL] (ibft) stable/for-linus-5.1

2019-03-05 Thread Konrad Rzeszutek Wilk
Hi Linus, Please git pull git://git.kernel.org/pub/scm/linux/kernel/git/konrad/ibft.git stable/for-linus-5.1 which has two tiny fixes - a missing break, and upgrading the subsystem to use modern macros. Thank you! drivers/firmware/iscsi_ibft.c | 1 + drivers/firmware/iscsi_ibft_find.c

[GIT PULL] (swiotlb) stable/for-linus-5.1 branch

2019-03-05 Thread Konrad Rzeszutek Wilk
Hi Linus, Please git pull the git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb.git stable/for-linus-5.1 which expands the SWIOTLB to have debugfs support (along with bug-fixes), and a tiny fix. Thank you! kernel/dma/swiotlb.c | 50

Re: [PATCH] Revert "swiotlb: remove SWIOTLB_MAP_ERROR"

2019-03-04 Thread Konrad Rzeszutek Wilk
On Mon, Mar 04, 2019 at 08:59:03PM +0100, Arnd Bergmann wrote: > This reverts commit b907e20508d0 ("swiotlb: remove SWIOTLB_MAP_ERROR"), which > introduced an overflow warning in configurations that have a larger > dma_addr_t than phys_addr_t: > > In file included from include/linux/dma-direct.h:5

Re: [PATCH v4 00/17] x86/split_lock: Enable #AC exception for split locked accesses

2019-03-04 Thread Konrad Rzeszutek Wilk
> This capability may also find usage in cloud. A user process with split > lock running in one guest can block other cores from accessing shared > memory during its split locked memory access. That may cause overall > system performance degradation. "shared memory" ? As in memory shared between t

Re: [PATCH RFC 20/39] xen-blkback: module_exit support

2019-02-25 Thread Konrad Rzeszutek Wilk
On Wed, Feb 20, 2019 at 08:15:50PM +, Joao Martins wrote: > > Implement module_exit to allow users to do module unload of blkback. > We prevent users from module unload whenever there are still interfaces > allocated, in other words, do module_get on xen_blkif_alloc() and > module_put on xen_b

Re: [PATCH] kvm: vmx: Fix entry nubmer check for add_atomic_switch_msr()

2019-02-15 Thread Konrad Rzeszutek Wilk
On Thu, Feb 14, 2019 at 12:08:58PM +0800, Xiaoyao Li wrote: > Commit ca83b4a7f2d068da79a0 ("x86/KVM/VMX: Add find_msr() helper function") > introduces the helper function find_msr(), which returns -ENOENT when > not find the msr in vmx->msr_autoload.guest/host. Correct checking contion s/not find/

Re: [PATCH] xen/pciback: Don't disable PCI_COMMAND on PCI device reset.

2019-02-15 Thread Konrad Rzeszutek Wilk
On Wed, Feb 13, 2019 at 06:21:31PM -0500, Prarit Bhargava wrote: > From: Konrad Rzeszutek Wilk > +LKML > This was submitted in 2015 here > > https://marc.info/?l=linux-kernel&m=142807132515973&w=2 > > and has been included in Fedora builds ever since. No issues

Re: [PATCH] vfio_pci: Enable memory accesses before calling pci_map_rom

2019-02-13 Thread Konrad Rzeszutek Wilk
On Wed, Feb 13, 2019 at 11:14:06AM +0100, Eric Auger wrote: > pci_map_rom/pci_get_rom_size() performs memory access in the ROM. > In case the Memory Space accesses were disabled, readw() is likely to > crash the host with a synchronous external abort (aarch64). Ouch. Is there an CVE for this? Als

Re: [PATCH v3 1/3] swiotlb: fix comment on swiotlb_bounce()

2019-02-12 Thread Konrad Rzeszutek Wilk
On Fri, Jan 18, 2019 at 03:10:26PM +0800, Dongli Zhang wrote: > Fix the comment as swiotlb_bounce() is used to copy from original dma > location to swiotlb buffer during swiotlb_tbl_map_single(), while to > copy from swiotlb buffer to original dma location during > swiotlb_tbl_unmap_single(). I qu

Re: [PATCH] iscsi_ibft: Fix missing break in switch statement

2019-02-12 Thread Konrad Rzeszutek Wilk
On Mon, Feb 11, 2019 at 12:43:23PM -0600, Gustavo A. R. Silva wrote: > Add missing break statement in order to prevent the code from falling > through to case ISCSI_BOOT_TGT_NAME, which is unnecessary. > > This bug was found thanks to the ongoing efforts to enable > -Wimplicit-fallthrough. > > Fi

Re: [PATCH] iscsi_ibft: use virt_to_phys instead of isa_virt_to_bus

2019-02-12 Thread Konrad Rzeszutek Wilk
On Mon, Feb 11, 2019 at 02:46:42PM +0100, Christoph Hellwig wrote: > As far as I can tell IBFT is a firmware table and has nothing to do with > the good old ISA bus. And even if it the two would be the same on x86 > anyway. So remove the isa_virt_to_bus call in preparation of eventually > removin

Re: [PATCH 0/5 v5] Fix virtio-blk issue with SWIOTLB

2019-01-30 Thread Konrad Rzeszutek Wilk
On Wed, Jan 30, 2019 at 05:40:02PM +0100, Joerg Roedel wrote: > Hi, > > here is the next version of this patch-set. Previous > versions can be found here: > > V1: https://lore.kernel.org/lkml/20190110134433.15672-1-j...@8bytes.org/ > > V2: https://lore.kernel.org/lkml/20190115132257.

Re: [PATCH 0/5 v3] Fix virtio-blk issue with SWIOTLB

2019-01-28 Thread Konrad Rzeszutek Wilk
On Mon, Jan 28, 2019 at 10:20:05AM -0500, Michael S. Tsirkin wrote: > On Wed, Jan 23, 2019 at 04:14:53PM -0500, Konrad Rzeszutek Wilk wrote: > > On Wed, Jan 23, 2019 at 01:51:29PM -0500, Michael S. Tsirkin wrote: > > > On Wed, Jan 23, 2019 at 05:30:44PM +0100, Joerg Roedel

Re: [PATCH] KVM: x86: Sync the pending Posted-Interrupts

2019-01-25 Thread Konrad Rzeszutek Wilk
On Fri, Jan 18, 2019 at 02:34:00PM +0800, Luwei Kang wrote: > Some Posted-Interrupts from passthrough devices may be lost or > overwritten when the vCPU is in runnable state. > > The SN (Suppress Notification) of PID (Posted Interrupt Descriptor) will > be set when the vCPU is preempted (vCPU in K

Re: [PATCH 0/5 v3] Fix virtio-blk issue with SWIOTLB

2019-01-23 Thread Konrad Rzeszutek Wilk
On Wed, Jan 23, 2019 at 01:51:29PM -0500, Michael S. Tsirkin wrote: > On Wed, Jan 23, 2019 at 05:30:44PM +0100, Joerg Roedel wrote: > > Hi, > > > > here is the third version of this patch-set. Previous > > versions can be found here: > > > > V1: https://lore.kernel.org/lkml/20190110134433.156

Re: [PATCH v5 13/13] KVM/nVMX: Use page_address_valid in a few more locations

2019-01-23 Thread Konrad Rzeszutek Wilk
On Wed, Jan 09, 2019 at 10:42:13AM +0100, KarimAllah Ahmed wrote: > Use page_address_valid in a few more locations that is already checking for > a page aligned address that does not cross the maximum physical address. Where is this page_address_valid declared? The latest linus's tree does not hav

Re: [PATCH v5 00/13] KVM/X86: Introduce a new guest mapping interface

2019-01-23 Thread Konrad Rzeszutek Wilk
On Wed, Jan 09, 2019 at 10:42:00AM +0100, KarimAllah Ahmed wrote: > Guest memory can either be directly managed by the kernel (i.e. have a "struct > page") or they can simply live outside kernel control (i.e. do not have a > "struct page"). KVM mostly support these two modes, except in a few places

Re: [PATCH v5 12/13] KVM/nVMX: Use kvm_vcpu_map for accessing the enlightened VMCS

2019-01-23 Thread Konrad Rzeszutek Wilk
On Wed, Jan 09, 2019 at 10:42:12AM +0100, KarimAllah Ahmed wrote: > Use kvm_vcpu_map for accessing the enhanced VMCS since using > kvm_vcpu_gpa_to_page() and kmap() will only work for guest memory that has > a "struct page". > > Signed-off-by: KarimAllah Ahmed Reviewed-by: Konrad Rzeszutek Wilk

Re: [PATCH v5 11/13] KVM/nVMX: Use kvm_vcpu_map for accessing the shadow VMCS

2019-01-23 Thread Konrad Rzeszutek Wilk
On Wed, Jan 09, 2019 at 10:42:11AM +0100, KarimAllah Ahmed wrote: > Use kvm_vcpu_map for accessing the shadow VMCS since using > kvm_vcpu_gpa_to_page() and kmap() will only work for guest memory that has > a "struct page". > > Signed-off-by: KarimAllah Ahmed Reviewed-by: Konrad Rzessutek Wilk

Re: [PATCH v5 10/13] KVM/nSVM: Use the new mapping API for mapping guest memory

2019-01-23 Thread Konrad Rzeszutek Wilk
On Wed, Jan 09, 2019 at 10:42:10AM +0100, KarimAllah Ahmed wrote: > Use the new mapping API for mapping guest memory to avoid depending on > "struct page". > > Signed-off-by: KarimAllah Ahmed Reviewed-by: Konrad Rzeszutek Wilk

Re: [PATCH v5 09/13] KVM/X86: Use kvm_vcpu_map in emulator_cmpxchg_emulated

2019-01-23 Thread Konrad Rzeszutek Wilk
On Wed, Jan 09, 2019 at 10:42:09AM +0100, KarimAllah Ahmed wrote: > Use kvm_vcpu_map in emulator_cmpxchg_emulated since using > kvm_vcpu_gpa_to_page() and kmap() will only work for guest memory that has > a "struct page". > > Signed-off-by: KarimAllah Ahmed Reviewed-by: Konrad Rzeszutek Wilk

Re: [PATCH v5 08/13] KVM/nVMX: Use kvm_vcpu_map when mapping the posted interrupt descriptor table

2019-01-23 Thread Konrad Rzeszutek Wilk
On Wed, Jan 09, 2019 at 10:42:08AM +0100, KarimAllah Ahmed wrote: > Use kvm_vcpu_map when mapping the posted interrupt descriptor table since > using kvm_vcpu_gpa_to_page() and kmap() will only work for guest memory > that has a "struct page". > > One additional semantic change is that the virtual

Re: [PATCH v5 07/13] KVM/nVMX: Use kvm_vcpu_map when mapping the virtual APIC page

2019-01-23 Thread Konrad Rzeszutek Wilk
On Wed, Jan 09, 2019 at 10:42:07AM +0100, KarimAllah Ahmed wrote: > Use kvm_vcpu_map when mapping the virtual APIC page since using > kvm_vcpu_gpa_to_page() and kmap() will only work for guest memory that has > a "struct page". > > One additional semantic change is that the virtual host mapping li

Re: [PATCH v5 04/13] KVM: Introduce a new guest mapping API

2019-01-23 Thread Konrad Rzeszutek Wilk
> + if (dirty) > + kvm_release_pfn_dirty(map->pfn); > + else > + kvm_release_pfn_clean(map->pfn); > + map->hva = NULL; I keep on having this gnawing feeling that we MUST set map->page to NULL. That is I can see how it is not needed if you are using 'map' and 'u

Re: [PATCH v5 05/13] X86/nVMX: handle_vmptrld: Use kvm_vcpu_map when copying VMCS12 from guest memory

2019-01-23 Thread Konrad Rzeszutek Wilk
On Wed, Jan 09, 2019 at 10:42:05AM +0100, KarimAllah Ahmed wrote: > Use kvm_vcpu_map to the map the VMCS12 from guest memory because > kvm_vcpu_gpa_to_page() and kmap() will only work for guest memory that has > a "struct page". > > Signed-off-by: KarimAllah Ahmed Revi

Re: [PATCH v5 04/13] KVM: Introduce a new guest mapping API

2019-01-23 Thread Konrad Rzeszutek Wilk
/kvm_main.c > index 1f888a1..4d8f2e3 100644 > --- a/virt/kvm/kvm_main.c > +++ b/virt/kvm/kvm_main.c > @@ -1733,6 +1733,59 @@ struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn) > } > EXPORT_SYMBOL_GPL(gfn_to_page); > > +static int __kvm_map_gfn(struct kvm_memory_slot *slot, gfn_t gfn, > + struct kvm_host_map *map) > +{ > + kvm_pfn_t pfn; > + void *hva = NULL; > + struct page *page = NULL; > + Would it make sense to check if 'map' is NULL first? Ditto on the unmap? Either way: Reviewed-by: Konrad Rzeszutek Wilk

Re: [PATCH v5 03/13] X86/KVM: Handle PFNs outside of kernel reach when touching GPTEs

2019-01-23 Thread Konrad Rzeszutek Wilk
ump to 'err' label which would have up_read(¤t->mm->mmap_sem); return -EFAULT; which would be after 154 return (ret != orig_pte); But that is bike-shedding so feel free to ignore it. Either way: Revi

Re: [PATCH v5 02/13] X86/nVMX: Update the PML table without mapping and unmapping the page

2019-01-23 Thread Konrad Rzeszutek Wilk
kvm_write_guest_page the page is also properly > marked as dirty. > > Signed-off-by: KarimAllah Ahmed > Reviewed-by: David Hildenbrand Reviewed-by: Konrad Rzeszutek Wilk > --- > v1 -> v2: > - Use kvm_write_guest_page instead of kvm_write_guest (pbonzini) > - Do

Re: [PATCH 0/5 v3] Fix virtio-blk issue with SWIOTLB

2019-01-23 Thread Konrad Rzeszutek Wilk
_size() > virtio-blk: Consider virtio_max_dma_size() for maximum segment size > > drivers/block/virtio_blk.c | 10 ++ > drivers/virtio/virtio_ring.c | 10 ++ The kvm-devel mailing list should have been copied on those. When you do can you please put 'Reviewed-by: K

Re: [PATCH v5 01/13] X86/nVMX: handle_vmon: Read 4 bytes from guest memory

2019-01-23 Thread Konrad Rzeszutek Wilk
y. > > Suggested-by: Jim Mattson > Signed-off-by: KarimAllah Ahmed > Reviewed-by: Jim Mattson > Reviewed-by: David Hildenbrand Mind if I join party? Reviewed-by: Konrad Rzeszutek Wilk > > --- > v1 -> v2: > - Massage commit message a bit. > --- > arch/

Re: [RFC PATCH v7 09/16] mm: add a user_virt_to_phys symbol

2019-01-23 Thread Konrad Rzeszutek Wilk
> +EXPORT_SYMBOL(user_virt_to_phys); Could it be _GPL? OTherwise looks OK to me.

Re: [RFC PATCH v7 07/16] arm64/mm, xpfo: temporarily map dcache regions

2019-01-23 Thread Konrad Rzeszutek Wilk
On Thu, Jan 10, 2019 at 02:09:39PM -0700, Khalid Aziz wrote: > From: Juerg Haefliger > > If the page is unmapped by XPFO, a data cache flush results in a fatal > page fault, so let's temporarily map the region, flush the cache, and then > unmap it. > > v6: actually flush in the face of xpfo, and

Re: [RFC PATCH v7 05/16] arm64/mm: Add support for XPFO

2019-01-23 Thread Konrad Rzeszutek Wilk
On Thu, Jan 10, 2019 at 02:09:37PM -0700, Khalid Aziz wrote: > From: Juerg Haefliger > > Enable support for eXclusive Page Frame Ownership (XPFO) for arm64 and > provide a hook for updating a single kernel page table entry (which is > required by the generic XPFO code). > > v6: use flush_tlb_ker

Re: [PATCH] mm: cleancache: no need to check return value of debugfs_create functions

2019-01-23 Thread Konrad Rzeszutek Wilk
On Tue, Jan 22, 2019 at 04:21:11PM +0100, Greg Kroah-Hartman wrote: > When calling debugfs functions, there is no need to ever check the > return value. The function can work or not, but the code logic should > never do something different based on this. > > Cc: Konrad Rzes

Re: [RFC PATCH v7 05/16] arm64/mm: Add support for XPFO

2019-01-23 Thread Konrad Rzeszutek Wilk
On Thu, Jan 10, 2019 at 02:09:37PM -0700, Khalid Aziz wrote: > From: Juerg Haefliger > > Enable support for eXclusive Page Frame Ownership (XPFO) for arm64 and > provide a hook for updating a single kernel page table entry (which is > required by the generic XPFO code). > > v6: use flush_tlb_ker

Re: [RFC PATCH v7 04/16] swiotlb: Map the buffer if it was unmapped by XPFO

2019-01-23 Thread Konrad Rzeszutek Wilk
On Thu, Jan 10, 2019 at 02:09:36PM -0700, Khalid Aziz wrote: > From: Juerg Haefliger > > v6: * guard against lookup_xpfo() returning NULL > > CC: Konrad Rzeszutek Wilk > Signed-off-by: Juerg Haefliger > Signed-off-by: Tycho Andersen > Signed-off-by: Khalid Az

Re: /proc//status: incorrect format breaks userland tool

2019-01-21 Thread Konrad Rzeszutek Wilk
seq_printf(m, "\nSpeculation_Store_Bypass:\t"); The af884cd4a5ae6 is the one that removed the '\n' from the end and put it in the front of 'Seccomp '. Greg, I am not sure how one would fix this in a stable tree. But t

[GIT PULL] (swiotbl) tiny fix for 5.0rc2

2019-01-17 Thread Konrad Rzeszutek Wilk
Hey Linus, Please pull a tiny fix for v5.0-rc2: git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb.git stable/for-linus-5.0 This fixes an issue with GPU cards not working anymore with the DMA mapping work Christopher did - as the SWIOTLB is initialized first and then free-ed (as IOMM

Re: [Xen-devel] [PATCH v6 2/2] xen/blkback: rework connect_ring() to avoid inconsistent xenstore 'ring-page-order' set by malicious blkfront

2019-01-17 Thread Konrad Rzeszutek Wilk
On Tue, Jan 15, 2019 at 09:20:36AM +0100, Roger Pau Monné wrote: > On Tue, Jan 15, 2019 at 12:41:44AM +0800, Dongli Zhang wrote: > > The xenstore 'ring-page-order' is used globally for each blkback queue and > > therefore should be read from xenstore only once. However, it is obtained > > in read_p

Re: [PATCH v2 2/2] swiotlb: checking whether swiotlb buffer is full with io_tlb_used

2019-01-17 Thread Konrad Rzeszutek Wilk
On Mon, Dec 10, 2018 at 08:37:58AM +0800, Dongli Zhang wrote: > This patch uses io_tlb_used to help check whether swiotlb buffer is full. > io_tlb_used is no longer used for only debugfs. It is also used to help > optimize swiotlb_tbl_map_single(). Please split this up. That is have the 'if (unli

Re: [Xen-devel] [PATCH v5 2/2] xen/blkback: rework connect_ring() to avoid inconsistent xenstore 'ring-page-order' set by malicious blkfront

2019-01-16 Thread Konrad Rzeszutek Wilk
On Tue, Jan 08, 2019 at 04:24:32PM +0800, Dongli Zhang wrote: > oops. Please ignore this v5 patch. > > I just realized Linus suggested in an old email not use BUG()/BUG_ON() in the > code. > > I will switch to the WARN() solution and resend again. OK. Did I miss it?

Re: [PATCH 1/3] swiotlb: Export maximum allocation size

2019-01-14 Thread Konrad Rzeszutek Wilk
On Fri, Jan 11, 2019 at 10:12:31AM +0100, Joerg Roedel wrote: > On Thu, Jan 10, 2019 at 12:02:05PM -0500, Konrad Rzeszutek Wilk wrote: > > Why not use swiotlb_nr_tbl ? That is how drivers/gpu/drm use to figure if > > they > > need to limit the size of pages. > > Tha

Re: [PATCH 1/3] swiotlb: Export maximum allocation size

2019-01-10 Thread Konrad Rzeszutek Wilk
On Thu, Jan 10, 2019 at 02:44:31PM +0100, Joerg Roedel wrote: > From: Joerg Roedel > > The SWIOTLB implementation has a maximum size it can > allocate dma-handles for. This needs to be exported so that > device drivers don't try to allocate larger chunks. > > This is especially important for blo

Re: [PATCH net-next 3/3] vhost: access vq metadata through kernel virtual address

2018-12-13 Thread Konrad Rzeszutek Wilk
.giant snip.. > > + npinned = get_user_pages_fast(uaddr, npages, write, pages); > > + if (npinned != npages) > > + goto err; > > + > > As I said I have doubts about the whole approach, but this > implementation in particular isn't a good idea > as it keeps the page around forever. >

Re: [PATCH 00/52] [RFC] virtio-fs: shared file system for virtual machines

2018-12-12 Thread Konrad Rzeszutek Wilk
On Mon, Dec 10, 2018 at 12:12:26PM -0500, Vivek Goyal wrote: > Hi, > > Here are RFC patches for virtio-fs. Looking for feedback on this approach. > > These patches should apply on top of 4.20-rc5. We have also put code for > various components here. > > https://gitlab.com/virtio-fs > > Problem

Re: [PATCH v4 00/14] KVM/X86: Introduce a new guest mapping interface

2018-12-06 Thread Konrad Rzeszutek Wilk
On Mon, Dec 03, 2018 at 10:30:53AM +0100, KarimAllah Ahmed wrote: > Guest memory can either be directly managed by the kernel (i.e. have a "struct > page") or they can simply live outside kernel control (i.e. do not have a > "struct page"). KVM mostly support these two modes, except in a few places

Re: [PATCH] kvm: x86: Report STIBP on GET_SUPPORTED_CPUID

2018-12-05 Thread Konrad Rzeszutek Wilk
x86_features and kvm_cpuid_7_0_edx_x86_features. Shouldn't there also be a patch in QEMU to use it? (aka, +stibp). Reviewed-by: Konrad Rzeszutek Wilk Thank you! > Signed-off-by: Eduardo Habkost > --- > arch/x86/kvm/cpuid.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(

Re: [GIT PULL] x86: remove Intel MPX

2018-12-05 Thread Konrad Rzeszutek Wilk
On Wed, Dec 05, 2018 at 08:44:43AM -0800, Dave Hansen wrote: > Hi x86 maintainers, > > Please pull from: > > git://git.kernel.org/pub/scm/linux/kernel/git/daveh/x86-mpx.git > mpx-remove > > There is only one commit, removing the Intel MPX implementation from the > tree. The benefits of k

Re: [patch V2 08/28] sched/smt: Make sched_smt_present track topology

2018-11-29 Thread Konrad Rzeszutek Wilk
On Thu, Nov 29, 2018 at 09:42:56AM -0500, Konrad Rzeszutek Wilk wrote: > On Sun, Nov 25, 2018 at 07:33:36PM +0100, Thomas Gleixner wrote: > > Currently the 'sched_smt_present' static key is enabled when at CPU bringup > > SMT topology is observed, but it is never disabled

Re: [patch V2 10/28] sched/smt: Expose sched_smt_present static key

2018-11-29 Thread Konrad Rzeszutek Wilk
t; Signed-off-by: Thomas Gleixner Reviewed-by: Konrad Rzeszutek Wilk > --- > > v1 -> v2: Move SMT stuff to separate header. Unbreaks ia64 build > > --- > include/linux/sched/smt.h | 18 ++ > kernel/sched/sched.h |4 +--- > 2 files changed,

Re: [patch V2 09/28] x86/Kconfig: Select SCHED_SMT if SMP enabled

2018-11-29 Thread Konrad Rzeszutek Wilk
ey to every other architecture for nothing. > > Signed-off-by: Thomas Gleixner Reviewed-by: Konrad Rzeszutek Wilk > > --- > arch/x86/Kconfig |8 +--- > 1 file changed, 1 insertion(+), 7 deletions(-) > > --- a/arch/x86/Kconfig > +++ b/arch/x86/Kconfig

Re: [patch V2 08/28] sched/smt: Make sched_smt_present track topology

2018-11-29 Thread Konrad Rzeszutek Wilk
On Sun, Nov 25, 2018 at 07:33:36PM +0100, Thomas Gleixner wrote: > Currently the 'sched_smt_present' static key is enabled when at CPU bringup > SMT topology is observed, but it is never disabled. However there is demand > to also disable the key when the topology changes such that there is no SMT

Re: [patch V2 07/28] x86/speculation: Reorganize speculation control MSRs update

2018-11-29 Thread Konrad Rzeszutek Wilk
> Signed-off-by: Tim Chen > Signed-off-by: Thomas Gleixner Reviewed-by: Konrad Rzeszutek Wilk .. and I also have two tiny comments below - feel free to incorporate or not them in. > > --- > arch/x86/kernel/process.c | 42 -- > 1 file c

Re: [patch V2 02/28] x86/speculation: Clean up spectre_v2_parse_cmdline()

2018-11-29 Thread Konrad Rzeszutek Wilk
On Sun, Nov 25, 2018 at 07:33:30PM +0100, Thomas Gleixner wrote: > Remove the unnecessary 'else' statement in spectre_v2_parse_cmdline() > to save an indentation level. > > Signed-off-by: Tim Chen > Signed-off-by: Thomas Gleixner Reviewed-by: Konrad Rzeszutek Wilk Th

Re: [patch V2 06/28] x86/speculation: Rename SSBD update functions

2018-11-29 Thread Konrad Rzeszutek Wilk
; Rename the "speculative_store*" functions to a more generic name. > > Signed-off-by: Tim Chen > Signed-off-by: Thomas Gleixner Reviewed-by: Konrad Rzeszutek Wilk Thank you!

Re: [patch V2 04/28] x86/speculation: Reorganize cpu_show_common()

2018-11-29 Thread Konrad Rzeszutek Wilk
s need to > be made for a particular method. > > Move the conditionals for STIBP and IBPB string selection into helper > functions, so they can be extended later on. > Yeeey! Reviewed-by: Konrad Rzeszutek Wilk Thank you! > Signed-off-by: Tim Chen > Signed-off-by: Th

Re: [patch V2 03/28] x86/speculation: Remove unnecessary ret variable in cpu_show_common()

2018-11-29 Thread Konrad Rzeszutek Wilk
On Sun, Nov 25, 2018 at 07:33:31PM +0100, Thomas Gleixner wrote: > Signed-off-by: Tim Chen > Signed-off-by: Thomas Gleixner Reviewed-by: Konrad Rzeszutek Wilk Thank you! > > --- > arch/x86/kernel/cpu/bugs.c |5 + > 1 file changed, 1 insertion(+), 4 deletions(-) &

Re: [patch V2 05/28] x86/speculation: Disable STIBP when enhanced IBRS is in use

2018-11-29 Thread Konrad Rzeszutek Wilk
On Sun, Nov 25, 2018 at 07:33:33PM +0100, Thomas Gleixner wrote: > If enhanced IBRS is active, STIBP is redundant for mitigating Spectre v2 > user space exploits from hyperthread sibling. > > Disable STIBP when enhanced IBRS is used. Reviewed-by: Konrad Rzeszutek Wilk Thank you! >

Re: [patch V2 01/28] x86/speculation: Update the TIF_SSBD comment

2018-11-29 Thread Konrad Rzeszutek Wilk
homas Gleixner Reviewed-by: Konrad Rzeszutek Wilk Thank you! > > --- > arch/x86/include/asm/thread_info.h |2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > --- a/arch/x86/include/asm/thread_info.h > +++ b/arch/x86/include/asm/thread_info.h > @@ -7

Re: PLEASE REVERT URGENTLY: Re: [PATCH v5 2/3] x86/boot: add acpi rsdp address to setup_header

2018-11-19 Thread Konrad Rzeszutek Wilk
On Sun, Nov 11, 2018 at 10:49:39AM -0800, H. Peter Anvin wrote: > On 11/10/18 1:03 AM, Juergen Gross wrote: > > > > How would that help? The garabge data written could have the correct > > terminal sentinel value by chance. > > > > That's why I re-used an existing field in setup_header (the versi

Re: [RFC PATCH 0/5] iommu: APIs for paravirtual PASID allocation

2018-11-19 Thread Konrad Rzeszutek Wilk
On Mon, Nov 12, 2018 at 02:44:56PM +0800, Lu Baolu wrote: > This adds an uniformed API set for global PASIDs used by IOMMU > and device drivers which depend on IOMMU. It works for drivers > running on bare metal, full virtualized environments and para- > virtualized environment. > Are there also

Re: [PATCH] drivers/vfio: Fix an 8-byte alignment issue

2018-10-17 Thread Konrad Rzeszutek Wilk
On Wed, Oct 17, 2018 at 01:18:19PM -0500, Wenwen Wang wrote: > This patch adds a 4-byte reserved field in the structure > vfio_eeh_pe_op to make sure that the u64 fields in the structure > vfio_eeh_pe_err are 8-byte aligned. Won't this break 32-bit kernels? That is the size of the structure will n

Re: [PATCH v2 3/3] code-of-conduct: Add back the TAB as the central reporting point

2018-10-10 Thread Konrad Rzeszutek Wilk
conflict. > Reviewed-by: Konrad Rzeszutek Wilk Thank you! > Signed-off-by: James Bottomley > > --- > > v2: Added this patch to allay concerns we were stripping the reporting > mechanism entirely. > --- > Documentation/process/code-of-conduct.rst | 10 +++

Re: [PATCH] KVM: Start populating /sys/hypervisor with KVM entries

2018-10-09 Thread Konrad Rzeszutek Wilk
On Tue, Oct 09, 2018 at 11:54:39AM +0200, Filippo Sironi wrote: > Start populating /sys/hypervisor with KVM entries when we're running on > KVM. This is to replicate functionality that's available when we're > running on Xen. > > Let's start with /sys/hypervisor/uuid, which users prefer over > /sy

[GIT PULL] (xen) stable/for-jens-4.19 for 4.19..

2018-08-27 Thread Konrad Rzeszutek Wilk
Hey Jens, Would you be OK pulling the following branch: git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git stable/for-jens-4.19 which has a fix for flushing out persistent pages at a deterministic rate. Thanks to the L1TF I did not manage to send this email until today - but hopefull

Re: [PATCH] KVM: VMX: fixes for vmentry_l1d_flush module parameter

2018-08-22 Thread Konrad Rzeszutek Wilk
BUG_L1TF) > > ... and a small refactoring, since the .cmd field is redundant with > the index in the array. > > Reported-by: Bandan Das > Cc: sta...@vger.kernel.org > Fixes: a7b9020b06ec6d7c3f3b0d4ef1a9eba12654f4f7 > Signed-off-by: Paolo Bonzini Reviewed-by: Konrad Rzeszutek

Redoing eXclusive Page Frame Ownership (XPFO) with isolated CPUs in mind (for KVM to isolate its guests per CPU)

2018-08-20 Thread Konrad Rzeszutek Wilk
Hi! See eXclusive Page Frame Ownership (https://lwn.net/Articles/700606/) which was posted way back in in 2016.. In the last couple of months there has been a slew of CPU issues that have complicated a lot of things. The latest - L1TF - is still fresh in folks's mind and it is especially acute

Re: [PATCH] x86/spectre: Expand test for vulnerability to empty RSB exploits

2018-08-08 Thread Konrad Rzeszutek Wilk
1-001), > section 5.3: Virtual Machine CPU Identification. > > Signed-off-by: Jim Mattson > Reviewed-by: Peter Shier Reviewed-by: Konrad Rzeszutek Wilk Thank you as it saves me from doing this :-) > --- > arch/x86/include/asm/msr-index.h | 1 + > arch/x86/kernel/cpu/bug

Re: [PATCH v2] x86/bugs: protect against userspace-userspace spectreRSB

2018-07-30 Thread Konrad Rzeszutek Wilk
On Mon, Jul 30, 2018 at 10:56:55AM -0700, Tim Chen wrote: > On 07/26/2018 04:14 AM, Jiri Kosina wrote: > > From: Jiri Kosina > > > > The article "Spectre Returns! Speculation Attacks using the Return Stack > > Buffer" [1] describes two new (sub-)variants of spectrev2-like attack, > > making use

Re: [PATCH] x86/kvm: Don't use pvqspinlock code if only 1 vCPU

2018-07-18 Thread Konrad Rzeszutek Wilk
On Tue, Jul 17, 2018 at 05:59:27PM -0400, Waiman Long wrote: > On a VM with only 1 vCPU, the locking fast path will always be > successful. In this case, there is no need to use the the PV qspinlock > code which has higher overhead on the unlock side than the native > qspinlock code. Why not make

Re: [PATCHv4 13/18] x86/mm: Allow to disable MKTME after enumeration

2018-07-10 Thread Konrad Rzeszutek Wilk
On July 10, 2018 6:49:10 AM EDT, "Kirill A. Shutemov" wrote: >On Mon, Jul 09, 2018 at 02:20:55PM -0400, Konrad Rzeszutek Wilk wrote: >> On Tue, Jun 26, 2018 at 05:22:40PM +0300, Kirill A. Shutemov wrote: >> > The new helper mktme_disable() allows to disable MKTME

Re: [PATCHv4 18/18] x86: Introduce CONFIG_X86_INTEL_MKTME

2018-07-09 Thread Konrad Rzeszutek Wilk
On Mon, Jul 09, 2018 at 11:59:33AM -0700, Dave Hansen wrote: > On 07/09/2018 11:52 AM, Konrad Rzeszutek Wilk wrote: > > On Mon, Jul 09, 2018 at 11:44:33AM -0700, Dave Hansen wrote: > >> On 07/09/2018 11:36 AM, Konrad Rzeszutek Wilk wrote: > >>> On Tue, Jun 26, 2018

Re: [PATCHv4 18/18] x86: Introduce CONFIG_X86_INTEL_MKTME

2018-07-09 Thread Konrad Rzeszutek Wilk
On Mon, Jul 09, 2018 at 11:44:33AM -0700, Dave Hansen wrote: > On 07/09/2018 11:36 AM, Konrad Rzeszutek Wilk wrote: > > On Tue, Jun 26, 2018 at 05:22:45PM +0300, Kirill A. Shutemov wrote: > > Rip out the X86? > >> + bool "Intel Multi-Key Total Memo

Re: [PATCHv4 18/18] x86: Introduce CONFIG_X86_INTEL_MKTME

2018-07-09 Thread Konrad Rzeszutek Wilk
On Tue, Jun 26, 2018 at 05:22:45PM +0300, Kirill A. Shutemov wrote: > Add new config option to enabled/disable Multi-Key Total Memory > Encryption support. > > MKTME uses MEMORY_PHYSICAL_PADDING to reserve enough space in per-KeyID > direct mappings for memory hotplug. > > Signed-off-by: Kirill A

Re: [PATCHv4 15/18] x86/mm: Calculate direct mapping size

2018-07-09 Thread Konrad Rzeszutek Wilk
On Tue, Jun 26, 2018 at 05:22:42PM +0300, Kirill A. Shutemov wrote: > The kernel needs to have a way to access encrypted memory. We have two > option on how approach it: > > - Create temporary mappings every time kernel needs access to encrypted >memory. That's basically brings highmem and it

Re: [PATCHv4 13/18] x86/mm: Allow to disable MKTME after enumeration

2018-07-09 Thread Konrad Rzeszutek Wilk
On Tue, Jun 26, 2018 at 05:22:40PM +0300, Kirill A. Shutemov wrote: > The new helper mktme_disable() allows to disable MKTME even if it's > enumerated successfully. MKTME initialization may fail and this > functionality allows system to boot regardless of the failure. > > MKTME needs per-KeyID dir

Re: [PATCHv4 07/18] x86/mm: Introduce variables to store number, shift and mask of KeyIDs

2018-07-09 Thread Konrad Rzeszutek Wilk
> diff --git a/arch/x86/mm/Makefile b/arch/x86/mm/Makefile > index 4b101dd6e52f..4ebee899c363 100644 > --- a/arch/x86/mm/Makefile > +++ b/arch/x86/mm/Makefile > @@ -53,3 +53,5 @@ obj-$(CONFIG_PAGE_TABLE_ISOLATION) += pti.o > obj-$(CONFIG_AMD_MEM_ENCRYPT)+= mem_encrypt.o > obj-$(C

<    1   2   3   4   5   6   7   8   9   10   >